mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibWeb/CSS: Require that tag-name simple selectors go first
This fixes 1 subtest.
This commit is contained in:
parent
a0403ac427
commit
219346011b
Notes:
github-actions[bot]
2024-11-09 13:30:31 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/219346011b5 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2240
2 changed files with 6 additions and 3 deletions
|
@ -6,8 +6,7 @@ Rerun
|
|||
|
||||
Found 32 tests
|
||||
|
||||
31 Pass
|
||||
1 Fail
|
||||
32 Pass
|
||||
Details
|
||||
Result Test Name MessagePass .foo { & { color: green; }}
|
||||
Pass .foo { &.bar { color: green; }}
|
||||
|
@ -26,7 +25,7 @@ Pass .foo { &:is(.bar, .baz) { color: green; }}
|
|||
Pass .foo { :is(.bar, &.baz) { color: green; }}
|
||||
Pass .foo { &:is(.bar, &.baz) { color: green; }}
|
||||
Pass .foo { div& { color: green; }}
|
||||
Fail INVALID: .foo { &div { color: green; }}
|
||||
Pass INVALID: .foo { &div { color: green; }}
|
||||
Pass .foo { .class& { color: green; }}
|
||||
Pass .foo { &.class { color: green; }}
|
||||
Pass .foo { [attr]& { color: green; }}
|
||||
|
|
|
@ -127,6 +127,10 @@ Parser::ParseErrorOr<Optional<Selector::CompoundSelector>> Parser::parse_compoun
|
|||
auto component = TRY(parse_simple_selector(tokens));
|
||||
if (!component.has_value())
|
||||
break;
|
||||
if (component->type == Selector::SimpleSelector::Type::TagName && !simple_selectors.is_empty()) {
|
||||
// Tag-name selectors can only go at the beginning of a compound selector.
|
||||
return ParseError::SyntaxError;
|
||||
}
|
||||
simple_selectors.append(component.release_value());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue