summaryrefslogtreecommitdiffstats
path: root/layout/reftests/css-optional
diff options
context:
space:
mode:
Diffstat (limited to 'layout/reftests/css-optional')
-rw-r--r--layout/reftests/css-optional/css-optional-button.html7
-rw-r--r--layout/reftests/css-optional/css-optional-dyn-1.html21
-rw-r--r--layout/reftests/css-optional/css-optional-dyn-2.html20
-rw-r--r--layout/reftests/css-optional/css-optional-input-ref.html6
-rw-r--r--layout/reftests/css-optional/css-optional-input.html7
-rw-r--r--layout/reftests/css-optional/css-optional-select-ref.html6
-rw-r--r--layout/reftests/css-optional/css-optional-select.html7
-rw-r--r--layout/reftests/css-optional/css-optional-style.css8
-rw-r--r--layout/reftests/css-optional/css-optional-textarea-ref.html6
-rw-r--r--layout/reftests/css-optional/css-optional-textarea.html7
-rw-r--r--layout/reftests/css-optional/reftest-stylo.list11
-rw-r--r--layout/reftests/css-optional/reftest.list10
12 files changed, 116 insertions, 0 deletions
diff --git a/layout/reftests/css-optional/css-optional-button.html b/layout/reftests/css-optional/css-optional-button.html
new file mode 100644
index 000000000..8e7282ff7
--- /dev/null
+++ b/layout/reftests/css-optional/css-optional-button.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='css-optional-style.css'>
+ <body>
+ <button></button>
+ </body>
+</html>
diff --git a/layout/reftests/css-optional/css-optional-dyn-1.html b/layout/reftests/css-optional/css-optional-dyn-1.html
new file mode 100644
index 000000000..8b02ad719
--- /dev/null
+++ b/layout/reftests/css-optional/css-optional-dyn-1.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: Remove the required attribute to an input element
+ to make it optional. -->
+ <link rel='stylesheet' type='text/css' href='css-optional-style.css'>
+
+ <script type="text/javascript">
+ function removeRequired()
+ {
+ document.getElementById('i').removeAttribute('required');
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+
+ <body onload="removeRequired(); disableReftestWait();">
+ <input id="i" required>
+ </body>
+</html>
diff --git a/layout/reftests/css-optional/css-optional-dyn-2.html b/layout/reftests/css-optional/css-optional-dyn-2.html
new file mode 100644
index 000000000..746e045ab
--- /dev/null
+++ b/layout/reftests/css-optional/css-optional-dyn-2.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-optional-style.css'>
+
+ <script type="text/javascript">
+ function addRequired()
+ {
+ document.getElementById('i').required = true;
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+
+ <body onload="addRequired(); disableReftestWait();">
+ <input id="i">
+ </body>
+</html>
diff --git a/layout/reftests/css-optional/css-optional-input-ref.html b/layout/reftests/css-optional/css-optional-input-ref.html
new file mode 100644
index 000000000..a7feec6b5
--- /dev/null
+++ b/layout/reftests/css-optional/css-optional-input-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input>
+ </body>
+</html>
diff --git a/layout/reftests/css-optional/css-optional-input.html b/layout/reftests/css-optional/css-optional-input.html
new file mode 100644
index 000000000..1292df6eb
--- /dev/null
+++ b/layout/reftests/css-optional/css-optional-input.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='css-optional-style.css'>
+ <body>
+ <input>
+ </body>
+</html>
diff --git a/layout/reftests/css-optional/css-optional-select-ref.html b/layout/reftests/css-optional/css-optional-select-ref.html
new file mode 100644
index 000000000..e419bb184
--- /dev/null
+++ b/layout/reftests/css-optional/css-optional-select-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <select></select>
+ </body>
+</html>
diff --git a/layout/reftests/css-optional/css-optional-select.html b/layout/reftests/css-optional/css-optional-select.html
new file mode 100644
index 000000000..a80a68a5a
--- /dev/null
+++ b/layout/reftests/css-optional/css-optional-select.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='css-optional-style.css'>
+ <body>
+ <select></select>
+ </body>
+</html>
diff --git a/layout/reftests/css-optional/css-optional-style.css b/layout/reftests/css-optional/css-optional-style.css
new file mode 100644
index 000000000..616aa79f0
--- /dev/null
+++ b/layout/reftests/css-optional/css-optional-style.css
@@ -0,0 +1,8 @@
+input, textarea, select, button,
+*:required {
+ visibility: hidden;
+}
+
+*:optional {
+ visibility: visible;
+}
diff --git a/layout/reftests/css-optional/css-optional-textarea-ref.html b/layout/reftests/css-optional/css-optional-textarea-ref.html
new file mode 100644
index 000000000..bde6f508f
--- /dev/null
+++ b/layout/reftests/css-optional/css-optional-textarea-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea></textarea>
+ </body>
+</html>
diff --git a/layout/reftests/css-optional/css-optional-textarea.html b/layout/reftests/css-optional/css-optional-textarea.html
new file mode 100644
index 000000000..2e85c4df5
--- /dev/null
+++ b/layout/reftests/css-optional/css-optional-textarea.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='css-optional-style.css'>
+ <body>
+ <textarea></textarea>
+ </body>
+</html>
diff --git a/layout/reftests/css-optional/reftest-stylo.list b/layout/reftests/css-optional/reftest-stylo.list
new file mode 100644
index 000000000..253f1b589
--- /dev/null
+++ b/layout/reftests/css-optional/reftest-stylo.list
@@ -0,0 +1,11 @@
+# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing
+# Checking if these elements support :optional.
+== css-optional-textarea.html css-optional-textarea.html
+== css-optional-input.html css-optional-input.html
+== css-optional-select.html css-optional-select.html
+== css-optional-button.html css-optional-button.html
+
+# Checking dynamic behavior.
+== css-optional-dyn-1.html css-optional-dyn-1.html
+== css-optional-dyn-2.html css-optional-dyn-2.html
+
diff --git a/layout/reftests/css-optional/reftest.list b/layout/reftests/css-optional/reftest.list
new file mode 100644
index 000000000..18d34eaeb
--- /dev/null
+++ b/layout/reftests/css-optional/reftest.list
@@ -0,0 +1,10 @@
+# Checking if these elements support :optional.
+== css-optional-textarea.html css-optional-textarea-ref.html
+== css-optional-input.html css-optional-input-ref.html
+== css-optional-select.html css-optional-select-ref.html
+== css-optional-button.html about:blank
+
+# Checking dynamic behavior.
+== css-optional-dyn-1.html css-optional-input-ref.html
+== css-optional-dyn-2.html about:blank
+