Sam Atkins
8b69f41bcd
LibWeb: Remove old parse_length(ComponentValue const&) method
2023-12-30 20:11:24 +01:00
Sam Atkins
0811a39392
LibWeb: Use new parse_length() in filter parsing
2023-12-30 20:11:24 +01:00
Sam Atkins
e0875b99cc
LibWeb: Use new parse_length() in shadow parsing
2023-12-30 20:11:24 +01:00
Sam Atkins
306acf43c4
LibWeb: Convert parse_source_size_value() to TokenStream
2023-12-30 20:11:24 +01:00
Sam Atkins
2f5379bc9b
LibWeb: Use parse_length() for rect() parsing
2023-12-30 20:11:24 +01:00
Sam Atkins
8200fdeddc
LibWeb: Use parse_length_percentage() for border-radius parsing
2023-12-30 20:11:24 +01:00
Sam Atkins
e62d692205
LibWeb: Implement helpers for parsing CSS numeric types
...
Frequently we want to parse "anything that's a `<length-percentage>`" or
similar, which could be a constant value or a calculation, but didn't
have a nice way of doing so. That meant repeating the same "try and
parse a dimension, see if it's the right type, then maybe try and parse
a calculation and see if that's the right type" boilerplate code. Or
more often, forgetting about calculations entirely.
These helpers should make that a lot more convenient to do. And they
also use TokenStream, so we can eventually drop the old `parse_length()`
method.
2023-12-30 20:11:24 +01:00
Shannon Booth
462f97b28a
LibWeb: Port Element::get_attribute_value from ByteString
2023-12-27 09:23:44 +01:00
Sam Atkins
69f88c9a64
LibWeb: Parse grid property using TokenStream
2023-12-26 19:58:20 +00:00
Sam Atkins
5f99edad3b
LibWeb: Parse grid-template property using TokenStream
2023-12-26 19:58:20 +00:00
Sam Atkins
b8c6c75ae1
LibWeb: Parse grid-template-[columns,rows] properties using TokenStream
2023-12-26 19:58:20 +00:00
Sam Atkins
ee5b00d1ee
LibWeb: Parse grid-auto-[columns,rows] properties using TokenStream
2023-12-26 19:58:20 +00:00
Sam Atkins
4c17620712
LibWeb: Parse transform-origin property using TokenStream
2023-12-26 15:32:32 +00:00
Sam Atkins
dd5adb28fd
LibWeb: Parse transform property using TokenStream
...
While I'm at it, use the helper for "none", and remove the unnecessary
whitespace skipping.
2023-12-26 15:32:32 +00:00
Sam Atkins
6a6995cb12
LibWeb: Make text-decoration-line parsing match other properties
2023-12-26 15:32:32 +00:00
Sam Atkins
ed77dee405
LibWeb: Parse text-decoration property using TokenStream
2023-12-26 15:32:32 +00:00
Sam Atkins
513dee04d4
LibWeb: Parse place-self property using TokenStream
2023-12-26 15:32:32 +00:00
Sam Atkins
5a8f57f7b3
LibWeb: Parse place-items property using TokenStream
2023-12-26 15:32:32 +00:00
Sam Atkins
61d6f611cb
LibWeb: Parse place-content property using TokenStream
2023-12-26 15:32:32 +00:00
Sam Atkins
4f773a7dae
LibWeb: Parse overflow property using TokenStream
...
Also simplify it a bit. We don't need to handle 1 / 2 values separately,
but past Sam didn't realise that.
2023-12-26 15:32:32 +00:00
Sam Atkins
0578bec655
LibWeb: Parse math-depth property using TokenStream
...
We don't need to skip whitespace at the top level because that's already
done before we're called. But we do still have to skip it inside the
`add()` function
2023-12-26 15:32:32 +00:00
Sam Atkins
6e0a550a03
LibWeb: Parse list-style property using TokenStream
2023-12-26 15:32:32 +00:00
Sam Atkins
14e2e2bac4
LibWeb: Parse grid track placements using TokenStream
...
I'm not entirely happy with this, but I barely understand grid, and this
does still work.
2023-12-26 15:32:32 +00:00
Shannon Booth
83758d4cdd
LibWeb: Wrap PseudoElements stored in SimpleSelector in a class
...
No functional impact intended. This is just a more complicated way of
writing what we have now.
The goal of this commit is so that we are able to store the 'name' of a
pseudo element for use in serializing 'unknown -webkit-
pseudo-elements', see:
https://www.w3.org/TR/selectors-4/#compat
This is quite awkward, as in pretty much all cases just the selector
type enum is enough, but we will need to cache the name for serializing
these unknown selectors. I can't figure out any reason why we would need
this name anywhere else in the engine, so pretty much everywhere is
still just passing around this raw enum. But this change will allow us
to easily store the name inside of this new struct for when it is needed
for serialization, once those webkit unknown elements are supported by
our engine.
2023-12-11 16:54:59 +01:00
Aliaksandr Kalenik
f50bf00814
LibWeb+LibGfx: Move UnicodeRange from LibWeb to LibGfx
...
In upcoming changes UnicodeRange is going to be used in LibGfx in
a class that represents font cascade list.
2023-12-10 17:32:04 +01:00
Shannon Booth
74b6e7b1f0
LibWeb: Avoid calling FlyString::from_utf8 on FlyString's
2023-12-10 09:45:03 +01:00
Shannon Booth
6ce0d588ee
Everywhere: Avoid calling from_utf8 on FlyString or String
...
We already have a String :^)
2023-12-10 09:45:03 +01:00
Sam Atkins
29ecb2eda6
LibWeb: Parse grid-template-areas property using TokenStream
2023-12-08 10:47:23 +00:00
Sam Atkins
c3583317ee
LibWeb: Parse grid-auto-flow property using TokenStream
...
RefPtr is already `[[nodiscard]]` so we can remove that extra noise from
the declaration.
2023-12-08 10:47:23 +00:00
Sam Atkins
bbbd9c14ac
LibWeb: Parse grid-area property using TokenStream
2023-12-08 10:47:23 +00:00
Sam Atkins
a16b35a755
LibWeb: Parse grid-column and grid-row properties using TokenStream
2023-12-08 10:47:23 +00:00
Sam Atkins
b18c334a4f
LibWeb: Ensure there are no trailing tokens when parsing font-family
2023-12-08 10:47:23 +00:00
Sam Atkins
f84ccb8627
LibWeb: Part font property using TokenStream
2023-12-08 10:47:23 +00:00
Sam Atkins
333b705f25
LibWeb: Parse flex-flow property using TokenStream
2023-12-08 10:47:23 +00:00
Sam Atkins
bf3576667a
LibWeb: Parse flex property using TokenStream
2023-12-08 10:47:23 +00:00
Sam Atkins
4f3136c230
LibWeb: Parse shadow values using TokenStream
2023-12-08 10:47:23 +00:00
Sam Atkins
3a36b2eea9
LibWeb: Parse border properties using TokenStream
2023-12-08 10:47:23 +00:00
Sam Atkins
0e00d9a67d
LibWeb: Parse background property using TokenStream
2023-12-08 10:47:23 +00:00
Sam Atkins
64a44b719e
LibWeb: Parse FilterValueListStyleValue using TokenStream
2023-12-08 10:47:23 +00:00
Sam Atkins
2efaadd63c
LibWeb: Parse aspect-ratio property using TokenStream
2023-12-08 10:47:23 +00:00
Sam Atkins
647d52ff9a
LibWeb: Parse quotes property using TokenStream
2023-12-08 10:47:23 +00:00
Sam Atkins
ebad94658a
LibWeb: Parse display property using TokenStream
2023-12-08 10:47:23 +00:00
Sam Atkins
3d6eb36664
LibWeb: Parse content property using TokenStream
2023-12-08 10:47:23 +00:00
Sam Atkins
4d6e8d8f37
LibWeb: Parse border-radius properties using TokenStream
2023-12-08 10:47:23 +00:00
Sam Atkins
28c719fff5
LibWeb: Extract contains_single_none_ident()
helper function
...
Several CSS properties can be `none` instead of their usual value.
2023-12-08 10:47:23 +00:00
Sam Atkins
1cc88dc4bc
LibWeb: Make parse_comma_separated_value_list() take a TokenStream
...
This lets us use it from inside places that use TokenStreams.
2023-12-08 10:47:23 +00:00
Sam Atkins
cd9344d4c1
LibWeb: Clarify naming of TokenStreams in parse_css_value()
...
Originally, the input was named `tokens`, and we later created a
`tokens_without_whitespace` from the filtered contents of `tokens`.
Since `tokens_without_whitespace` is what we actually want to use while
parsing, let's rename `tokens` -> `unprocessed_tokens` and use the
`tokens` name for the processed ones.
2023-12-08 10:47:23 +00:00
Sam Atkins
ef48d967d4
LibWeb: Correct parsing of background-position 3-value syntax
...
There were two bugs here, one of which hid the other:
- Only one offset would have a value, but we dereferenced both.
- We consumed a token whether it was a valid offset or not.
2023-12-05 09:55:16 +01:00
Shannon Booth
89bbf53745
LibWeb: Port CSS Parser from DeprecatedString
...
These are the last instances of DeprecatedString in the CSS folder.
2023-12-02 22:54:53 +01:00
Shannon Booth
6813dcaff8
LibWeb: Return FlyString const& from CSS::Parser::Token
...
This allows us to not need to convert back to a FlyString when we need
one.
2023-12-02 22:54:53 +01:00