summaryrefslogtreecommitdiffstats
path: root/layout/reftests/css-invalid/select
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /layout/reftests/css-invalid/select
parentInitial commit. (diff)
downloadthunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz
thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/css-invalid/select')
-rw-r--r--layout/reftests/css-invalid/select/reftest.list12
-rw-r--r--layout/reftests/css-invalid/select/select-disabled-fieldset-1.html22
-rw-r--r--layout/reftests/css-invalid/select/select-disabled-fieldset-2.html25
-rw-r--r--layout/reftests/css-invalid/select/select-disabled-ref.html6
-rw-r--r--layout/reftests/css-invalid/select/select-disabled.html9
-rw-r--r--layout/reftests/css-invalid/select/select-dyn-disabled.html18
-rw-r--r--layout/reftests/css-invalid/select/select-dyn-not-disabled.html19
-rw-r--r--layout/reftests/css-invalid/select/select-fieldset-legend-ref.html10
-rw-r--r--layout/reftests/css-invalid/select/select-fieldset-legend.html22
-rw-r--r--layout/reftests/css-invalid/select/select-fieldset-ref.html10
-rw-r--r--layout/reftests/css-invalid/select/select-invalid.html9
-rw-r--r--layout/reftests/css-invalid/select/select-ref.html6
-rw-r--r--layout/reftests/css-invalid/select/select-required-invalid.html11
-rw-r--r--layout/reftests/css-invalid/select/select-required-multiple-ref.html10
-rw-r--r--layout/reftests/css-invalid/select/select-required-multiple-still-valid.html12
-rw-r--r--layout/reftests/css-invalid/select/select-required-multiple-valid.html12
-rw-r--r--layout/reftests/css-invalid/select/select-required-ref.html9
-rw-r--r--layout/reftests/css-invalid/select/select-required-valid.html11
-rw-r--r--layout/reftests/css-invalid/select/select-valid.html9
-rw-r--r--layout/reftests/css-invalid/select/style.css18
20 files changed, 260 insertions, 0 deletions
diff --git a/layout/reftests/css-invalid/select/reftest.list b/layout/reftests/css-invalid/select/reftest.list
new file mode 100644
index 0000000000..38b5e3ff71
--- /dev/null
+++ b/layout/reftests/css-invalid/select/reftest.list
@@ -0,0 +1,12 @@
+needs-focus == select-valid.html select-ref.html
+fuzzy(0-1,0-3) needs-focus == select-invalid.html select-ref.html
+fuzzy(0-2,0-6) needs-focus == select-disabled.html select-disabled-ref.html
+fuzzy(0-2,0-6) needs-focus == select-dyn-disabled.html select-disabled-ref.html
+fuzzy(0-1,0-3) needs-focus == select-dyn-not-disabled.html select-ref.html
+needs-focus == select-required-invalid.html select-required-ref.html
+needs-focus == select-required-valid.html select-required-ref.html
+needs-focus == select-required-multiple-still-valid.html select-required-multiple-ref.html
+fuzzy(0-1,0-250) needs-focus == select-required-multiple-valid.html select-required-multiple-ref.html
+fuzzy-if(!Android,0-1,0-3) fuzzy-if(Android,0-9,0-1) needs-focus == select-disabled-fieldset-1.html select-fieldset-ref.html
+fuzzy-if(!Android,0-2,0-3) fuzzy-if(Android,0-8,0-1) needs-focus == select-disabled-fieldset-2.html select-fieldset-ref.html
+fuzzy(0-2,0-5) needs-focus == select-fieldset-legend.html select-fieldset-legend-ref.html
diff --git a/layout/reftests/css-invalid/select/select-disabled-fieldset-1.html b/layout/reftests/css-invalid/select/select-disabled-fieldset-1.html
new file mode 100644
index 0000000000..9ba5a9600a
--- /dev/null
+++ b/layout/reftests/css-invalid/select/select-disabled-fieldset-1.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if select has a disabled fieldset ancestor, it is barred from
+ constraint validation and should not be affected by :invalid
+ pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <script>
+ function onLoadHandler()
+ {
+ var e = document.getElementById('s');
+ e.setCustomValidity('foo');
+ document.documentElement.className='';
+ }
+ </script>
+ <body onload="onLoadHandler();">
+ <fieldset disabled>
+ <fieldset>
+ <select class='notinvalid' id='s'></select>
+ </fieldset>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/select/select-disabled-fieldset-2.html b/layout/reftests/css-invalid/select/select-disabled-fieldset-2.html
new file mode 100644
index 0000000000..e131aa6d73
--- /dev/null
+++ b/layout/reftests/css-invalid/select/select-disabled-fieldset-2.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if select has a disabled fieldset ancestor, it is barred from
+ constraint validation and should not be affected by :invalid
+ pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <script>
+ function onloadHandler()
+ {
+ var e = document.getElementById('s');
+ e.setCustomValidity('foo');
+ var fieldsets = document.getElementsByTagName("fieldset");
+ fieldsets[1].disabled = true;
+ fieldsets[0].disabled = false;
+ document.documentElement.className='';
+ }
+ </script>
+ <body onload="onloadHandler();">
+ <fieldset disabled>
+ <fieldset>
+ <select class='notinvalid' id='s'></select>
+ </fieldset>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/select/select-disabled-ref.html b/layout/reftests/css-invalid/select/select-disabled-ref.html
new file mode 100644
index 0000000000..e3a228a897
--- /dev/null
+++ b/layout/reftests/css-invalid/select/select-disabled-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <select disabled style="background-color: green;"></select>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/select/select-disabled.html b/layout/reftests/css-invalid/select/select-disabled.html
new file mode 100644
index 0000000000..51e03e541a
--- /dev/null
+++ b/layout/reftests/css-invalid/select/select-disabled.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if select is disabled, it is barred from constraint validation
+ and should not be affected by :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('s').setCustomValidity('foo'); document.documentElement.className='';">
+ <select class='notinvalid' id='s' disabled></select>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/select/select-dyn-disabled.html b/layout/reftests/css-invalid/select/select-dyn-disabled.html
new file mode 100644
index 0000000000..424c3b5e39
--- /dev/null
+++ b/layout/reftests/css-invalid/select/select-dyn-disabled.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if select is disabled and invalid, it is barred from constraint
+ validation and should not be affected by :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <script>
+ function onLoadHandler()
+ {
+ var e = document.getElementById('s');
+ e.setCustomValidity('foo');
+ e.disabled = 'true';
+ document.documentElement.className='';
+ }
+ </script>
+ <body onload="onLoadHandler();">
+ <select class='notinvalid' id='s'></select>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/select/select-dyn-not-disabled.html b/layout/reftests/css-invalid/select/select-dyn-not-disabled.html
new file mode 100644
index 0000000000..54de470acd
--- /dev/null
+++ b/layout/reftests/css-invalid/select/select-dyn-not-disabled.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if select is not disabled and invalid, it is candidate for
+ constraint validation and should be affected
+ by :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <script>
+ function onLoadHandler()
+ {
+ var e = document.getElementById('s');
+ e.setCustomValidity('foo');
+ e.removeAttribute('disabled');
+ document.documentElement.className='';
+ }
+ </script>
+ <body onload="onLoadHandler();">
+ <select class='invalid' id='s' disabled></select>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/select/select-fieldset-legend-ref.html b/layout/reftests/css-invalid/select/select-fieldset-legend-ref.html
new file mode 100644
index 0000000000..5083cea90d
--- /dev/null
+++ b/layout/reftests/css-invalid/select/select-fieldset-legend-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <fieldset>
+ <legend>
+ <select style="background-color: green;"></select>
+ </legend>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/select/select-fieldset-legend.html b/layout/reftests/css-invalid/select/select-fieldset-legend.html
new file mode 100644
index 0000000000..dea989deed
--- /dev/null
+++ b/layout/reftests/css-invalid/select/select-fieldset-legend.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if select has a disabled fieldset ancestor, but is in the first
+ legend, it is not barred from constraint validation and should be
+ affected by :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <script>
+ function onLoadHandler()
+ {
+ var e = document.getElementById('b');
+ e.setCustomValidity('foo');
+ document.documentElement.className='';
+ }
+ </script>
+ <body onload="onLoadHandler();">
+ <fieldset disabled>
+ <legend>
+ <select class='invalid' id='b'></select>
+ </legend>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/select/select-fieldset-ref.html b/layout/reftests/css-invalid/select/select-fieldset-ref.html
new file mode 100644
index 0000000000..ca82a8022d
--- /dev/null
+++ b/layout/reftests/css-invalid/select/select-fieldset-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <fieldset>
+ <fieldset>
+ <select disabled style="background-color: green;"></select>
+ </fieldset>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/select/select-invalid.html b/layout/reftests/css-invalid/select/select-invalid.html
new file mode 100644
index 0000000000..45d3790adb
--- /dev/null
+++ b/layout/reftests/css-invalid/select/select-invalid.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if select has a custom error, it should be affected by :invalid
+ pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('s').setCustomValidity('foo'); document.documentElement.className='';">
+ <select class='invalid' id='s'></select>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/select/select-ref.html b/layout/reftests/css-invalid/select/select-ref.html
new file mode 100644
index 0000000000..a28668557f
--- /dev/null
+++ b/layout/reftests/css-invalid/select/select-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <select style="background-color: green;"></select>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/select/select-required-invalid.html b/layout/reftests/css-invalid/select/select-required-invalid.html
new file mode 100644
index 0000000000..31f6c81d11
--- /dev/null
+++ b/layout/reftests/css-invalid/select/select-required-invalid.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if select is required and has a select option which has an empty
+ string value, :invalid should apply. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <select class='invalid' required>
+ <option selected value="">foo</option>
+ </select>
+ </body>
+</html></html>
diff --git a/layout/reftests/css-invalid/select/select-required-multiple-ref.html b/layout/reftests/css-invalid/select/select-required-multiple-ref.html
new file mode 100644
index 0000000000..a9477333f8
--- /dev/null
+++ b/layout/reftests/css-invalid/select/select-required-multiple-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <select multiple style="background-color: green;">
+ <option selected></option>
+ <option selected value="">foo</option>
+ </select>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/select/select-required-multiple-still-valid.html b/layout/reftests/css-invalid/select/select-required-multiple-still-valid.html
new file mode 100644
index 0000000000..affa854905
--- /dev/null
+++ b/layout/reftests/css-invalid/select/select-required-multiple-still-valid.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if select is required and has all selected option values set to the
+ empty string, :invalid should still not apply. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <select class='notinvalid' required multiple>
+ <option selected></option>
+ <option selected value="">foo</option>
+ </select>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/select/select-required-multiple-valid.html b/layout/reftests/css-invalid/select/select-required-multiple-valid.html
new file mode 100644
index 0000000000..e58e0c576a
--- /dev/null
+++ b/layout/reftests/css-invalid/select/select-required-multiple-valid.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if select is required and has a selected option which has value
+ different from the empty string, :invalid should not apply. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <select class='notinvalid' required multiple>
+ <option selected></option>
+ <option selected>foo</option>
+ </select>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/select/select-required-ref.html b/layout/reftests/css-invalid/select/select-required-ref.html
new file mode 100644
index 0000000000..3c2bde80a0
--- /dev/null
+++ b/layout/reftests/css-invalid/select/select-required-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <select style="background-color: green;">
+ <option selected value="">foo</option>
+ </selecT>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/select/select-required-valid.html b/layout/reftests/css-invalid/select/select-required-valid.html
new file mode 100644
index 0000000000..e6e4856dc4
--- /dev/null
+++ b/layout/reftests/css-invalid/select/select-required-valid.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if select is required and has a select option which has value
+ different from the empty string, :invalid should not apply. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <select class='notinvalid' required>
+ <option selected>foo</option>
+ </select>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/select/select-valid.html b/layout/reftests/css-invalid/select/select-valid.html
new file mode 100644
index 0000000000..2092f87875
--- /dev/null
+++ b/layout/reftests/css-invalid/select/select-valid.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if select has no custom error and is not barred from constraint
+ validation, it should not be affected by :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <select class='notinvalid'></select>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/select/style.css b/layout/reftests/css-invalid/select/style.css
new file mode 100644
index 0000000000..5461c6dfb4
--- /dev/null
+++ b/layout/reftests/css-invalid/select/style.css
@@ -0,0 +1,18 @@
+/* Override default style */
+select:invalid {
+ box-shadow: none;
+}
+
+select.notinvalid {
+ background-color: green;
+}
+select.notinvalid:invalid {
+ background-color: red;
+}
+
+select.invalid {
+ background-color: red;
+}
+select.invalid:invalid {
+ background-color: green;
+}