ladybird/Tests/LibWeb/Text/expected/css/parse-dir-selector.txt
Sam Atkins 8536e23674 LibWeb/CSS: Parse an ident in :dir(), not a keyword
The spec requires us to accept any ident here, not just ltr/rtl, and
also serialize it back out. That means we need to keep the original
string around.

In order to not call keyword_from_string() every time we want to match
a :dir() selector, we still attempt to parse the keyword and keep it
around.

A small behaviour change is that now we'll serialize the ident with its
original casing, instead of always lowercase. Chrome and Firefox
disagree on this, so I think either is fine until that can be
officially decided.

Gets us 2 WPT passes (including 1 from the as-yet-unmerged :dir() test).
2025-05-17 00:30:44 +02:00

15 lines
No EOL
531 B
Text

Harness status: OK
Found 10 tests
10 Pass
Pass ":dir(rtl)" should be a valid selector
Pass ":dir( rtl )" should be a valid selector
Pass ":dir(ltr):dir(rtl)" should be a valid selector
Pass "foo:dir(RTL)" should be a valid selector
Pass ":dir(auto)" should be a valid selector
Pass ":dir(none)" should be a valid selector
Pass ":dir(something-made-up)" should be a valid selector
Pass ":dir()" should be an invalid selector
Pass ":dir(\"ltr\")" should be an invalid selector
Pass ":dir(ltr, rtl)" should be an invalid selector