summaryrefslogtreecommitdiffstats
path: root/layout/reftests/css-required
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-required
parentInitial commit. (diff)
downloadthunderbird-upstream.tar.xz
thunderbird-upstream.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 '')
-rw-r--r--layout/reftests/css-required/css-required-button-element.html7
-rw-r--r--layout/reftests/css-required/css-required-button.html7
-rw-r--r--layout/reftests/css-required/css-required-checkbox-ref.html6
-rw-r--r--layout/reftests/css-required/css-required-checkbox.html7
-rw-r--r--layout/reftests/css-required/css-required-dyn-1.html21
-rw-r--r--layout/reftests/css-required/css-required-dyn-2.html21
-rw-r--r--layout/reftests/css-required/css-required-dyn-3.html20
-rw-r--r--layout/reftests/css-required/css-required-dyn-4.html20
-rw-r--r--layout/reftests/css-required/css-required-dyn-5.html20
-rw-r--r--layout/reftests/css-required/css-required-dyn-6.html20
-rw-r--r--layout/reftests/css-required/css-required-file-ref.html6
-rw-r--r--layout/reftests/css-required/css-required-file.html7
-rw-r--r--layout/reftests/css-required/css-required-hidden.html7
-rw-r--r--layout/reftests/css-required/css-required-image.html7
-rw-r--r--layout/reftests/css-required/css-required-password-ref.html6
-rw-r--r--layout/reftests/css-required/css-required-password.html7
-rw-r--r--layout/reftests/css-required/css-required-radio-ref.html6
-rw-r--r--layout/reftests/css-required/css-required-radio.html7
-rw-r--r--layout/reftests/css-required/css-required-reset.html7
-rw-r--r--layout/reftests/css-required/css-required-search-ref.html6
-rw-r--r--layout/reftests/css-required/css-required-search.html7
-rw-r--r--layout/reftests/css-required/css-required-select-ref.html6
-rw-r--r--layout/reftests/css-required/css-required-select.html7
-rw-r--r--layout/reftests/css-required/css-required-style-2.css13
-rw-r--r--layout/reftests/css-required/css-required-style.css13
-rw-r--r--layout/reftests/css-required/css-required-submit.html7
-rw-r--r--layout/reftests/css-required/css-required-tel-ref.html6
-rw-r--r--layout/reftests/css-required/css-required-tel.html7
-rw-r--r--layout/reftests/css-required/css-required-text-ref.html6
-rw-r--r--layout/reftests/css-required/css-required-text.html7
-rw-r--r--layout/reftests/css-required/css-required-textarea-ref.html6
-rw-r--r--layout/reftests/css-required/css-required-textarea.html7
-rw-r--r--layout/reftests/css-required/reftest.list29
33 files changed, 336 insertions, 0 deletions
diff --git a/layout/reftests/css-required/css-required-button-element.html b/layout/reftests/css-required/css-required-button-element.html
new file mode 100644
index 0000000000..5c2df1c951
--- /dev/null
+++ b/layout/reftests/css-required/css-required-button-element.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='css-required-style.css'>
+ <body>
+ <button required></button>
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-button.html b/layout/reftests/css-required/css-required-button.html
new file mode 100644
index 0000000000..c31dc169e6
--- /dev/null
+++ b/layout/reftests/css-required/css-required-button.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='css-required-style.css'>
+ <body>
+ <input type="button" required>
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-checkbox-ref.html b/layout/reftests/css-required/css-required-checkbox-ref.html
new file mode 100644
index 0000000000..57cf905ad8
--- /dev/null
+++ b/layout/reftests/css-required/css-required-checkbox-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input type="checkbox">
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-checkbox.html b/layout/reftests/css-required/css-required-checkbox.html
new file mode 100644
index 0000000000..6126da914a
--- /dev/null
+++ b/layout/reftests/css-required/css-required-checkbox.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='css-required-style.css'>
+ <body>
+ <input type="checkbox" required>
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-dyn-1.html b/layout/reftests/css-required/css-required-dyn-1.html
new file mode 100644
index 0000000000..6663609159
--- /dev/null
+++ b/layout/reftests/css-required/css-required-dyn-1.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: Change an input element from non-required type
+ to a required type. -->
+ <link rel='stylesheet' type='text/css' href='css-required-style.css'>
+
+ <script type="text/javascript">
+ function changeType()
+ {
+ document.getElementById('i').type = 'text';
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+
+ <body onload="changeType(); disableReftestWait();">
+ <input type="submit" id="i" required>
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-dyn-2.html b/layout/reftests/css-required/css-required-dyn-2.html
new file mode 100644
index 0000000000..f19ae3c1e4
--- /dev/null
+++ b/layout/reftests/css-required/css-required-dyn-2.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: Change an input element from required type
+ to a non-required type. -->
+ <link rel='stylesheet' type='text/css' href='css-required-style.css'>
+
+ <script type="text/javascript">
+ function changeType()
+ {
+ document.getElementById('i').type = 'submit';
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+
+ <body onload="changeType(); disableReftestWait();">
+ <input type="text" id="i" required>
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-dyn-3.html b/layout/reftests/css-required/css-required-dyn-3.html
new file mode 100644
index 0000000000..3cd2159761
--- /dev/null
+++ b/layout/reftests/css-required/css-required-dyn-3.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: Add the required attribute to an element to make it required. -->
+ <link rel='stylesheet' type='text/css' href='css-required-style.css'>
+
+ <script type="text/javascript">
+ function addRequired()
+ {
+ document.getElementById('i').required = true;
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+
+ <body onload="addRequired(); disableReftestWait();">
+ <input type="text" id="i">
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-dyn-4.html b/layout/reftests/css-required/css-required-dyn-4.html
new file mode 100644
index 0000000000..6ab8a32e34
--- /dev/null
+++ b/layout/reftests/css-required/css-required-dyn-4.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: Remove the required attribute from an element to make it optional. -->
+ <link rel='stylesheet' type='text/css' href='css-required-style.css'>
+
+ <script type="text/javascript">
+ function removeRequired()
+ {
+ document.getElementById('i').removeAttribute('required');
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+
+ <body onload="removeRequired(); disableReftestWait();">
+ <input type="text" id="i" required>
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-dyn-5.html b/layout/reftests/css-required/css-required-dyn-5.html
new file mode 100644
index 0000000000..4f8fb1f3de
--- /dev/null
+++ b/layout/reftests/css-required/css-required-dyn-5.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: Add the required attribute to an element to make it required. -->
+ <link rel='stylesheet' type='text/css' href='css-required-style-2.css'>
+
+ <script type="text/javascript">
+ function addRequired()
+ {
+ document.getElementById('i').required = true;
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+
+ <body onload="addRequired(); disableReftestWait();">
+ <input type="text" id="i">
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-dyn-6.html b/layout/reftests/css-required/css-required-dyn-6.html
new file mode 100644
index 0000000000..e6c0eae7ff
--- /dev/null
+++ b/layout/reftests/css-required/css-required-dyn-6.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: Remove the required attribute from an element to make it optional. -->
+ <link rel='stylesheet' type='text/css' href='css-required-style-2.css'>
+
+ <script type="text/javascript">
+ function removeRequired()
+ {
+ document.getElementById('i').removeAttribute('required');
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+
+ <body onload="removeRequired(); disableReftestWait();">
+ <input type="text" id="i" required>
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-file-ref.html b/layout/reftests/css-required/css-required-file-ref.html
new file mode 100644
index 0000000000..2c4ef05993
--- /dev/null
+++ b/layout/reftests/css-required/css-required-file-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input type="file">
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-file.html b/layout/reftests/css-required/css-required-file.html
new file mode 100644
index 0000000000..7a8534ba8a
--- /dev/null
+++ b/layout/reftests/css-required/css-required-file.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='css-required-style.css'>
+ <body>
+ <input type="file" required>
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-hidden.html b/layout/reftests/css-required/css-required-hidden.html
new file mode 100644
index 0000000000..4ad39a518b
--- /dev/null
+++ b/layout/reftests/css-required/css-required-hidden.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='css-required-style.css'>
+ <body>
+ <input type="hidden" required>
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-image.html b/layout/reftests/css-required/css-required-image.html
new file mode 100644
index 0000000000..a293ed0aec
--- /dev/null
+++ b/layout/reftests/css-required/css-required-image.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='css-required-style.css'>
+ <body>
+ <input type="image" required>
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-password-ref.html b/layout/reftests/css-required/css-required-password-ref.html
new file mode 100644
index 0000000000..cc49928f6c
--- /dev/null
+++ b/layout/reftests/css-required/css-required-password-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input type="password">
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-password.html b/layout/reftests/css-required/css-required-password.html
new file mode 100644
index 0000000000..27db40342a
--- /dev/null
+++ b/layout/reftests/css-required/css-required-password.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='css-required-style.css'>
+ <body>
+ <input type="password" required>
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-radio-ref.html b/layout/reftests/css-required/css-required-radio-ref.html
new file mode 100644
index 0000000000..e7b97476c9
--- /dev/null
+++ b/layout/reftests/css-required/css-required-radio-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input type="radio">
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-radio.html b/layout/reftests/css-required/css-required-radio.html
new file mode 100644
index 0000000000..bd5d980f36
--- /dev/null
+++ b/layout/reftests/css-required/css-required-radio.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='css-required-style.css'>
+ <body>
+ <input type="radio" required>
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-reset.html b/layout/reftests/css-required/css-required-reset.html
new file mode 100644
index 0000000000..a94efef7a2
--- /dev/null
+++ b/layout/reftests/css-required/css-required-reset.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='css-required-style.css'>
+ <body>
+ <input type="reset" required>
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-search-ref.html b/layout/reftests/css-required/css-required-search-ref.html
new file mode 100644
index 0000000000..059b11589c
--- /dev/null
+++ b/layout/reftests/css-required/css-required-search-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input type="search">
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-search.html b/layout/reftests/css-required/css-required-search.html
new file mode 100644
index 0000000000..0f90cd1d99
--- /dev/null
+++ b/layout/reftests/css-required/css-required-search.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='css-required-style.css'>
+ <body>
+ <input type="search" required>
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-select-ref.html b/layout/reftests/css-required/css-required-select-ref.html
new file mode 100644
index 0000000000..e419bb1845
--- /dev/null
+++ b/layout/reftests/css-required/css-required-select-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <select></select>
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-select.html b/layout/reftests/css-required/css-required-select.html
new file mode 100644
index 0000000000..c69f26a3d3
--- /dev/null
+++ b/layout/reftests/css-required/css-required-select.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='css-required-style.css'>
+ <body>
+ <select required></select>
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-style-2.css b/layout/reftests/css-required/css-required-style-2.css
new file mode 100644
index 0000000000..0670fb48e7
--- /dev/null
+++ b/layout/reftests/css-required/css-required-style-2.css
@@ -0,0 +1,13 @@
+input, textarea, select, button,
+*:optional {
+ visibility: hidden;
+}
+
+input[required]:required {
+ visibility: visible;
+}
+
+/* Override the default style. */
+:invalid {
+ box-shadow: none;
+}
diff --git a/layout/reftests/css-required/css-required-style.css b/layout/reftests/css-required/css-required-style.css
new file mode 100644
index 0000000000..59daf2ea62
--- /dev/null
+++ b/layout/reftests/css-required/css-required-style.css
@@ -0,0 +1,13 @@
+input, textarea, select, button,
+*:optional {
+ visibility: hidden;
+}
+
+*:required {
+ visibility: visible;
+}
+
+/* Override the default style. */
+:invalid {
+ box-shadow: none;
+}
diff --git a/layout/reftests/css-required/css-required-submit.html b/layout/reftests/css-required/css-required-submit.html
new file mode 100644
index 0000000000..c82fa3ad59
--- /dev/null
+++ b/layout/reftests/css-required/css-required-submit.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='css-required-style.css'>
+ <body>
+ <input type="submit" required>
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-tel-ref.html b/layout/reftests/css-required/css-required-tel-ref.html
new file mode 100644
index 0000000000..059b11589c
--- /dev/null
+++ b/layout/reftests/css-required/css-required-tel-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input type="search">
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-tel.html b/layout/reftests/css-required/css-required-tel.html
new file mode 100644
index 0000000000..d468c867cd
--- /dev/null
+++ b/layout/reftests/css-required/css-required-tel.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='css-required-style.css'>
+ <body>
+ <input type="tel" required>
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-text-ref.html b/layout/reftests/css-required/css-required-text-ref.html
new file mode 100644
index 0000000000..07e5eee7e6
--- /dev/null
+++ b/layout/reftests/css-required/css-required-text-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input type="text">
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-text.html b/layout/reftests/css-required/css-required-text.html
new file mode 100644
index 0000000000..0aa2180336
--- /dev/null
+++ b/layout/reftests/css-required/css-required-text.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='css-required-style.css'>
+ <body>
+ <input type="text" required>
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-textarea-ref.html b/layout/reftests/css-required/css-required-textarea-ref.html
new file mode 100644
index 0000000000..bde6f508f9
--- /dev/null
+++ b/layout/reftests/css-required/css-required-textarea-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea></textarea>
+ </body>
+</html>
diff --git a/layout/reftests/css-required/css-required-textarea.html b/layout/reftests/css-required/css-required-textarea.html
new file mode 100644
index 0000000000..82d01bc5db
--- /dev/null
+++ b/layout/reftests/css-required/css-required-textarea.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='css-required-style.css'>
+ <body>
+ <textarea required></textarea>
+ </body>
+</html>
diff --git a/layout/reftests/css-required/reftest.list b/layout/reftests/css-required/reftest.list
new file mode 100644
index 0000000000..4c1f19abb6
--- /dev/null
+++ b/layout/reftests/css-required/reftest.list
@@ -0,0 +1,29 @@
+# Checking if these types/elements support :required
+== css-required-textarea.html css-required-textarea-ref.html
+== css-required-radio.html css-required-radio-ref.html
+== css-required-text.html css-required-text-ref.html
+== css-required-checkbox.html css-required-checkbox-ref.html
+== css-required-file.html css-required-file-ref.html
+== css-required-password.html css-required-password-ref.html
+== css-required-tel.html css-required-tel-ref.html
+== css-required-search.html css-required-search-ref.html
+fuzzy-if(geckoview,0-4,0-1) == css-required-select.html css-required-select-ref.html
+
+# Checking dynamic behavior with <input type='text'>
+== css-required-dyn-1.html css-required-text-ref.html
+== css-required-dyn-2.html about:blank
+== css-required-dyn-3.html css-required-text-ref.html
+== css-required-dyn-4.html about:blank
+== css-required-dyn-5.html css-required-text-ref.html
+== css-required-dyn-6.html about:blank
+
+# Following input types do not support :required
+== css-required-hidden.html about:blank
+== css-required-button.html about:blank
+== css-required-submit.html about:blank
+== css-required-image.html about:blank
+== css-required-reset.html about:blank
+
+# Following elements can be optional but can't be required
+== css-required-button-element.html about:blank
+