Andreas Kling
359d6e7b0b
Everywhere: Stop using NonnullOwnPtrVector
...
Same as NonnullRefPtrVector: weird semantics, questionable benefits.
2023-03-06 23:46:35 +01:00
Andreas Kling
689ca370d4
Everywhere: Remove NonnullRefPtr.h includes
2023-03-06 23:46:35 +01:00
Andreas Kling
4c75d4af28
LibWeb: Stop using NonnullRefPtrVector for StyleValueVector
2023-03-06 23:46:35 +01:00
Andreas Kling
8a48246ed1
Everywhere: Stop using NonnullRefPtrVector
...
This class had slightly confusing semantics and the added weirdness
doesn't seem worth it just so we can say "." instead of "->" when
iterating over a vector of NNRPs.
This patch replaces NonnullRefPtrVector<T> with Vector<NNRP<T>>.
2023-03-06 23:46:35 +01:00
Matthew Olsson
bab883bf8e
LibJS+LibWeb: Add a bunch of missing includes
2023-03-06 13:05:43 +00:00
Linus Groh
725a758c66
LibIDL: Also parse extended attributes after 'optional'
...
From the WebIDL grammar:
(https://webidl.spec.whatwg.org/#prod-Argument )
Argument ::
ExtendedAttributeList ArgumentRest
ArgumentRest ::
optional TypeWithExtendedAttributes ArgumentName Default
TypeWithExtendedAttributes ::
ExtendedAttributeList Type
One IDL file has been updated to match the spec literally, as it can now
be parsed properly.
2023-03-05 21:59:16 +00:00
Kenneth Myhra
d0f904dd4c
LibWeb: Port MediaQueryListEvent to new String
2023-03-05 18:25:59 +00:00
Andreas Kling
b71c7a6e44
Userland: Use Font::pixel_size_rounded_up() instead of glyph_height()
...
The only remaining clients of this API are specific to bitmap fonts and
editing thereof.
2023-03-04 00:29:38 +01:00
Sam Atkins
cdf80f20e6
LibWeb: Add folding regions to CSS syntax highlighter
2023-03-03 21:56:42 +01:00
Luke Wilde
54f58e2662
LibWeb: Restore proper functionality of legacy platform objects
...
With the GC heap conversion, the functionality of legacy platform
objects was broken. This is because the generated implementation of one
of them was used for all of them, removing functionality such as
deletion.
This re-adds all functionality, where questions such as "does the
object support indexed properties?" is instead answered by virtual
functions instead of by the IDL generator checking the presence of
certain keywords/attributes.
2023-02-28 12:36:14 +01:00
Andreas Kling
7e76a51cb0
LibWeb: Rename Layout::InitialContainingBlock to Layout::Viewport
...
The name "initial containing block" was wrong for this, as it doesn't
correspond to the HTML element, and that's specifically what it's
supposed to do! :^)
2023-02-28 12:21:56 +01:00
Linus Groh
09d40bfbb2
Everywhere: Use _{short_,}string to create Strings from literals
2023-02-25 20:51:49 +01:00
Andreas Kling
f11899f885
LibWeb+LibIDL: Fix (or paper over) various const-correctness issues
...
There's definitely stuff to iterate on here, but this takes care of
making the libraries compile with stricter RP and NNRP.
2023-02-21 00:54:04 +01:00
MacDue
3676f5085e
LibWeb: Replace RefPtr
with ValueComparingRefPtr
in StyleValue
...
Like the name suggests this pointer type compares its pointees by value
rather than just by the pointer. This is needed for the defaulted
struct Properties equality operator.
This commit also contains a few changes to StyleValue such as replacing
the operator==()s with a .equals() again. This is done to avoid the new
reversed operator==()s ambiguity in C++20.
2023-02-20 10:50:20 +01:00
Sam Atkins
2db168acc1
LibTextCodec+Everywhere: Port Decoders to new Strings
2023-02-19 17:15:47 +01:00
Sam Atkins
f2a9426885
LibTextCodec+Everywhere: Return Optional<Decoder&> from decoder_for()
2023-02-19 17:15:47 +01:00
Sam Atkins
6cc5e09c71
LibWeb: Port StyleComputer to new Strings
2023-02-19 00:51:16 +01:00
Sam Atkins
1c77867c78
LibWeb: Port FontCache to new Strings
2023-02-19 00:51:16 +01:00
Sam Atkins
faab2fe101
LibWeb: Store stylesheet sources as StringViews
2023-02-19 00:51:16 +01:00
Sam Atkins
13d2111b74
LibWeb: Port Selector to new Strings
...
Also use `Infra::is_ascii_case_insensitive_match()` in some appropriate
places, after checking the specs.
2023-02-19 00:51:16 +01:00
Sam Atkins
c2f0b20d6b
LibWeb: Port FontFace to new Strings
2023-02-19 00:51:16 +01:00
Sam Atkins
33e9c4e1b2
LibWeb: Port GeneralEnclosed to new Strings
2023-02-19 00:51:16 +01:00
Sam Atkins
2026ea557e
LibWeb: Use is_ascii_case_insensitive_match() where the spec says to
2023-02-19 00:46:47 +01:00
Kenneth Myhra
8fbd43cb27
LibWeb: Make factory method of CSS::ResolvedCSSStyleDeclaration fallible
2023-02-18 00:52:47 +01:00
Kenneth Myhra
719839b882
LibWeb: Make factory method of CSS::StyleSheetList fallible
2023-02-18 00:52:47 +01:00
Kenneth Myhra
57c34e6325
LibWeb: Make factory method of CSS::Screen fallible
2023-02-18 00:52:47 +01:00
Kenneth Myhra
1e24126004
LibWeb: Make factory method of CSS::MediaQueryListEvent fallible
2023-02-18 00:52:47 +01:00
Kenneth Myhra
64e4d3fd94
LibWeb: Make factory method of CSS::CSSSupportsRule fallible
2023-02-18 00:52:47 +01:00
Kenneth Myhra
bc02686ae9
LibWeb: Make factory method of CSS::MediaQueryList fallible
2023-02-18 00:52:47 +01:00
Kenneth Myhra
5d9bc378c3
LibWeb: Make factory method of CSS::MediaList fallible
2023-02-18 00:52:47 +01:00
Kenneth Myhra
a49ea467ad
LibWeb: Make factory method of CSS::CSSStyleSheet fallible
2023-02-18 00:52:47 +01:00
Kenneth Myhra
4f4a908e5f
LibWeb: Make factory method of CSS::CSSStyleRule fallible
2023-02-18 00:52:47 +01:00
Kenneth Myhra
c950d1904a
LibWeb: Make factory methods of CSS::CSSStyleDeclaration fallible
2023-02-18 00:52:47 +01:00
Kenneth Myhra
48872cd190
LibWeb: Make factory methods of CSS::CSSRuleList fallible
2023-02-18 00:52:47 +01:00
Kenneth Myhra
5601f439f9
LibWeb: Make factory method of CSS::CSSMediaRule fallible
2023-02-18 00:52:47 +01:00
Kenneth Myhra
d53d8cacec
LibWeb: Make factory method of CSS::CSSImportRule fallible
2023-02-18 00:52:47 +01:00
Kenneth Myhra
ff8495de35
LibWeb: Make factory method of CSS::CSSFontFaceRule fallible
2023-02-18 00:52:47 +01:00
MacDue
e2691fcdf2
LibWeb: Always move (Nonnull)RefPtr parameters into StyleValues
...
This is done for consistency rather than any performance concerns.
2023-02-17 16:22:56 +00:00
MacDue
ac3af6624b
LibWeb: Use default equality operators for StyleValues
...
This removes a load of manually implemented equality operators. This
is done with a little pattern where all properties of a StyleValue are
placed inside a Properties member struct, with a defaulted equality
operator. This is then used to do the actual StyleValue compare.
There is also a CTRP class to avoid manually implementing the virtual
operator==()s for all StyleValues.
2023-02-17 16:22:56 +00:00
MacDue
9337892ce0
LibWeb: Use default equality operators for StyleValue helper structs
...
Co-authored-by: kleines Filmröllchen <filmroellchen@serenityos.org>
2023-02-17 16:22:56 +00:00
kleines Filmröllchen
d00a6ca11f
AK+LibWeb: Implement Variant equality operator
...
And make use of it for CSS StyleValues.
2023-02-17 16:22:56 +00:00
Sam Atkins
85f3de6331
LibWeb: Port CSS/Serialize.{h,cpp} to new Strings, and propagate errors
2023-02-15 12:48:26 -05:00
Sam Atkins
a0b1eddc56
LibWeb: Port CSS::MediaQuery to new Strings
2023-02-15 12:48:26 -05:00
Sam Atkins
a381ce9519
LibWeb: Port CSS::Supports to new Strings
2023-02-15 12:48:26 -05:00
Sam Atkins
fc3540c4b1
LibWeb: Port CSS::UnicodeRange to new Strings
2023-02-15 12:48:26 -05:00
Sam Atkins
316092d185
LibWeb: Use StringView in CSS::PreferredColorScheme
...
This doesn't need to hold the string data.
2023-02-15 12:48:26 -05:00
Sam Atkins
dca19b764b
LibWeb: Port CSS::Display to new Strings
2023-02-15 12:48:26 -05:00
Sam Atkins
41c4cc95e4
LibWeb: Port CSS::Parser::Rule to new Strings
...
`Rule::to_deprecated_string()` and
`DeclarationOrAtRule::to_deprecated_string()` are not used anywhere, so
we can just delete them.
2023-02-15 12:48:26 -05:00
Sam Atkins
bee32b6cd2
LibWeb: Port CSS::Parser::Declaration to new Strings
2023-02-15 12:48:26 -05:00
Sam Atkins
a168cda4a7
LibWeb: Port CSS::Parser::ComponentValue to new Strings
2023-02-15 12:48:26 -05:00