summaryrefslogtreecommitdiffstats
path: root/layout/reftests/css-valid/input
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /layout/reftests/css-valid/input
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'layout/reftests/css-valid/input')
-rw-r--r--layout/reftests/css-valid/input/input-button-ref.html6
-rw-r--r--layout/reftests/css-valid/input/input-button.html9
-rw-r--r--layout/reftests/css-valid/input/input-customerror.html18
-rw-r--r--layout/reftests/css-valid/input/input-disabled-fieldset-1.html14
-rw-r--r--layout/reftests/css-valid/input/input-disabled-fieldset-2.html23
-rw-r--r--layout/reftests/css-valid/input/input-disabled.html9
-rw-r--r--layout/reftests/css-valid/input/input-dyn-disabled.html9
-rw-r--r--layout/reftests/css-valid/input/input-dyn-not-disabled.html9
-rw-r--r--layout/reftests/css-valid/input/input-dyn-not-readonly.html9
-rw-r--r--layout/reftests/css-valid/input/input-dyn-readonly.html9
-rw-r--r--layout/reftests/css-valid/input/input-email-invalid.html10
-rw-r--r--layout/reftests/css-valid/input/input-email-ref.html6
-rw-r--r--layout/reftests/css-valid/input/input-email-valid.html10
-rw-r--r--layout/reftests/css-valid/input/input-fieldset-legend-ref.html10
-rw-r--r--layout/reftests/css-valid/input/input-fieldset-legend.html14
-rw-r--r--layout/reftests/css-valid/input/input-fieldset-ref.html10
-rw-r--r--layout/reftests/css-valid/input/input-image-ref.html6
-rw-r--r--layout/reftests/css-valid/input/input-image.html9
-rw-r--r--layout/reftests/css-valid/input/input-pattern-invalid.html10
-rw-r--r--layout/reftests/css-valid/input/input-pattern-valid.html10
-rw-r--r--layout/reftests/css-valid/input/input-radio-customerror.html15
-rw-r--r--layout/reftests/css-valid/input/input-radio-dyn-valid-1.html15
-rw-r--r--layout/reftests/css-valid/input/input-radio-dyn-valid-2.html15
-rw-r--r--layout/reftests/css-valid/input/input-radio-nogroup-required-invalid.html12
-rw-r--r--layout/reftests/css-valid/input/input-radio-nogroup-required-valid.html12
-rw-r--r--layout/reftests/css-valid/input/input-radio-required.html14
-rw-r--r--layout/reftests/css-valid/input/input-readonly.html9
-rw-r--r--layout/reftests/css-valid/input/input-ref.html6
-rw-r--r--layout/reftests/css-valid/input/input-required-invalid.html10
-rw-r--r--layout/reftests/css-valid/input/input-required-valid.html10
-rw-r--r--layout/reftests/css-valid/input/input-reset.html10
-rw-r--r--layout/reftests/css-valid/input/input-submit-ref.html6
-rw-r--r--layout/reftests/css-valid/input/input-submit.html9
-rw-r--r--layout/reftests/css-valid/input/input-type-barred.html10
-rw-r--r--layout/reftests/css-valid/input/input-type-invalid.html20
-rw-r--r--layout/reftests/css-valid/input/input-url-invalid.html10
-rw-r--r--layout/reftests/css-valid/input/input-url-ref.html6
-rw-r--r--layout/reftests/css-valid/input/input-url-valid.html10
-rw-r--r--layout/reftests/css-valid/input/input-valid.html9
-rw-r--r--layout/reftests/css-valid/input/input-withtext-ref.html6
-rw-r--r--layout/reftests/css-valid/input/reftest-stylo.list37
-rw-r--r--layout/reftests/css-valid/input/reftest.list32
-rw-r--r--layout/reftests/css-valid/input/style.css18
-rw-r--r--layout/reftests/css-valid/input/success-ref.html6
44 files changed, 517 insertions, 0 deletions
diff --git a/layout/reftests/css-valid/input/input-button-ref.html b/layout/reftests/css-valid/input/input-button-ref.html
new file mode 100644
index 000000000..3b828533e
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-button-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input type='button' style="background-color: green;">
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-button.html b/layout/reftests/css-valid/input/input-button.html
new file mode 100644
index 000000000..f367111ce
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-button.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is of button type, it is barred from constraint validation
+ and should not be affected by :valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid' type='button'>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-customerror.html b/layout/reftests/css-valid/input/input-customerror.html
new file mode 100644
index 000000000..6cca5c66e
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-customerror.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <script>
+ function doTest() {
+ document.getElementById('t').setCustomValidity('foo');
+ document.documentElement.className='';
+ }
+ document.addEventListener("MozReftestInvalidate", doTest, false);
+ </script>
+ </head>
+ <!-- Test: if input has a custom error, it should not be affected by :valid
+ pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid' id='t'>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-disabled-fieldset-1.html b/layout/reftests/css-valid/input/input-disabled-fieldset-1.html
new file mode 100644
index 000000000..114447a3f
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-disabled-fieldset-1.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input has a disabled fieldset ancestor, it is barred from
+ constraint validation and should not be affected by :valid
+ pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <fieldset disabled>
+ <fieldset>
+ <input class='notvalid'>
+ </fieldset>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-disabled-fieldset-2.html b/layout/reftests/css-valid/input/input-disabled-fieldset-2.html
new file mode 100644
index 000000000..d00df76a5
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-disabled-fieldset-2.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input has a disabled fieldset ancestor, it is barred from
+ constraint validation and should not be affected by :valid
+ pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <script>
+ function onloadHandler()
+ {
+ var fieldsets = document.getElementsByTagName("fieldset");
+ fieldsets[1].disabled = true;
+ fieldsets[0].disabled = false;
+ document.documentElement.className='';
+ }
+ </script>
+ <body onload="onloadHandler();">
+ <fieldset disabled>
+ <fieldset>
+ <input class='notvalid'>
+ </fieldset>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-disabled.html b/layout/reftests/css-valid/input/input-disabled.html
new file mode 100644
index 000000000..adbae0e03
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-disabled.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is disabled, it is barred from constraint validation
+ and should not be affected by :valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid' disabled>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-dyn-disabled.html b/layout/reftests/css-valid/input/input-dyn-disabled.html
new file mode 100644
index 000000000..5ad831422
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-dyn-disabled.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input is disabled, it is barred from constraint validation
+ and should not be affected by :valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').disabled='true'; document.documentElement.className='';">
+ <input class='notvalid' id='i'>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-dyn-not-disabled.html b/layout/reftests/css-valid/input/input-dyn-not-disabled.html
new file mode 100644
index 000000000..1f693b4f7
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-dyn-not-disabled.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input is not disabled, it is candidate for constraint validation
+ and should be affected by :valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').removeAttribute('disabled'); document.documentElement.className='';">
+ <input class='valid' id='i' disabled>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-dyn-not-readonly.html b/layout/reftests/css-valid/input/input-dyn-not-readonly.html
new file mode 100644
index 000000000..f77588ec9
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-dyn-not-readonly.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input is no longer readonly, it is candidate for constraint
+ validation and should be affected by :valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').removeAttribute('readonly'); document.documentElement.className='';">
+ <input class='valid' id='i' readonly>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-dyn-readonly.html b/layout/reftests/css-valid/input/input-dyn-readonly.html
new file mode 100644
index 000000000..3fb4aae97
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-dyn-readonly.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input is readonly, it is barred from constraint validation
+ and should not be affected by :valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').readOnly='ro'; document.documentElement.className='';">
+ <input class='notvalid' id='i'>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-email-invalid.html b/layout/reftests/css-valid/input/input-email-invalid.html
new file mode 100644
index 000000000..1c1777673
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-email-invalid.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ it should not be affected by :valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid' type='email' value='foo'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-valid/input/input-email-ref.html b/layout/reftests/css-valid/input/input-email-ref.html
new file mode 100644
index 000000000..ecec613c2
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-email-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input value='foo@bar.com' style="background-color: green;">
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-email-valid.html b/layout/reftests/css-valid/input/input-email-valid.html
new file mode 100644
index 000000000..4f0816058
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-email-valid.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is valid and not barred from constraint validation,
+ it should be affected by :valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='valid' type='email' value='foo@bar.com'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-valid/input/input-fieldset-legend-ref.html b/layout/reftests/css-valid/input/input-fieldset-legend-ref.html
new file mode 100644
index 000000000..8d39d9164
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-fieldset-legend-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <fieldset>
+ <legend>
+ <input style="background-color: green;"></input>
+ </legend>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-fieldset-legend.html b/layout/reftests/css-valid/input/input-fieldset-legend.html
new file mode 100644
index 000000000..7c454f360
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-fieldset-legend.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input has a disabled fieldset ancestor, but is in the first
+ legend, it is not barred from constraint validation and should be
+ affected by :valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <fieldset disabled>
+ <legend>
+ <input class='valid'></input>
+ </legend>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-fieldset-ref.html b/layout/reftests/css-valid/input/input-fieldset-ref.html
new file mode 100644
index 000000000..a9e123912
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-fieldset-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <fieldset>
+ <fieldset>
+ <input style="background-color: green;">
+ </fieldset>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-image-ref.html b/layout/reftests/css-valid/input/input-image-ref.html
new file mode 100644
index 000000000..6c014b895
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-image-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input type='image' style="background-color: green;">
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-image.html b/layout/reftests/css-valid/input/input-image.html
new file mode 100644
index 000000000..de4cce3d3
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-image.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is of image type, has no custom error and is not barred
+ from constraint validation, it should be affected by :valid pseudo-class -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='valid' type='image'>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-pattern-invalid.html b/layout/reftests/css-valid/input/input-pattern-invalid.html
new file mode 100644
index 000000000..a7172bb46
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-pattern-invalid.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ it should not be affected by :valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid' pattern='bar' value='foo'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-valid/input/input-pattern-valid.html b/layout/reftests/css-valid/input/input-pattern-valid.html
new file mode 100644
index 000000000..1ed74225c
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-pattern-valid.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is valid and not barred from constraint validation,
+ it should be affected by :valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='valid' pattern='foo' value='foo'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-valid/input/input-radio-customerror.html b/layout/reftests/css-valid/input/input-radio-customerror.html
new file mode 100644
index 000000000..296bd5a4c
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-radio-customerror.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i1').setCustomValidity('foo');
+ if (document.getElementById('i1').matches(':valid') ||
+ !document.getElementById('i2').matches(':valid')) {
+ document.body.textContent='FAIL';
+ } else {
+ document.body.textContent='SUCCESS';
+ }
+ document.documentElement.className='';">
+ <input id='i1' name='foo' type='radio'>
+ <input id='i2' name='foo' type='radio'>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-radio-dyn-valid-1.html b/layout/reftests/css-valid/input/input-radio-dyn-valid-1.html
new file mode 100644
index 000000000..5d5ca72c7
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-radio-dyn-valid-1.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i1').checked = true;
+ if (!document.getElementById('i1').matches(':valid') ||
+ !document.getElementById('i2').matches(':valid')) {
+ document.body.textContent='FAIL';
+ } else {
+ document.body.textContent='SUCCESS';
+ }
+ document.documentElement.className='';">
+ <input id='i1' name='foo' type='radio' required>
+ <input id='i2' name='foo' type='radio'>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-radio-dyn-valid-2.html b/layout/reftests/css-valid/input/input-radio-dyn-valid-2.html
new file mode 100644
index 000000000..ebece2b4c
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-radio-dyn-valid-2.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i1').required = false;
+ if (!document.getElementById('i1').matches(':valid') ||
+ !document.getElementById('i2').matches(':valid')) {
+ document.body.textContent='FAIL';
+ } else {
+ document.body.textContent='SUCCESS';
+ }
+ document.documentElement.className='';">
+ <input id='i1' name='foo' type='radio' required>
+ <input id='i2' name='foo' type='radio'>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-radio-nogroup-required-invalid.html b/layout/reftests/css-valid/input/input-radio-nogroup-required-invalid.html
new file mode 100644
index 000000000..765de1cb2
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-radio-nogroup-required-invalid.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="if (!document.getElementById('i').matches(':valid')) {
+ document.body.textContent='FAIL';
+ } else {
+ document.body.textContent='SUCCESS';
+ }
+ document.documentElement.className='';">
+ <input id='i' type='radio' checked required>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-radio-nogroup-required-valid.html b/layout/reftests/css-valid/input/input-radio-nogroup-required-valid.html
new file mode 100644
index 000000000..32f210d4e
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-radio-nogroup-required-valid.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="if (document.getElementById('i').matches(':valid')) {
+ document.body.textContent='FAIL';
+ } else {
+ document.body.textContent='SUCCESS';
+ }
+ document.documentElement.className='';">
+ <input id='i' type='radio' required>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-radio-required.html b/layout/reftests/css-valid/input/input-radio-required.html
new file mode 100644
index 000000000..f1e056d36
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-radio-required.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="if (document.getElementById('i1').matches(':valid') ||
+ document.getElementById('i2').matches(':valid')) {
+ document.body.textContent='FAIL';
+ } else {
+ document.body.textContent='SUCCESS';
+ }
+ document.documentElement.className='';">
+ <input id='i1' name='foo' type='radio' required>
+ <input id='i2' name='foo' type='radio'>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-readonly.html b/layout/reftests/css-valid/input/input-readonly.html
new file mode 100644
index 000000000..d8c1f494a
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-readonly.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is readonly, it is barred from constraint validation
+ and should not be affected by :valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid' readonly>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-ref.html b/layout/reftests/css-valid/input/input-ref.html
new file mode 100644
index 000000000..65b4b9707
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input style="background-color: green;">
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-required-invalid.html b/layout/reftests/css-valid/input/input-required-invalid.html
new file mode 100644
index 000000000..59c89358e
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-required-invalid.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ it should not be affected by :valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid' required>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-valid/input/input-required-valid.html b/layout/reftests/css-valid/input/input-required-valid.html
new file mode 100644
index 000000000..38d6632a2
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-required-valid.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is valid and not barred from constraint validation,
+ it should be affected by :valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='valid' value='foo' required>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-valid/input/input-reset.html b/layout/reftests/css-valid/input/input-reset.html
new file mode 100644
index 000000000..7f03b9f81
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-reset.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is of reset type, it is barred from constraint validation
+ and should not be affected by :valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <!-- Setting value to the empty string let us check against input-button-ref.html -->
+ <input class='notvalid' type='reset' value=''>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-submit-ref.html b/layout/reftests/css-valid/input/input-submit-ref.html
new file mode 100644
index 000000000..d758ea56a
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-submit-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input type='submit' style="background-color: green;">
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-submit.html b/layout/reftests/css-valid/input/input-submit.html
new file mode 100644
index 000000000..585de71d7
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-submit.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is of button type, has no custom error and is not barred
+ from constraint validation, it should be affected by :valid pseudo-class -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='valid' type='submit'>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-type-barred.html b/layout/reftests/css-valid/input/input-type-barred.html
new file mode 100644
index 000000000..34581c1b3
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-type-barred.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if an input has is candidate for constraint validation then change
+ its type to be barred from constraint validation, it should not be
+ affected by :valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').type='button'; document.documentElement.className='';">
+ <input class='notvalid' id='i'>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-type-invalid.html b/layout/reftests/css-valid/input/input-type-invalid.html
new file mode 100644
index 000000000..631fc499a
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-type-invalid.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if an input has a custom error when barred from constraint
+ validation then move a type candidate for constraint validation,
+ it should not be affected by :valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <script>
+ function doTest()
+ {
+ var i = document.getElementById('i');
+ i.setCustomValidity('foo');
+ i.type = 'text';
+ document.documentElement.className='';
+ }
+ document.addEventListener("MozReftestInvalidate", doTest, false);
+ </script>
+ <body>
+ <input class='notvalid' type='button' id='i'>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-url-invalid.html b/layout/reftests/css-valid/input/input-url-invalid.html
new file mode 100644
index 000000000..06300d632
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-url-invalid.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ it should not be affected by :valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid' type='url' value='foo'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-valid/input/input-url-ref.html b/layout/reftests/css-valid/input/input-url-ref.html
new file mode 100644
index 000000000..e95cdbca2
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-url-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input value='http://mozilla.org/' style="background-color: green;">
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-url-valid.html b/layout/reftests/css-valid/input/input-url-valid.html
new file mode 100644
index 000000000..319f67e17
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-url-valid.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is valid and not barred from constraint validation,
+ it should be affected by :valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='valid' type='url' value='http://mozilla.org/'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-valid/input/input-valid.html b/layout/reftests/css-valid/input/input-valid.html
new file mode 100644
index 000000000..88c07045b
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-valid.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is valid and is not barred from constraint validation,
+ it should be affected by :valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='valid'>
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/input-withtext-ref.html b/layout/reftests/css-valid/input/input-withtext-ref.html
new file mode 100644
index 000000000..d54d05215
--- /dev/null
+++ b/layout/reftests/css-valid/input/input-withtext-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input value='foo' style="background-color: green;">
+ </body>
+</html>
diff --git a/layout/reftests/css-valid/input/reftest-stylo.list b/layout/reftests/css-valid/input/reftest-stylo.list
new file mode 100644
index 000000000..4124b358b
--- /dev/null
+++ b/layout/reftests/css-valid/input/reftest-stylo.list
@@ -0,0 +1,37 @@
+# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing
+== input-valid.html input-valid.html
+== input-customerror.html input-customerror.html
+fails-if(B2G||Mulet) fuzzy-if(skiaContent,1,3) == input-disabled.html input-disabled.html
+# Initial mulet triage: parity with B2G/B2G Desktop
+fails-if(B2G||Mulet) fuzzy-if(skiaContent,1,3) == input-dyn-disabled.html input-dyn-disabled.html
+# Initial mulet triage: parity with B2G/B2G Desktop
+fuzzy-if(skiaContent,1,3) == input-dyn-not-disabled.html input-dyn-not-disabled.html
+fuzzy-if(skiaContent,1,3) == input-readonly.html input-readonly.html
+fuzzy-if(skiaContent,1,3) == input-dyn-readonly.html input-dyn-readonly.html
+fuzzy-if(skiaContent,1,3) == input-dyn-not-readonly.html input-dyn-not-readonly.html
+skip == input-maxlength-valid.html input-maxlength-valid.html
+skip == input-maxlength-invalid.html input-maxlength-invalid.html
+== input-required-valid.html input-required-valid.html
+fuzzy-if(skiaContent,1,3) == input-required-invalid.html input-required-invalid.html
+fuzzy-if(skiaContent,2,5) == input-button.html input-button.html
+skip fuzzy-if(skiaContent,2,5) == input-reset.html input-reset.html
+== input-email-invalid.html input-email-invalid.html
+fuzzy-if(skiaContent,2,5) == input-email-valid.html input-email-valid.html
+== input-url-invalid.html input-url-invalid.html
+== input-url-valid.html input-url-valid.html
+== input-pattern-valid.html input-pattern-valid.html
+== input-pattern-invalid.html input-pattern-invalid.html
+fuzzy-if(skiaContent,2,5) == input-type-barred.html input-type-barred.html
+== input-type-invalid.html input-type-invalid.html
+== input-disabled-fieldset-1.html input-disabled-fieldset-1.html
+fuzzy-if(skiaContent,1,3) == input-disabled-fieldset-2.html input-disabled-fieldset-2.html
+skip == input-fieldset-legend.html input-fieldset-legend.html
+== input-radio-required.html input-radio-required.html
+== input-radio-customerror.html input-radio-customerror.html
+== input-radio-dyn-valid-1.html input-radio-dyn-valid-1.html
+== input-radio-dyn-valid-2.html input-radio-dyn-valid-2.html
+== input-radio-nogroup-required-valid.html input-radio-nogroup-required-valid.html
+== input-radio-nogroup-required-invalid.html input-radio-nogroup-required-invalid.html
+== input-submit.html input-submit.html
+== input-image.html input-image.html
+# input type='hidden' shouldn't show
diff --git a/layout/reftests/css-valid/input/reftest.list b/layout/reftests/css-valid/input/reftest.list
new file mode 100644
index 000000000..64ca55558
--- /dev/null
+++ b/layout/reftests/css-valid/input/reftest.list
@@ -0,0 +1,32 @@
+== input-valid.html input-ref.html
+fuzzy(64,4) == input-customerror.html input-ref.html
+fuzzy-if(skiaContent,1,3) == input-disabled.html input-ref.html
+fuzzy-if(skiaContent,1,3) == input-dyn-disabled.html input-ref.html
+fuzzy-if(skiaContent,1,3) == input-dyn-not-disabled.html input-ref.html
+fuzzy-if(skiaContent,1,3) == input-readonly.html input-ref.html
+fuzzy-if(skiaContent,1,3) == input-dyn-readonly.html input-ref.html
+fuzzy-if(skiaContent,1,3) == input-dyn-not-readonly.html input-ref.html
+== input-required-valid.html input-withtext-ref.html
+fuzzy-if(skiaContent,1,3) == input-required-invalid.html input-ref.html
+fuzzy-if(skiaContent,2,5) == input-button.html input-button-ref.html
+fuzzy-if(skiaContent,2,5) == input-reset.html input-button-ref.html
+== input-email-invalid.html input-withtext-ref.html
+fuzzy-if(skiaContent,2,5) == input-email-valid.html input-email-ref.html
+== input-url-invalid.html input-withtext-ref.html
+== input-url-valid.html input-url-ref.html
+== input-pattern-valid.html input-withtext-ref.html
+== input-pattern-invalid.html input-withtext-ref.html
+fuzzy-if(skiaContent,2,5) == input-type-barred.html input-button-ref.html
+fuzzy(64,4) == input-type-invalid.html input-ref.html
+== input-disabled-fieldset-1.html input-fieldset-ref.html
+fuzzy-if(skiaContent,1,3) == input-disabled-fieldset-2.html input-fieldset-ref.html
+== input-fieldset-legend.html input-fieldset-legend-ref.html
+== input-radio-required.html success-ref.html
+== input-radio-customerror.html success-ref.html
+== input-radio-dyn-valid-1.html success-ref.html
+== input-radio-dyn-valid-2.html success-ref.html
+== input-radio-nogroup-required-valid.html success-ref.html
+== input-radio-nogroup-required-invalid.html success-ref.html
+== input-submit.html input-submit-ref.html
+== input-image.html input-image-ref.html
+# input type='hidden' shouldn't show
diff --git a/layout/reftests/css-valid/input/style.css b/layout/reftests/css-valid/input/style.css
new file mode 100644
index 000000000..81c09c3e2
--- /dev/null
+++ b/layout/reftests/css-valid/input/style.css
@@ -0,0 +1,18 @@
+/* Override default style */
+input:invalid {
+ box-shadow: none;
+}
+
+input.notvalid {
+ background-color: green;
+}
+input.notvalid:valid {
+ background-color: red;
+}
+
+input.valid {
+ background-color: red;
+}
+input.valid:valid {
+ background-color: green;
+}
diff --git a/layout/reftests/css-valid/input/success-ref.html b/layout/reftests/css-valid/input/success-ref.html
new file mode 100644
index 000000000..bfa8e0a12
--- /dev/null
+++ b/layout/reftests/css-valid/input/success-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ SUCCESS
+ </body>
+</html>