From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../tests/html/semantics/selectors/META.yml | 2 + .../selectors/case-sensitivity/values.window.js | 91 +++++++++++++ .../selectors/pseudo-classes/active-disabled.html | 54 ++++++++ .../selectors/pseudo-classes/autofill.html | 11 ++ .../pseudo-classes/checked-001-manual.html | 18 +++ .../pseudo-classes/checked-indeterminate.window.js | 27 ++++ .../pseudo-classes/checked-type-change.html | 24 ++++ .../selectors/pseudo-classes/checked.html | 44 +++++++ .../selectors/pseudo-classes/default.html | 64 +++++++++ .../selectors/pseudo-classes/dir-dynamic.html | 47 +++++++ .../dir-html-input-dynamic-text.html | 21 +++ .../semantics/selectors/pseudo-classes/dir.html | 99 ++++++++++++++ .../semantics/selectors/pseudo-classes/dir01.html | 18 +++ .../selectors/pseudo-classes/disabled.html | 80 +++++++++++ .../selectors/pseudo-classes/enabled.html | 43 ++++++ .../selectors/pseudo-classes/focus-autofocus.html | 24 ++++ .../selectors/pseudo-classes/focus-iframe.html | 5 + .../semantics/selectors/pseudo-classes/focus.html | 51 +++++++ .../indeterminate-radio-group-ref.html | 21 +++ .../pseudo-classes/indeterminate-radio-group.html | 28 ++++ .../pseudo-classes/indeterminate-radio.html | 26 ++++ .../pseudo-classes/indeterminate-type-change.html | 24 ++++ .../selectors/pseudo-classes/indeterminate.html | 37 ++++++ .../input-checkbox-switch.tentative.window.js | 75 +++++++++++ .../inrange-outofrange-type-change.html | 43 ++++++ .../pseudo-classes/inrange-outofrange.html | 84 ++++++++++++ .../pseudo-classes/invalid-after-clone.html | 28 ++++ .../semantics/selectors/pseudo-classes/link.html | 21 +++ .../placeholder-shown-type-change.html | 27 ++++ .../readwrite-readonly-type-change.html | 36 +++++ .../pseudo-classes/readwrite-readonly.html | 118 +++++++++++++++++ .../pseudo-classes/required-optional-hidden.html | 36 +++++ .../pseudo-classes/required-optional.html | 35 +++++ .../semantics/selectors/pseudo-classes/utils.js | 20 +++ .../valid-invalid-fieldset-disconnected.html | 57 ++++++++ .../selectors/pseudo-classes/valid-invalid.html | 146 +++++++++++++++++++++ 36 files changed, 1585 insertions(+) create mode 100644 testing/web-platform/tests/html/semantics/selectors/META.yml create mode 100644 testing/web-platform/tests/html/semantics/selectors/case-sensitivity/values.window.js create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/active-disabled.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/autofill.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked-001-manual.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked-indeterminate.window.js create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked-type-change.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/default.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir-dynamic.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir-html-input-dynamic-text.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir01.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/disabled.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/enabled.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus-autofocus.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus-iframe.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate-radio-group-ref.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate-radio-group.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate-radio.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate-type-change.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/input-checkbox-switch.tentative.window.js create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/inrange-outofrange-type-change.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/inrange-outofrange.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/invalid-after-clone.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/link.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/placeholder-shown-type-change.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/readwrite-readonly-type-change.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/readwrite-readonly.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/required-optional-hidden.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/required-optional.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/utils.js create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/valid-invalid-fieldset-disconnected.html create mode 100644 testing/web-platform/tests/html/semantics/selectors/pseudo-classes/valid-invalid.html (limited to 'testing/web-platform/tests/html/semantics/selectors') diff --git a/testing/web-platform/tests/html/semantics/selectors/META.yml b/testing/web-platform/tests/html/semantics/selectors/META.yml new file mode 100644 index 0000000000..3195b8671c --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/META.yml @@ -0,0 +1,2 @@ +suggested_reviewers: + - lilles diff --git a/testing/web-platform/tests/html/semantics/selectors/case-sensitivity/values.window.js b/testing/web-platform/tests/html/semantics/selectors/case-sensitivity/values.window.js new file mode 100644 index 0000000000..1973398bff --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/case-sensitivity/values.window.js @@ -0,0 +1,91 @@ +// https://html.spec.whatwg.org/#case-sensitivity-of-selectors +[ + "accept", + "accept-charset", + "align", + "alink", + "axis", + "bgcolor", + "charset", + "checked", + "clear", + "codetype", + "color", + "compact", + "declare", + "defer", + "dir", + "direction", + "disabled", + "enctype", + "face", + "frame", + "hreflang", + "http-equiv", + "lang", + "language", + "link", + "media", + "method", + "multiple", + "nohref", + "noresize", + "noshade", + "nowrap", + "readonly", + "rel", + "rev", + "rules", + "scope", + "scrolling", + "selected", + "shape", + "target", + "text", + "type", + "valign", + "valuetype", + "vlink", +].forEach(attributeName => { + const xmlDocument = new Document(); + const htmlDocument = document; + [ + { + input: xmlDocument.createElementNS("http://www.w3.org/1999/xhtml", "a"), + expected: false, + title: " in XML", + }, + { + input: xmlDocument.createElementNS("http://www.w3.org/1999/xhtml", "unknown"), + expected: false, + title: " in XML", + }, + { + input: xmlDocument.createElementNS("", "unknown"), + expected: false, + title: "<:unknown> in XML" + }, + { + input: htmlDocument.createElementNS("http://www.w3.org/1999/xhtml", "a"), + expected: true, + title: " in HTML", + }, + { + input: htmlDocument.createElementNS("http://www.w3.org/1999/xhtml", "unknown"), + expected: true, + title: " in HTML", + }, + { + input: htmlDocument.createElementNS("", "unknown"), + expected: false, + title: "<:unknown> in HTML" + }, + ].forEach(({ input, expected, title }) => { + test(t => { + t.add_cleanup(() => input.removeAttribute(attributeName)); + input.setAttribute(attributeName, "HEYÏ"); + assert_equals(input.matches(`[${attributeName}^=hey]`), expected, `^=hey`); + assert_false(input.matches(`[${attributeName}^=heyi]`)); + }, `${attributeName}'s value is properly ASCII-case-insensitive for ${title}`); + }); +}); diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/active-disabled.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/active-disabled.html new file mode 100644 index 0000000000..a75a157c58 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/active-disabled.html @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/autofill.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/autofill.html new file mode 100644 index 0000000000..b7c3644bdb --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/autofill.html @@ -0,0 +1,11 @@ + + +Selector: pseudo-classes (:autofill) + + + + + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked-001-manual.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked-001-manual.html new file mode 100644 index 0000000000..76a963a600 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked-001-manual.html @@ -0,0 +1,18 @@ + + + + CSS Selectors (:checked) + + + + + +

Anything that is checked below should be blue.

+

X

+

X X

+

+

+ + \ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked-indeterminate.window.js b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked-indeterminate.window.js new file mode 100644 index 0000000000..167cbdd37f --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked-indeterminate.window.js @@ -0,0 +1,27 @@ +test(() => { + const input = document.createElement("input"); + input.type = "checkbox"; + + assert_false(input.matches(":checked:indeterminate")); + assert_false(input.matches(":checked")); + assert_false(input.matches(":indeterminate")); + + input.checked = true; + input.indeterminate = true; + + assert_true(input.matches(":checked:indeterminate")); + assert_true(input.matches(":checked")); + assert_true(input.matches(":indeterminate")); + + input.indeterminate = false; + + assert_false(input.matches(":checked:indeterminate")); + assert_true(input.matches(":checked")); + assert_false(input.matches(":indeterminate")); + + input.checked = false; + + assert_false(input.matches(":checked:indeterminate")); + assert_false(input.matches(":checked")); + assert_false(input.matches(":indeterminate")); +}, "An element can be :checked and :indeterminate at the same time"); diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked-type-change.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked-type-change.html new file mode 100644 index 0000000000..661d9e4355 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked-type-change.html @@ -0,0 +1,24 @@ + + +Selector: pseudo-class :checked input type change + + + + + + +This text should be green. + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked.html new file mode 100644 index 0000000000..754c2342bc --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked.html @@ -0,0 +1,44 @@ + + +Selector: pseudo-classes (:checked) + + + + + +
+ + + + + + +
+

+ + + + + + + + +
+ + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/default.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/default.html new file mode 100644 index 0000000000..3187801f67 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/default.html @@ -0,0 +1,64 @@ + + +Selector: pseudo-classes (:default) + + + + + +
+
+ + +
+
+ + +
+ +
+ +
+ +
+ + +
+
+ + +
+
+ +
+ + + + + + + + + + +
+ + +
+
+ + +
+ + + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir-dynamic.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir-dynamic.html new file mode 100644 index 0000000000..8f2951f8ef --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir-dynamic.html @@ -0,0 +1,47 @@ + + + + + + + + + + + + +
+

+
+  
+
+
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir-html-input-dynamic-text.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir-html-input-dynamic-text.html
new file mode 100644
index 0000000000..0c50cec369
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir-html-input-dynamic-text.html
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir.html
new file mode 100644
index 0000000000..588c3c6850
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir.html
@@ -0,0 +1,99 @@
+
+
+  
+    
+    Selector: pseudo-classes (:dir(ltr), :dir(rtl))
+    
+    
+    
+    
+    
+    
+  
+  
+    
+ WERBEH + HEBREW + HEBREW + WERBEH + HEBREW + إيان + WERBEH + WERBEH + HEBREW + ‮WERBEH‬ + WERBEH + HEBREW + + + + + + HEBREW + إيان + עברית + + + +
إيان
+
HEBREWإيان
+ + + + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir01.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir01.html new file mode 100644 index 0000000000..61bbd574a3 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir01.html @@ -0,0 +1,18 @@ + + +Selector: pseudo-classes (:dir(ltr), :dir(rtl)) in iso-8859-8 documents + + + + + +
+
This text is left to right
this is right to left
+
This text is left to rightthis is left to right
+ + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/disabled.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/disabled.html new file mode 100644 index 0000000000..142a12dd12 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/disabled.html @@ -0,0 +1,80 @@ + + +Selector: pseudo-classes (:disabled) + + + + + + +
+ + + + + + + + + + +
+
+ +

+

+
+ + + + + + + + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/enabled.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/enabled.html new file mode 100644 index 0000000000..0ad0e1b402 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/enabled.html @@ -0,0 +1,43 @@ + + +Selector: pseudo-classes (:enabled) + + + + + +
+ + + + + + + + + + + + + + +
+

+ + + + + +
+
+
+ + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus-autofocus.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus-autofocus.html new file mode 100644 index 0000000000..80a75bb99e --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus-autofocus.html @@ -0,0 +1,24 @@ + + +Selector: pseudo-classes (:focus for autofocus) + + + + + + + + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus-iframe.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus-iframe.html new file mode 100644 index 0000000000..a269f1c671 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus-iframe.html @@ -0,0 +1,5 @@ + + +Selector: pseudo-classes (:focus) + + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus.html new file mode 100644 index 0000000000..a319b24ef0 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus.html @@ -0,0 +1,51 @@ + + +Selector: pseudo-classes (:focus) + + + + + + +
+ + + + + + +
hello
+
content
+ + + + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate-radio-group-ref.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate-radio-group-ref.html new file mode 100644 index 0000000000..68d95fe240 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate-radio-group-ref.html @@ -0,0 +1,21 @@ + + +Test reference + +
+ + + + + + + + + + + +
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate-radio-group.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate-radio-group.html new file mode 100644 index 0000000000..a49b957021 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate-radio-group.html @@ -0,0 +1,28 @@ + + +:indeterminate and input type=radio + + + + + +
+ + + + + + + + + + + +
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate-radio.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate-radio.html new file mode 100644 index 0000000000..4a7b2d6ece --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate-radio.html @@ -0,0 +1,26 @@ + + +:indeterminate and input type=radio + + + + +
+ + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate-type-change.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate-type-change.html new file mode 100644 index 0000000000..b3e4cce302 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate-type-change.html @@ -0,0 +1,24 @@ + + +Selector: pseudo-class :indeterminate input type change + + + + + + +This text should be green. + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate.html new file mode 100644 index 0000000000..df04846676 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate.html @@ -0,0 +1,37 @@ + + +Selector: pseudo-classes (:indeterminate) + + + + + +
+ + + + + + + + + + + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/input-checkbox-switch.tentative.window.js b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/input-checkbox-switch.tentative.window.js new file mode 100644 index 0000000000..b5d9898a64 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/input-checkbox-switch.tentative.window.js @@ -0,0 +1,75 @@ +test(t => { + const input = document.body.appendChild(document.createElement("input")); + t.add_cleanup(() => input.remove()); + input.type = "checkbox"; + input.switch = true; + input.indeterminate = true; + + assert_false(input.matches(":indeterminate")); +}, "Switch control does not match :indeterminate"); + +test(t => { + const input = document.body.appendChild(document.createElement("input")); + t.add_cleanup(() => input.remove()); + input.type = "checkbox"; + input.switch = true; + input.indeterminate = true; + + assert_false(input.matches(":indeterminate")); + + input.switch = false; + assert_true(input.matches(":indeterminate")); +}, "Checkbox that is no longer a switch control does match :indeterminate"); + +test(t => { + const input = document.body.appendChild(document.createElement("input")); + t.add_cleanup(() => input.remove()); + input.type = "checkbox"; + input.indeterminate = true; + + assert_true(input.matches(":indeterminate")); + + input.setAttribute("switch", "blah"); + assert_false(input.matches(":indeterminate")); +}, "Checkbox that becomes a switch control does not match :indeterminate"); + +test(t => { + const input = document.body.appendChild(document.createElement("input")); + t.add_cleanup(() => input.remove()); + input.type = "checkbox"; + input.indeterminate = true; + + assert_true(document.body.matches(":has(:indeterminate)")); + + input.switch = true; + assert_false(document.body.matches(":has(:indeterminate)")); +}, "Parent of a checkbox that becomes a switch control does not match :has(:indeterminate)"); + +test(t => { + const input = document.body.appendChild(document.createElement("input")); + t.add_cleanup(() => input.remove()); + input.type = "checkbox"; + input.switch = true + input.checked = true; + + assert_true(document.body.matches(":has(:checked)")); + + input.switch = false; + assert_true(document.body.matches(":has(:checked)")); + + input.checked = false; + assert_false(document.body.matches(":has(:checked)")); +}, "Parent of a switch control that becomes a checkbox continues to match :has(:checked)"); + +test(t => { + const input = document.body.appendChild(document.createElement("input")); + t.add_cleanup(() => input.remove()); + input.type = "checkbox"; + input.switch = true; + input.indeterminate = true; + assert_false(input.matches(":indeterminate")); + input.type = "text"; + input.removeAttribute("switch"); + input.type = "checkbox"; + assert_true(input.matches(":indeterminate")); +}, "A switch control that becomes a checkbox in a roundabout way"); diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/inrange-outofrange-type-change.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/inrange-outofrange-type-change.html new file mode 100644 index 0000000000..9c1be9ca27 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/inrange-outofrange-type-change.html @@ -0,0 +1,43 @@ + + +Selector: pseudo-classes (:in-range, :out-of-range) input type change + + + + + + +This text should be green. + +This text should be green. + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/inrange-outofrange.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/inrange-outofrange.html new file mode 100644 index 0000000000..e9acbb3741 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/inrange-outofrange.html @@ -0,0 +1,84 @@ + + +Selector: pseudo-classes (:in-range, :out-of-range) + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/invalid-after-clone.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/invalid-after-clone.html new file mode 100644 index 0000000000..92345602a8 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/invalid-after-clone.html @@ -0,0 +1,28 @@ + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/link.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/link.html new file mode 100644 index 0000000000..e9733eca70 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/link.html @@ -0,0 +1,21 @@ + + +Selector: pseudo-classes (:link) + + + + + + +
+ + + + + + + + + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/placeholder-shown-type-change.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/placeholder-shown-type-change.html new file mode 100644 index 0000000000..206ae80c75 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/placeholder-shown-type-change.html @@ -0,0 +1,27 @@ + + +Selector: pseudo-class :placeholder-shown input type change + + + + + + +This text should be green. + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/readwrite-readonly-type-change.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/readwrite-readonly-type-change.html new file mode 100644 index 0000000000..90ef1d25d4 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/readwrite-readonly-type-change.html @@ -0,0 +1,36 @@ + + +Selector: pseudo-classes (:read-write, :read-only) input type change + + + + + + +This text should be green on lime background. + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/readwrite-readonly.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/readwrite-readonly.html new file mode 100644 index 0000000000..fb8a5b9ad7 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/readwrite-readonly.html @@ -0,0 +1,118 @@ + + +Selector: pseudo-classes (:read-write, :read-only) + + + + +
+ +
+ + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + +
+ +
+ + +
+ +
+

paragraph1.

+

paragraph2.

+
+ +
+
+

+ + + + + + + + +
+
+ + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/required-optional-hidden.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/required-optional-hidden.html new file mode 100644 index 0000000000..fe3d6e2f42 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/required-optional-hidden.html @@ -0,0 +1,36 @@ + + +Selector: pseudo-classes (:required, :optional) for hidden input + + + + + + +This text should be green on lime background. + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/required-optional.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/required-optional.html new file mode 100644 index 0000000000..f06fdfa1e0 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/required-optional.html @@ -0,0 +1,35 @@ + + +Selector: pseudo-classes (:required, :optional) + + + + + +
+ + + + + + + + + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/utils.js b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/utils.js new file mode 100644 index 0000000000..7a2fb77f10 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/utils.js @@ -0,0 +1,20 @@ +function getElementsByIds(ids) { + var result = []; + ids.forEach(function(id) { + result.push(document.getElementById(id)); + }); + return result; +} + +function testSelectorIdsMatch(selector, ids, testName) { + test(function(){ + var elements = document.querySelectorAll(selector); + assert_array_equals([...elements], getElementsByIds(ids)); + }, testName); +} + +function testSelectorElementsMatch(selector, elements, testName) { + test(function(){ + assert_array_equals([...document.querySelectorAll(selector)], elements); + }, testName); +} diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/valid-invalid-fieldset-disconnected.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/valid-invalid-fieldset-disconnected.html new file mode 100644 index 0000000000..6ad329438a --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/valid-invalid-fieldset-disconnected.html @@ -0,0 +1,57 @@ + + +Selector: pseudo-classes (:valid, :invalid) on disconnected fieldset element + + + + +
+ +
+ +
+ +
+ + diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/valid-invalid.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/valid-invalid.html new file mode 100644 index 0000000000..d93407707f --- /dev/null +++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/valid-invalid.html @@ -0,0 +1,146 @@ + + + + +Selector: pseudo-classes (:valid, :invalid) + + + + + + + + +
+
+ + +
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+ + +
+
+ + +
+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+
+ + + -- cgit v1.2.3