From 5f144f366d7c038b4c1a96616e0b27954fc9f4a4 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Fri, 16 May 2025 14:21:28 +0100 Subject: [PATCH] Tests: Create a test for :dir() parsing/serialization Submitted to WPT as https://github.com/web-platform-tests/wpt/pull/52598 but in the meantime here's a local version. The spec for this isn't super thorough, so the tests are based on how Chrome and Firefox behave. Specifically, Firefox returns the ltr/rtl keyword in lowercase but Chrome keeps the original case for it. We currently fail most of these but that will be fixed in subsequent commits. --- .../Text/expected/css/parse-dir-selector.txt | 16 ++++++++++++++ .../Text/input/css/parse-dir-selector.html | 22 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 Tests/LibWeb/Text/expected/css/parse-dir-selector.txt create mode 100644 Tests/LibWeb/Text/input/css/parse-dir-selector.html diff --git a/Tests/LibWeb/Text/expected/css/parse-dir-selector.txt b/Tests/LibWeb/Text/expected/css/parse-dir-selector.txt new file mode 100644 index 00000000000..3654f6277d2 --- /dev/null +++ b/Tests/LibWeb/Text/expected/css/parse-dir-selector.txt @@ -0,0 +1,16 @@ +Harness status: OK + +Found 10 tests + +3 Pass +7 Fail +Fail ":dir(rtl)" should be a valid selector +Fail ":dir( rtl )" should be a valid selector +Fail ":dir(ltr):dir(rtl)" should be a valid selector +Fail "foo:dir(RTL)" should be a valid selector +Fail ":dir(auto)" should be a valid selector +Fail ":dir(none)" should be a valid selector +Fail ":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 \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/css/parse-dir-selector.html b/Tests/LibWeb/Text/input/css/parse-dir-selector.html new file mode 100644 index 00000000000..9864cfff295 --- /dev/null +++ b/Tests/LibWeb/Text/input/css/parse-dir-selector.html @@ -0,0 +1,22 @@ + + + + + +