Sam Atkins
235018046e
LibWeb: Use free functions for parsing in @Supports
2023-03-07 00:43:36 +01:00
Sam Atkins
17618989a3
LibWeb: Propagate errors from CSS Tokenizer construction
...
Instead of constructing a Tokenizer and then calling parse() on it, we
now call `Tokenizer::tokenize(...)` directly. (Renamed from `parse()`
because this is a Tokenizer, not a Parser.)
2023-03-07 00:43:36 +01:00
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
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
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
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
64e4d3fd94
LibWeb: Make factory method of CSS::CSSSupportsRule 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
Sam Atkins
a381ce9519
LibWeb: Port CSS::Supports 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
Sam Atkins
05c1b09621
LibWeb: Port CSS::Parser::Function to new Strings
2023-02-15 12:48:26 -05:00
Sam Atkins
abc01cc9fe
AK+Tests+LibWeb: Make URL::complete_url()
take a StringView
...
All it does is pass this to `URLParser::parse()` which takes a
StringView, so we might as well take one here too.
2023-02-15 12:48:26 -05:00
Sam Atkins
8af65108e4
LibWeb: Construct CSS Tokenizer and Parser with a StringView encoding
...
This doesn't need to be a full (Deprecated)String, so let's not force it
to be.
2023-02-15 12:48:26 -05:00
Sam Atkins
476ec563bc
LibWeb: Convert CSS Token::to_debug_string() to ::to_string() :^)
...
Using from_utf8_short_string() for all cases that are <= 3 bytes long.
Which is almost all of the static ones.
2023-02-13 14:35:40 +00:00
Aliaksandr Kalenik
ab99e95549
LibWeb: Parse font-stretch CSS property
2023-02-03 12:49:13 +00:00
martinfalisse
9bc001f410
LibWeb: Parse grid-area
CSS property
2023-01-21 14:35:00 +01:00
martinfalisse
a6548c4d80
LibWeb: Parse grid-template-areas
CSS property
2023-01-21 14:35:00 +01:00
martinfalisse
0448547553
LibWeb: Parse min and max-content
...
Parse min and max-content as well as use its values in the GridTrackSize
class.
2023-01-21 14:35:00 +01:00
martinfalisse
9d99bd8258
LibWeb: Use String class in certain CSS Grid classes
...
Converts the remaining instances of DeprecatedString to String in the
CSS Grid classes.
2023-01-21 14:35:00 +01:00
Timothy Flynn
f3db548a3d
AK+Everywhere: Rename FlyString to DeprecatedFlyString
...
DeprecatedFlyString relies heavily on DeprecatedString's StringImpl, so
let's rename it to A) match the name of DeprecatedString, B) write a new
FlyString class that is tied to String.
2023-01-09 23:00:24 +00:00
martinfalisse
ce0f41b9fb
LibWeb+WebContent: Use new String class in CSS::StyleValue
...
Converts uses of DeprecatedString to String in StyleValue, and patches
surrounding files that depend on these functions.
2023-01-09 11:09:31 +01:00
Sam Atkins
7d40e3eb0d
LibWeb: Replace all px Length creation with Length::make_px(CSSPixels)
2023-01-05 17:42:31 +01:00
MacDue
d3588a9a2b
LibWeb: Support calc()
values in background-position
2022-12-11 22:09:24 +01:00
Linus Groh
57dc179b1f
Everywhere: Rename to_{string => deprecated_string}() where applicable
...
This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.
One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
2022-12-06 08:54:33 +01:00
Linus Groh
6e19ab2bbc
AK+Everywhere: Rename String to DeprecatedString
...
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00
MacDue
28028be2fc
LibWeb: Support repeating-radial-gradient()
s
2022-12-03 09:06:51 -05:00
MacDue
22a7611e1c
LibWeb: Parse radial-gradient()
s
2022-11-30 14:24:04 +00:00
MacDue
f1f1977e2d
LibWeb: Move color stop list parsing to standalone functions
...
This makes these slightly less clunky to use for other gradient types.
2022-11-30 14:24:04 +00:00
MacDue
c02163c31f
LibWeb: Allow optional values to be missing when parsing <position>
s
2022-11-30 14:24:04 +00:00
martinfalisse
513a123728
LibWeb: Handle multiple line names in the CSS Grid
...
Prevent crashing when multiple line names are declared in the
grid-template-* CSS properties by skipping over the character separating
each line name.
2022-11-21 21:48:25 +00:00
Aliaksandr Kalenik
2675b9390b
LibWeb: Parse unknown media type in media queries
...
Prevent media query parser from falling back into
MediaQuery::create_not_all() for queries with unknown media type.
With this change following test works correctly:
http://wpt.live/css/css-conditional/at-media-001.html
2022-11-14 16:08:35 +00:00
Aliaksandr Kalenik
93238edf8f
LibWeb: Respect media attribute of style tag
2022-11-14 14:47:37 +00:00
MacDue
2c2b9fb1d7
LibWeb: Parse repeating-conic-gradient()
s
2022-11-07 13:13:22 +00:00
MacDue
51cd37110a
LibWeb: Fix parsing conic-gradient()
s with only at <position>
...
This fixes parsing conic-gradient()s like:
conic-gradient(at 60% 45%, red, yellow, green)
Where you have a center position but no starting angle.
2022-11-06 01:42:55 +00:00
Andreas Kling
8869dec5fd
LibWeb: Add CSS::Parser helper for parsing a standalone "calc()" value
2022-11-02 22:42:48 +01:00
Aliaksandr Kalenik
e4db71c88b
LibWeb: Support translate3d
2022-11-02 11:04:23 +00:00
Aliaksandr Kalenik
f099e2aa12
LibWeb: Use more verbose input in CSS transform function generator
2022-11-02 11:04:23 +00:00