mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibWeb: Make CSS 'An+B' parsing spec-compliant
Parsing this pattern from CSS tokens turns out to be slightly crazy, but thankfully well documented in the spec. The spec lists the cases in order of simple -> complicated, but this would cause problems in code, since `<n-dimension> <signed-.integer>` would never by reached, as `<n-dimension>` comes before. Instead, I have grouped them by their first token. Also renamed the NthChildPattern class to ANPlusBPattern, to match spec terminology.
This commit is contained in:
parent
8d0ff98eff
commit
6034fc0ee6
Notes:
sideshowbarker
2024-07-18 07:42:39 +09:00
Author: https://github.com/AtkinsSJ
Commit: 6034fc0ee6
Pull-request: https://github.com/SerenityOS/serenity/pull/9073
Reviewed-by: https://github.com/TobyAsE
Reviewed-by: https://github.com/alimpfard
7 changed files with 333 additions and 92 deletions
|
@ -112,7 +112,7 @@ public:
|
|||
template<typename T>
|
||||
Vector<Vector<StyleComponentValueRule>> parse_as_comma_separated_list_of_component_values(TokenStream<T>&);
|
||||
|
||||
Optional<Selector::SimpleSelector::NthChildPattern> parse_nth_child_pattern(TokenStream<StyleComponentValueRule>&);
|
||||
Optional<Selector::SimpleSelector::ANPlusBPattern> parse_a_n_plus_b_pattern(TokenStream<StyleComponentValueRule>&);
|
||||
|
||||
// FIXME: https://www.w3.org/TR/selectors-4/
|
||||
// Contrary to the name, these parse a comma-separated list of selectors, according to the spec.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue