From f028168183b49e49e8b8855113c87f1b3c9b7af3 Mon Sep 17 00:00:00 2001 From: Miyoung Shin Date: Fri, 4 Dec 2020 07:31:09 -0800 Subject: [PATCH] [selectors4] Implement :dir pseudo-class This patch adds support for the new ":dir" pseudo-class. The patch is covered by several of tests imported from the web tests including generic tests in addition to the tests from Firefox and apart from some minor changes on current tests to add the new selector. Intent-to-ship thread is available at: https://groups.google.com/u/1/a/chromium.org/g/blink-dev/c/p0Wc66rbVOc BUG=576815 Change-Id: I503c6af95d9c5817e3e71b1b2025a5562929f0d8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2460849 Commit-Queue: Miyoung Shin Reviewed-by: Rune Lillesveen Cr-Commit-Position: refs/heads/master@{#833712} --- .../selectors-dir-selector-auto.html | 93 +++++++++++++++++++ ...selectors-dir-selector-change-001-ref.html | 16 ++++ .../selectors-dir-selector-change-001.html | 25 +++++ .../selectors-dir-selector-change-002.html | 28 ++++++ ...selectors-dir-selector-change-003-ref.html | 16 ++++ .../selectors-dir-selector-change-003.html | 24 +++++ ...selectors-dir-selector-change-004-ref.html | 17 ++++ .../selectors-dir-selector-change-004.html | 25 +++++ .../selectors-dir-selector-ltr-002.html | 26 ++++++ .../selectors-dir-selector-ltr-003.html | 26 ++++++ .../selectors-dir-selector-querySelector.html | 71 ++++++++++++++ ...tors-dir-selector-white-space-001-ref.html | 18 ++++ ...electors-dir-selector-white-space-001.html | 27 ++++++ 13 files changed, 412 insertions(+) create mode 100644 css/selectors/selectors-dir-selector-auto.html create mode 100644 css/selectors/selectors-dir-selector-change-001-ref.html create mode 100644 css/selectors/selectors-dir-selector-change-001.html create mode 100644 css/selectors/selectors-dir-selector-change-002.html create mode 100644 css/selectors/selectors-dir-selector-change-003-ref.html create mode 100644 css/selectors/selectors-dir-selector-change-003.html create mode 100644 css/selectors/selectors-dir-selector-change-004-ref.html create mode 100644 css/selectors/selectors-dir-selector-change-004.html create mode 100644 css/selectors/selectors-dir-selector-ltr-002.html create mode 100644 css/selectors/selectors-dir-selector-ltr-003.html create mode 100644 css/selectors/selectors-dir-selector-querySelector.html create mode 100644 css/selectors/selectors-dir-selector-white-space-001-ref.html create mode 100644 css/selectors/selectors-dir-selector-white-space-001.html diff --git a/css/selectors/selectors-dir-selector-auto.html b/css/selectors/selectors-dir-selector-auto.html new file mode 100644 index 00000000000000..d53e989f69e172 --- /dev/null +++ b/css/selectors/selectors-dir-selector-auto.html @@ -0,0 +1,93 @@ + + + + + + + + + + + +
+
+
a
+
+
+
ת
+
+
+
ת
+
a
+
+
+
+
a
+
+
+
+ + + + diff --git a/css/selectors/selectors-dir-selector-change-001-ref.html b/css/selectors/selectors-dir-selector-change-001-ref.html new file mode 100644 index 00000000000000..8c79c8328f0b2b --- /dev/null +++ b/css/selectors/selectors-dir-selector-change-001-ref.html @@ -0,0 +1,16 @@ + + + + + + +
+
+
+ The background color should be lime +
+
+ + diff --git a/css/selectors/selectors-dir-selector-change-001.html b/css/selectors/selectors-dir-selector-change-001.html new file mode 100644 index 00000000000000..f952389643834f --- /dev/null +++ b/css/selectors/selectors-dir-selector-change-001.html @@ -0,0 +1,25 @@ + + + + CSS Selectors Level 4 Test: Check for correctly updating :dir matching on dir attribute change from default(ltr) to rtl + + + + + + +
+
+
+ The background color should be lime +
+
+ + + diff --git a/css/selectors/selectors-dir-selector-change-002.html b/css/selectors/selectors-dir-selector-change-002.html new file mode 100644 index 00000000000000..bc032b59541335 --- /dev/null +++ b/css/selectors/selectors-dir-selector-change-002.html @@ -0,0 +1,28 @@ + + + + CSS Selectors Level 4 Test: Check for correctly updating :dir matching on dir attribute change from default(ltr) to rtl + + + + + + +

Test passes if there is a filled green square and no red.

+
+ + + diff --git a/css/selectors/selectors-dir-selector-change-003-ref.html b/css/selectors/selectors-dir-selector-change-003-ref.html new file mode 100644 index 00000000000000..8c79c8328f0b2b --- /dev/null +++ b/css/selectors/selectors-dir-selector-change-003-ref.html @@ -0,0 +1,16 @@ + + + + + + +
+
+
+ The background color should be lime +
+
+ + diff --git a/css/selectors/selectors-dir-selector-change-003.html b/css/selectors/selectors-dir-selector-change-003.html new file mode 100644 index 00000000000000..f4000155a8d500 --- /dev/null +++ b/css/selectors/selectors-dir-selector-change-003.html @@ -0,0 +1,24 @@ + + + + CSS Selectors Level 4 Test: Check for correctly updating :dir matching on dir attribute change from rtl to auto + + + + + + +
+
+
+ The background color should be lime +
+
+ + + diff --git a/css/selectors/selectors-dir-selector-change-004-ref.html b/css/selectors/selectors-dir-selector-change-004-ref.html new file mode 100644 index 00000000000000..9a130cb2e5c71b --- /dev/null +++ b/css/selectors/selectors-dir-selector-change-004-ref.html @@ -0,0 +1,17 @@ + + + + + + + +
+
+
+ מקור השם עברית +
+
+ + diff --git a/css/selectors/selectors-dir-selector-change-004.html b/css/selectors/selectors-dir-selector-change-004.html new file mode 100644 index 00000000000000..4c76b291bad7ff --- /dev/null +++ b/css/selectors/selectors-dir-selector-change-004.html @@ -0,0 +1,25 @@ + + + + CSS Selectors Level 4 Test: Check for correctly updating :dir matching on directionality change from ltr to rtl + + + + + + + +
+
+
+ The background color should be lime +
+
+ + + diff --git a/css/selectors/selectors-dir-selector-ltr-002.html b/css/selectors/selectors-dir-selector-ltr-002.html new file mode 100644 index 00000000000000..bbb3f26a780b13 --- /dev/null +++ b/css/selectors/selectors-dir-selector-ltr-002.html @@ -0,0 +1,26 @@ + + + + CSS Selectors Level 4 Test: exception handling for an invalid identifier of dir() + + + + + + + + +

Test passes if there is a filled green square and no red.

+
+ + diff --git a/css/selectors/selectors-dir-selector-ltr-003.html b/css/selectors/selectors-dir-selector-ltr-003.html new file mode 100644 index 00000000000000..821a33616fca69 --- /dev/null +++ b/css/selectors/selectors-dir-selector-ltr-003.html @@ -0,0 +1,26 @@ + + + + CSS Selectors Level 4 Test: exception handling for multiple identifiers of dir() + + + + + + + + +

Test passes if there is a filled green square and no red.

+
+ + diff --git a/css/selectors/selectors-dir-selector-querySelector.html b/css/selectors/selectors-dir-selector-querySelector.html new file mode 100644 index 00000000000000..a05e3fea78f378 --- /dev/null +++ b/css/selectors/selectors-dir-selector-querySelector.html @@ -0,0 +1,71 @@ + + + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + diff --git a/css/selectors/selectors-dir-selector-white-space-001-ref.html b/css/selectors/selectors-dir-selector-white-space-001-ref.html new file mode 100644 index 00000000000000..955a2dd603d625 --- /dev/null +++ b/css/selectors/selectors-dir-selector-white-space-001-ref.html @@ -0,0 +1,18 @@ + + + + + + +

Test passes if there is a filled green square and no red.

+
+
+
+ + diff --git a/css/selectors/selectors-dir-selector-white-space-001.html b/css/selectors/selectors-dir-selector-white-space-001.html new file mode 100644 index 00000000000000..d3128a03734dc9 --- /dev/null +++ b/css/selectors/selectors-dir-selector-white-space-001.html @@ -0,0 +1,27 @@ + + + + CSS Selectors Level 4 Test: Verify for an identifier with leading and tailing whitespace of dir() + + + + + + + +

Test passes if there is a filled green square and no red.

+
+
+
+ +