summaryrefslogtreecommitdiffstats
path: root/layout/reftests/css-invalid/input
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /layout/reftests/css-invalid/input
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--layout/reftests/css-invalid/input/input-button-ref.html7
-rw-r--r--layout/reftests/css-invalid/input/input-button.html9
-rw-r--r--layout/reftests/css-invalid/input/input-customerror.html18
-rw-r--r--layout/reftests/css-invalid/input/input-disabled-fieldset-1.html14
-rw-r--r--layout/reftests/css-invalid/input/input-disabled-fieldset-2.html23
-rw-r--r--layout/reftests/css-invalid/input/input-disabled.html9
-rw-r--r--layout/reftests/css-invalid/input/input-dyn-disabled.html18
-rw-r--r--layout/reftests/css-invalid/input/input-dyn-not-disabled.html19
-rw-r--r--layout/reftests/css-invalid/input/input-dyn-not-readonly.html9
-rw-r--r--layout/reftests/css-invalid/input/input-dyn-readonly.html9
-rw-r--r--layout/reftests/css-invalid/input/input-email-invalid.html10
-rw-r--r--layout/reftests/css-invalid/input/input-email-ref.html7
-rw-r--r--layout/reftests/css-invalid/input/input-email-valid.html10
-rw-r--r--layout/reftests/css-invalid/input/input-fieldset-legend-ref.html11
-rw-r--r--layout/reftests/css-invalid/input/input-fieldset-legend.html14
-rw-r--r--layout/reftests/css-invalid/input/input-fieldset-ref.html11
-rw-r--r--layout/reftests/css-invalid/input/input-image-ref.html7
-rw-r--r--layout/reftests/css-invalid/input/input-image.html9
-rw-r--r--layout/reftests/css-invalid/input/input-pattern-invalid.html10
-rw-r--r--layout/reftests/css-invalid/input/input-pattern-valid.html10
-rw-r--r--layout/reftests/css-invalid/input/input-radio-checked-ref.html8
-rw-r--r--layout/reftests/css-invalid/input/input-radio-customerror.html11
-rw-r--r--layout/reftests/css-invalid/input/input-radio-dyn-valid-1.html11
-rw-r--r--layout/reftests/css-invalid/input/input-radio-dyn-valid-2.html11
-rw-r--r--layout/reftests/css-invalid/input/input-radio-focus-click.html30
-rw-r--r--layout/reftests/css-invalid/input/input-radio-nogroup-required-invalid.html8
-rw-r--r--layout/reftests/css-invalid/input/input-radio-nogroup-required-valid.html8
-rw-r--r--layout/reftests/css-invalid/input/input-radio-ref.html8
-rw-r--r--layout/reftests/css-invalid/input/input-radio-required.html10
-rw-r--r--layout/reftests/css-invalid/input/input-readonly.html9
-rw-r--r--layout/reftests/css-invalid/input/input-ref.html7
-rw-r--r--layout/reftests/css-invalid/input/input-required-invalid.html10
-rw-r--r--layout/reftests/css-invalid/input/input-required-valid.html10
-rw-r--r--layout/reftests/css-invalid/input/input-reset.html10
-rw-r--r--layout/reftests/css-invalid/input/input-submit-ref.html7
-rw-r--r--layout/reftests/css-invalid/input/input-submit.html9
-rw-r--r--layout/reftests/css-invalid/input/input-type-barred.html10
-rw-r--r--layout/reftests/css-invalid/input/input-type-invalid.html20
-rw-r--r--layout/reftests/css-invalid/input/input-url-invalid.html10
-rw-r--r--layout/reftests/css-invalid/input/input-url-ref.html7
-rw-r--r--layout/reftests/css-invalid/input/input-url-valid.html10
-rw-r--r--layout/reftests/css-invalid/input/input-valid.html9
-rw-r--r--layout/reftests/css-invalid/input/input-withtext-ref.html7
-rw-r--r--layout/reftests/css-invalid/input/reftest.list33
-rw-r--r--layout/reftests/css-invalid/input/style.css26
45 files changed, 533 insertions, 0 deletions
diff --git a/layout/reftests/css-invalid/input/input-button-ref.html b/layout/reftests/css-invalid/input/input-button-ref.html
new file mode 100644
index 0000000000..6f001b2109
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-button-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input type='button' class='ref'>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-button.html b/layout/reftests/css-invalid/input/input-button.html
new file mode 100644
index 0000000000..5d708712af
--- /dev/null
+++ b/layout/reftests/css-invalid/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 :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notinvalid' type='button'>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-customerror.html b/layout/reftests/css-invalid/input/input-customerror.html
new file mode 100644
index 0000000000..a0aad9b374
--- /dev/null
+++ b/layout/reftests/css-invalid/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);
+ </script>
+ </head>
+ <!-- Test: if input has a custom error, it should be affected by :invalid
+ pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='invalid' id='t'>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-disabled-fieldset-1.html b/layout/reftests/css-invalid/input/input-disabled-fieldset-1.html
new file mode 100644
index 0000000000..1b82858f57
--- /dev/null
+++ b/layout/reftests/css-invalid/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 :invalid
+ pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <fieldset disabled>
+ <fieldset>
+ <input class='notinvalid' required>
+ </fieldset>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-disabled-fieldset-2.html b/layout/reftests/css-invalid/input/input-disabled-fieldset-2.html
new file mode 100644
index 0000000000..c470f77330
--- /dev/null
+++ b/layout/reftests/css-invalid/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 :invalid
+ 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='notinvalid' required>
+ </fieldset>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-disabled.html b/layout/reftests/css-invalid/input/input-disabled.html
new file mode 100644
index 0000000000..9015e7bc51
--- /dev/null
+++ b/layout/reftests/css-invalid/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 :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notinvalid' disabled>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-dyn-disabled.html b/layout/reftests/css-invalid/input/input-dyn-disabled.html
new file mode 100644
index 0000000000..770313752c
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-dyn-disabled.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input 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('i');
+ e.setCustomValidity('foo');
+ e.disabled = 'true';
+ document.documentElement.className='';
+ }
+ </script>
+ <body onload="onLoadHandler();">
+ <input class='notinvalid' id='i'>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-dyn-not-disabled.html b/layout/reftests/css-invalid/input/input-dyn-not-disabled.html
new file mode 100644
index 0000000000..327c1ab8f8
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-dyn-not-disabled.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input 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('i');
+ e.setCustomValidity('foo');
+ e.removeAttribute('disabled');
+ document.documentElement.className='';
+ }
+ </script>
+ <body onload="onLoadHandler();">
+ <input class='invalid' id='i' disabled>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-dyn-not-readonly.html b/layout/reftests/css-invalid/input/input-dyn-not-readonly.html
new file mode 100644
index 0000000000..83bf1024eb
--- /dev/null
+++ b/layout/reftests/css-invalid/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 :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').removeAttribute('readonly'); document.documentElement.className='';">
+ <input class='invalid' id='i' readonly required>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-dyn-readonly.html b/layout/reftests/css-invalid/input/input-dyn-readonly.html
new file mode 100644
index 0000000000..e00ce5f488
--- /dev/null
+++ b/layout/reftests/css-invalid/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 :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').readOnly='ro'; document.documentElement.className='';">
+ <input class='notinvalid' id='i' required>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-email-invalid.html b/layout/reftests/css-invalid/input/input-email-invalid.html
new file mode 100644
index 0000000000..66604c45d8
--- /dev/null
+++ b/layout/reftests/css-invalid/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 be affected by :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='invalid' type='email' value='foo'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-invalid/input/input-email-ref.html b/layout/reftests/css-invalid/input/input-email-ref.html
new file mode 100644
index 0000000000..8c598ef9df
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-email-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input value='foo@bar.com' class='ref'>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-email-valid.html b/layout/reftests/css-invalid/input/input-email-valid.html
new file mode 100644
index 0000000000..7eb1c6f988
--- /dev/null
+++ b/layout/reftests/css-invalid/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 not be affected by :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notinvalid' type='email' value='foo@bar.com'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-invalid/input/input-fieldset-legend-ref.html b/layout/reftests/css-invalid/input/input-fieldset-legend-ref.html
new file mode 100644
index 0000000000..2a171df0a6
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-fieldset-legend-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <fieldset>
+ <legend>
+ <input class='ref'>
+ </legend>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-fieldset-legend.html b/layout/reftests/css-invalid/input/input-fieldset-legend.html
new file mode 100644
index 0000000000..4cdb026c7a
--- /dev/null
+++ b/layout/reftests/css-invalid/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 :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <fieldset disabled>
+ <legend>
+ <input class='invalid' required>
+ </legend>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-fieldset-ref.html b/layout/reftests/css-invalid/input/input-fieldset-ref.html
new file mode 100644
index 0000000000..25c90be997
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-fieldset-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <fieldset>
+ <fieldset>
+ <input class='ref'>
+ </fieldset>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-image-ref.html b/layout/reftests/css-invalid/input/input-image-ref.html
new file mode 100644
index 0000000000..1509fe487c
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-image-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input type='image' class='ref'>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-image.html b/layout/reftests/css-invalid/input/input-image.html
new file mode 100644
index 0000000000..d949e66e18
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-image.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 :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notinvalid' type='image'>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-pattern-invalid.html b/layout/reftests/css-invalid/input/input-pattern-invalid.html
new file mode 100644
index 0000000000..4a2325c611
--- /dev/null
+++ b/layout/reftests/css-invalid/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 be affected by :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='invalid' pattern='bar' value='foo'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-invalid/input/input-pattern-valid.html b/layout/reftests/css-invalid/input/input-pattern-valid.html
new file mode 100644
index 0000000000..7e5283410e
--- /dev/null
+++ b/layout/reftests/css-invalid/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 not be affected by :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notinvalid' pattern='foo' value='foo'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-invalid/input/input-radio-checked-ref.html b/layout/reftests/css-invalid/input/input-radio-checked-ref.html
new file mode 100644
index 0000000000..45864b158c
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-radio-checked-ref.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input type='radio' class='ref' checked>
+ <input type='radio' class='ref'>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-radio-customerror.html b/layout/reftests/css-invalid/input/input-radio-customerror.html
new file mode 100644
index 0000000000..e5fadd514c
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-radio-customerror.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if one radio in a group is suffering from a custom error, the other
+ radio should not be invalid. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i1').setCustomValidity('foo');
+ document.documentElement.className='';">
+ <input class='invalid' id='i1' name='foo' type='radio'>
+ <input class='notinvalid' id='i2' name='foo' type='radio'>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-radio-dyn-valid-1.html b/layout/reftests/css-invalid/input/input-radio-dyn-valid-1.html
new file mode 100644
index 0000000000..30db7c015a
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-radio-dyn-valid-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: when there are no radio suffering from being missing in the radio
+ group, all radio should not suffer from being missing. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i1').checked = true;
+ document.documentElement.className='';">
+ <input class='notinvalid' id='i1' name='foo' type='radio' required>
+ <input class='notinvalid' id='i2' name='foo' type='radio'>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-radio-dyn-valid-2.html b/layout/reftests/css-invalid/input/input-radio-dyn-valid-2.html
new file mode 100644
index 0000000000..a2cfbd6a10
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-radio-dyn-valid-2.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: when there are no radio suffering from being missing in the radio
+ group, all radio should not suffer from being missing. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i1').required = false;
+ document.documentElement.className='';">
+ <input class='notinvalid' id='i1' name='foo' type='radio' required>
+ <input class='notinvalid' id='i2' name='foo' type='radio'>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-radio-focus-click.html b/layout/reftests/css-invalid/input/input-radio-focus-click.html
new file mode 100644
index 0000000000..a25ea85e39
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-radio-focus-click.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+ <body class="reftest-wait">
+ <!-- See bug 658282. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <script>
+ function loadHandler() {
+ var button = document.getElementsByTagName('button')[0];
+ var radios = document.getElementsByName('foo');
+
+ button.onclick = function() {
+ for (var i = 0; i < radios.length; i++) {
+ radios[i].checked = false;
+ }
+ button.remove();
+ document.documentElement.className='';
+ };
+
+ radios[0].focus();
+ radios[0].checked = true;
+ button.focus();
+ button.click();
+ }
+ </script>
+ <body onload="loadHandler();">
+ <input class='invalid' id='i1' name='foo' type='radio' required>
+ <input class='invalid' id='i2' name='foo' type='radio' required>
+ <button></button>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-radio-nogroup-required-invalid.html b/layout/reftests/css-invalid/input/input-radio-nogroup-required-invalid.html
new file mode 100644
index 0000000000..d46b1607c2
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-radio-nogroup-required-invalid.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notinvalid' id='i' type='radio' checked required>
+ <input class='notinvalid' type='radio'> <!-- adding this one so we don't have to create a second ref -->
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-radio-nogroup-required-valid.html b/layout/reftests/css-invalid/input/input-radio-nogroup-required-valid.html
new file mode 100644
index 0000000000..ba096be4db
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-radio-nogroup-required-valid.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='invalid' id='i' type='radio' required name='i'>
+ <input class='notinvalid' type='radio'> <!-- adding this one so we don't have to create a second ref -->
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-radio-ref.html b/layout/reftests/css-invalid/input/input-radio-ref.html
new file mode 100644
index 0000000000..9abe06bca8
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-radio-ref.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input type='radio' class='ref'>
+ <input type='radio' class='ref'>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-radio-required.html b/layout/reftests/css-invalid/input/input-radio-required.html
new file mode 100644
index 0000000000..1faaedc13a
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-radio-required.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if one radio in a group has the required attribute and no radio is
+ checked, all radio in the group should suffer from being missing. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='invalid' id='i1' name='foo' type='radio' required>
+ <input class='invalid' id='i2' name='foo' type='radio'>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-readonly.html b/layout/reftests/css-invalid/input/input-readonly.html
new file mode 100644
index 0000000000..4aebf00265
--- /dev/null
+++ b/layout/reftests/css-invalid/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 :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notinvalid' readonly>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-ref.html b/layout/reftests/css-invalid/input/input-ref.html
new file mode 100644
index 0000000000..ad0de3cfba
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='ref'>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-required-invalid.html b/layout/reftests/css-invalid/input/input-required-invalid.html
new file mode 100644
index 0000000000..eea8eb2409
--- /dev/null
+++ b/layout/reftests/css-invalid/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 be affected by :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='invalid' required>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-invalid/input/input-required-valid.html b/layout/reftests/css-invalid/input/input-required-valid.html
new file mode 100644
index 0000000000..bde7d22aa1
--- /dev/null
+++ b/layout/reftests/css-invalid/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 not be affected by :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notinvalid' value='foo' required>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-invalid/input/input-reset.html b/layout/reftests/css-invalid/input/input-reset.html
new file mode 100644
index 0000000000..04d02f9e40
--- /dev/null
+++ b/layout/reftests/css-invalid/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 :invalid 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='notinvalid' type='reset' value=''>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-submit-ref.html b/layout/reftests/css-invalid/input/input-submit-ref.html
new file mode 100644
index 0000000000..a1a0aa7fb9
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-submit-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input type='submit' class='ref'>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-submit.html b/layout/reftests/css-invalid/input/input-submit.html
new file mode 100644
index 0000000000..180235bb62
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-submit.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 :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notinvalid' type='submit'>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-type-barred.html b/layout/reftests/css-invalid/input/input-type-barred.html
new file mode 100644
index 0000000000..ac99c0f25f
--- /dev/null
+++ b/layout/reftests/css-invalid/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 :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').type='button'; document.documentElement.className='';">
+ <input class='notinvalid' id='i'>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-type-invalid.html b/layout/reftests/css-invalid/input/input-type-invalid.html
new file mode 100644
index 0000000000..537c877c06
--- /dev/null
+++ b/layout/reftests/css-invalid/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);
+ </script>
+ <body>
+ <input class='invalid' type='button' id='i'>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-url-invalid.html b/layout/reftests/css-invalid/input/input-url-invalid.html
new file mode 100644
index 0000000000..6df386a561
--- /dev/null
+++ b/layout/reftests/css-invalid/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 be affected by :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='invalid' type='url' value='foo'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-invalid/input/input-url-ref.html b/layout/reftests/css-invalid/input/input-url-ref.html
new file mode 100644
index 0000000000..387a384d6f
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-url-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input value='http://mozilla.org/' class='ref'>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-url-valid.html b/layout/reftests/css-invalid/input/input-url-valid.html
new file mode 100644
index 0000000000..08162538a3
--- /dev/null
+++ b/layout/reftests/css-invalid/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 not be affected by :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notinvalid' type='url' value='http://mozilla.org/'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-invalid/input/input-valid.html b/layout/reftests/css-invalid/input/input-valid.html
new file mode 100644
index 0000000000..9b8e0e039e
--- /dev/null
+++ b/layout/reftests/css-invalid/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 not be affected by :invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notinvalid'>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/input-withtext-ref.html b/layout/reftests/css-invalid/input/input-withtext-ref.html
new file mode 100644
index 0000000000..1b4e93b008
--- /dev/null
+++ b/layout/reftests/css-invalid/input/input-withtext-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input value='foo' class='ref'>
+ </body>
+</html>
diff --git a/layout/reftests/css-invalid/input/reftest.list b/layout/reftests/css-invalid/input/reftest.list
new file mode 100644
index 0000000000..a3f9544d52
--- /dev/null
+++ b/layout/reftests/css-invalid/input/reftest.list
@@ -0,0 +1,33 @@
+== input-valid.html input-ref.html
+fuzzy(0-2,0-10) == input-customerror.html input-ref.html
+== input-disabled.html input-ref.html
+== input-dyn-disabled.html input-ref.html
+== input-dyn-not-disabled.html input-ref.html
+== input-readonly.html input-ref.html
+== input-dyn-readonly.html input-ref.html
+== input-dyn-not-readonly.html input-ref.html
+== input-required-valid.html input-withtext-ref.html
+== input-required-invalid.html input-ref.html
+== input-button.html input-button-ref.html
+== input-reset.html input-button-ref.html
+== input-email-invalid.html input-withtext-ref.html
+== 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
+== input-type-barred.html input-button-ref.html
+fuzzy(0-11,0-4) == input-type-invalid.html input-ref.html
+== input-disabled-fieldset-1.html input-fieldset-ref.html
+== input-disabled-fieldset-2.html input-fieldset-ref.html
+== input-fieldset-legend.html input-fieldset-legend-ref.html
+== input-radio-required.html input-radio-ref.html
+fuzzy(0-2,0-10) == input-radio-customerror.html input-radio-ref.html
+fuzzy(0-2,0-10) == input-radio-dyn-valid-1.html input-radio-checked-ref.html
+fuzzy(0-2,0-10) == input-radio-dyn-valid-2.html input-radio-ref.html
+fuzzy(0-2,0-10) == input-radio-nogroup-required-valid.html input-radio-ref.html
+fuzzy(0-2,0-10) == input-radio-nogroup-required-invalid.html input-radio-checked-ref.html
+fuzzy(0-2,0-10) == input-radio-focus-click.html input-radio-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-invalid/input/style.css b/layout/reftests/css-invalid/input/style.css
new file mode 100644
index 0000000000..e3e221a26f
--- /dev/null
+++ b/layout/reftests/css-invalid/input/style.css
@@ -0,0 +1,26 @@
+/* Override default style */
+input {
+ -moz-appearance: none;
+ background: none;
+}
+input:invalid {
+ box-shadow: none;
+}
+
+input.notinvalid {
+ box-shadow: 0 0 1.5px 1px green;
+}
+input.notinvalid:invalid {
+ box-shadow: 0 0 1.5px 1px red;
+}
+
+input.invalid {
+ box-shadow: 0 0 1.5px 1px red;
+}
+input.invalid:invalid {
+ box-shadow: 0 0 1.5px 1px green;
+}
+
+input.ref {
+ box-shadow: 0 0 1.5px 1px green;
+}