summaryrefslogtreecommitdiffstats
path: root/layout/reftests/css-submit-invalid
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /layout/reftests/css-submit-invalid
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/css-submit-invalid')
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/add-invalid-element.html21
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/add-submit-control.html21
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/change-type-not-submit-control.html21
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/change-type-submit-control.html21
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/dynamic-invalid-barred-2.html21
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/dynamic-invalid-barred.html21
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/dynamic-invalid-not-barred.html21
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/dynamic-invalid.html22
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/dynamic-valid.html21
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/invalid-barred-ref.html9
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/invalid-ref-2.html8
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/invalid-ref-3.html9
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/invalid-ref.html8
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/reftest.list16
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/remove-form.html23
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/remove-invalid-element.html21
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/remove-submit-control.html21
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/self-invalid.html20
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/static-invalid-barred.html14
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/static-invalid.html14
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/static-valid.html14
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/valid-ref-2.html8
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/valid-ref-3.html9
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/valid-ref-4.html9
-rw-r--r--layout/reftests/css-submit-invalid/button-submit/valid-ref.html9
-rw-r--r--layout/reftests/css-submit-invalid/default-style/button-submit-ref.html9
-rw-r--r--layout/reftests/css-submit-invalid/default-style/button-submit.html21
-rw-r--r--layout/reftests/css-submit-invalid/default-style/input-image-ref.html9
-rw-r--r--layout/reftests/css-submit-invalid/default-style/input-image.html21
-rw-r--r--layout/reftests/css-submit-invalid/default-style/input-submit-ref.html9
-rw-r--r--layout/reftests/css-submit-invalid/default-style/input-submit.html21
-rw-r--r--layout/reftests/css-submit-invalid/default-style/reftest.list3
-rw-r--r--layout/reftests/css-submit-invalid/default-style/style.css2
-rw-r--r--layout/reftests/css-submit-invalid/input-image/add-invalid-element.html21
-rw-r--r--layout/reftests/css-submit-invalid/input-image/add-submit-control.html21
-rw-r--r--layout/reftests/css-submit-invalid/input-image/change-type-not-submit-control.html21
-rw-r--r--layout/reftests/css-submit-invalid/input-image/change-type-submit-control.html21
-rw-r--r--layout/reftests/css-submit-invalid/input-image/dynamic-invalid-barred-2.html21
-rw-r--r--layout/reftests/css-submit-invalid/input-image/dynamic-invalid-barred.html21
-rw-r--r--layout/reftests/css-submit-invalid/input-image/dynamic-invalid-not-barred.html21
-rw-r--r--layout/reftests/css-submit-invalid/input-image/dynamic-invalid.html22
-rw-r--r--layout/reftests/css-submit-invalid/input-image/dynamic-valid.html21
-rw-r--r--layout/reftests/css-submit-invalid/input-image/invalid-barred-ref.html9
-rw-r--r--layout/reftests/css-submit-invalid/input-image/invalid-ref-2.html8
-rw-r--r--layout/reftests/css-submit-invalid/input-image/invalid-ref-3.html9
-rw-r--r--layout/reftests/css-submit-invalid/input-image/invalid-ref.html8
-rw-r--r--layout/reftests/css-submit-invalid/input-image/reftest.list16
-rw-r--r--layout/reftests/css-submit-invalid/input-image/remove-form.html23
-rw-r--r--layout/reftests/css-submit-invalid/input-image/remove-invalid-element.html21
-rw-r--r--layout/reftests/css-submit-invalid/input-image/remove-submit-control.html21
-rw-r--r--layout/reftests/css-submit-invalid/input-image/self-invalid.html20
-rw-r--r--layout/reftests/css-submit-invalid/input-image/static-invalid-barred.html14
-rw-r--r--layout/reftests/css-submit-invalid/input-image/static-invalid.html14
-rw-r--r--layout/reftests/css-submit-invalid/input-image/static-valid.html14
-rw-r--r--layout/reftests/css-submit-invalid/input-image/valid-ref-2.html8
-rw-r--r--layout/reftests/css-submit-invalid/input-image/valid-ref-3.html9
-rw-r--r--layout/reftests/css-submit-invalid/input-image/valid-ref-4.html9
-rw-r--r--layout/reftests/css-submit-invalid/input-image/valid-ref.html9
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/add-invalid-element.html21
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/add-submit-control.html21
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/change-type-not-submit-control.html21
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/change-type-submit-control.html21
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/dynamic-invalid-barred-2.html21
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/dynamic-invalid-barred.html21
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/dynamic-invalid-not-barred.html21
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/dynamic-invalid.html22
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/dynamic-valid.html21
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/invalid-barred-ref.html9
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/invalid-ref-2.html8
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/invalid-ref-3.html9
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/invalid-ref.html8
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/reftest.list16
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/remove-form.html23
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/remove-invalid-element.html21
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/remove-submit-control.html21
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/self-invalid.html20
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/static-invalid-barred.html14
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/static-invalid.html14
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/static-valid.html14
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/valid-ref-2.html8
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/valid-ref-3.html9
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/valid-ref-4.html9
-rw-r--r--layout/reftests/css-submit-invalid/input-submit/valid-ref.html9
-rw-r--r--layout/reftests/css-submit-invalid/reftest.list4
84 files changed, 1305 insertions, 0 deletions
diff --git a/layout/reftests/css-submit-invalid/button-submit/add-invalid-element.html b/layout/reftests/css-submit-invalid/button-submit/add-invalid-element.html
new file mode 100644
index 0000000000..90a1429b63
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/add-invalid-element.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.forms[0].appendChild(document.getElementById('i'));
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <input id='i' type='email' value='foo'>
+ <form>
+ <button type='submit'></button>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/add-submit-control.html b/layout/reftests/css-submit-invalid/button-submit/add-submit-control.html
new file mode 100644
index 0000000000..a9d5c2c1c0
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/add-submit-control.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.forms[0].appendChild(document.getElementById('b'));
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <button id='b' type='submit'></button>
+ <form>
+ <input required>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/change-type-not-submit-control.html b/layout/reftests/css-submit-invalid/button-submit/change-type-not-submit-control.html
new file mode 100644
index 0000000000..9667e3a26a
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/change-type-not-submit-control.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('b').type = 'button';
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input required>
+ <button id='b' type='submit'></button>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/change-type-submit-control.html b/layout/reftests/css-submit-invalid/button-submit/change-type-submit-control.html
new file mode 100644
index 0000000000..cc71e850b4
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/change-type-submit-control.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('b').type = 'submit';
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input required>
+ <button id='b'></button>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/dynamic-invalid-barred-2.html b/layout/reftests/css-submit-invalid/button-submit/dynamic-invalid-barred-2.html
new file mode 100644
index 0000000000..6b8bd26c63
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/dynamic-invalid-barred-2.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('i').value = '';
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input id='i' value='foo' required readonly>
+ <button type='submit'></button>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/dynamic-invalid-barred.html b/layout/reftests/css-submit-invalid/button-submit/dynamic-invalid-barred.html
new file mode 100644
index 0000000000..cbe8162123
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/dynamic-invalid-barred.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('i').readOnly = 'ro';
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input id='i' required>
+ <button type='submit'></button>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/dynamic-invalid-not-barred.html b/layout/reftests/css-submit-invalid/button-submit/dynamic-invalid-not-barred.html
new file mode 100644
index 0000000000..c396d6735e
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/dynamic-invalid-not-barred.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('i').removeAttribute('readonly');
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input id='i' required readonly>
+ <button type='submit'></button>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/dynamic-invalid.html b/layout/reftests/css-submit-invalid/button-submit/dynamic-invalid.html
new file mode 100644
index 0000000000..4301467e34
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/dynamic-invalid.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ :-moz-ui-invalid { box-shadow: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('i').value = '';
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input id='i' value='foo' required>
+ <button type='submit'></button>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/dynamic-valid.html b/layout/reftests/css-submit-invalid/button-submit/dynamic-valid.html
new file mode 100644
index 0000000000..59d2948ac9
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/dynamic-valid.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('i').value = 'foo';
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input id='i' required>
+ <button type='submit'></button>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/invalid-barred-ref.html b/layout/reftests/css-submit-invalid/button-submit/invalid-barred-ref.html
new file mode 100644
index 0000000000..7c319e41b6
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/invalid-barred-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <form>
+ <input required readonly>
+ <button type='submit'></button>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/invalid-ref-2.html b/layout/reftests/css-submit-invalid/button-submit/invalid-ref-2.html
new file mode 100644
index 0000000000..dd03dc812f
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/invalid-ref-2.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <form>
+ <input type='email' value='foo'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/invalid-ref-3.html b/layout/reftests/css-submit-invalid/button-submit/invalid-ref-3.html
new file mode 100644
index 0000000000..67305cc7b8
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/invalid-ref-3.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <table id='t'>
+ <tr><td><input required></td></tr>
+ <tr><td><button type='submit'></button></td></tr>
+ </table>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/invalid-ref.html b/layout/reftests/css-submit-invalid/button-submit/invalid-ref.html
new file mode 100644
index 0000000000..76d80f6fa4
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/invalid-ref.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <form>
+ <input required>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/reftest.list b/layout/reftests/css-submit-invalid/button-submit/reftest.list
new file mode 100644
index 0000000000..d398b047dc
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/reftest.list
@@ -0,0 +1,16 @@
+== static-valid.html valid-ref.html
+== dynamic-valid.html valid-ref.html
+== static-invalid.html invalid-ref.html
+== dynamic-invalid.html invalid-ref.html
+== dynamic-invalid-barred.html invalid-barred-ref.html
+== dynamic-invalid-barred-2.html invalid-barred-ref.html
+== dynamic-invalid-not-barred.html invalid-ref.html
+== static-invalid-barred.html invalid-barred-ref.html
+== remove-invalid-element.html valid-ref-2.html
+== add-invalid-element.html invalid-ref-2.html
+== add-submit-control.html invalid-ref.html
+== remove-submit-control.html valid-ref-3.html
+== change-type-submit-control.html invalid-ref.html
+== change-type-not-submit-control.html valid-ref-4.html
+== self-invalid.html about:blank
+random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == remove-form.html invalid-ref-3.html # bug 1392106
diff --git a/layout/reftests/css-submit-invalid/button-submit/remove-form.html b/layout/reftests/css-submit-invalid/button-submit/remove-form.html
new file mode 100644
index 0000000000..a543297149
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/remove-form.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('t').removeChild(document.forms[0]);
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <table id='t'>
+ <form>
+ <tr><td><input required></td></tr>
+ <tr><td><button type='submit'></button></td></tr>
+ </form>
+ </table>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/remove-invalid-element.html b/layout/reftests/css-submit-invalid/button-submit/remove-invalid-element.html
new file mode 100644
index 0000000000..c92d134c4d
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/remove-invalid-element.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.forms[0].removeChild(document.getElementById('i'));
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input id='i' type='email' value='foo'>
+ <button type='submit'></button>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/remove-submit-control.html b/layout/reftests/css-submit-invalid/button-submit/remove-submit-control.html
new file mode 100644
index 0000000000..3acd342dfe
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/remove-submit-control.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.body.appendChild(document.getElementById('b'));
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input required>
+ <button id='b' type='submit'></button>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/self-invalid.html b/layout/reftests/css-submit-invalid/button-submit/self-invalid.html
new file mode 100644
index 0000000000..d52f598d0e
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/self-invalid.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('b').setCustomValidity('foo');
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <button id='b' type='submit'></button>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/static-invalid-barred.html b/layout/reftests/css-submit-invalid/button-submit/static-invalid-barred.html
new file mode 100644
index 0000000000..57b06a04af
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/static-invalid-barred.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <body>
+ <form>
+ <input required readonly>
+ <button type='submit'></button>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/static-invalid.html b/layout/reftests/css-submit-invalid/button-submit/static-invalid.html
new file mode 100644
index 0000000000..708c967283
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/static-invalid.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <body>
+ <form>
+ <input required>
+ <button type='submit'></button>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/static-valid.html b/layout/reftests/css-submit-invalid/button-submit/static-valid.html
new file mode 100644
index 0000000000..953c55a18c
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/static-valid.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <body>
+ <form>
+ <input value='foo' required>
+ <button type='submit'></button>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/valid-ref-2.html b/layout/reftests/css-submit-invalid/button-submit/valid-ref-2.html
new file mode 100644
index 0000000000..d9f1786a7b
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/valid-ref-2.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <form>
+ <button type='submit'></button>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/valid-ref-3.html b/layout/reftests/css-submit-invalid/button-submit/valid-ref-3.html
new file mode 100644
index 0000000000..cd0ba4c93f
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/valid-ref-3.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <form>
+ <input required>
+ </form>
+ <button type='submit'></button>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/valid-ref-4.html b/layout/reftests/css-submit-invalid/button-submit/valid-ref-4.html
new file mode 100644
index 0000000000..7ff5aead1c
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/valid-ref-4.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <form>
+ <input required>
+ <button type='button'></button>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/button-submit/valid-ref.html b/layout/reftests/css-submit-invalid/button-submit/valid-ref.html
new file mode 100644
index 0000000000..12d1134805
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/button-submit/valid-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <form>
+ <input value='foo' required>
+ <button type='submit'></button>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/default-style/button-submit-ref.html b/layout/reftests/css-submit-invalid/default-style/button-submit-ref.html
new file mode 100644
index 0000000000..80648da6fe
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/default-style/button-submit-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE>
+<html>
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <form>
+ <button type='submit' class='submit-invalid-ref'>Submit!</button>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/default-style/button-submit.html b/layout/reftests/css-submit-invalid/default-style/button-submit.html
new file mode 100644
index 0000000000..fdd5bce514
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/default-style/button-submit.html
@@ -0,0 +1,21 @@
+<!DOCTYPE>
+<html class="reftest-wait">
+ <style>
+ input:invalid {
+ display: none;
+ }
+ </style>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('e').setCustomValidity('foo');
+ document.documentElement.className='';
+ }
+ </script>
+ <body onload="onloadHandler();">
+ <form>
+ <input id='e'>
+ <button type='submit'>Submit!</button>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/default-style/input-image-ref.html b/layout/reftests/css-submit-invalid/default-style/input-image-ref.html
new file mode 100644
index 0000000000..f7cadc13ab
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/default-style/input-image-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE>
+<html>
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <form>
+ <input type='image' class='submit-invalid-ref'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/default-style/input-image.html b/layout/reftests/css-submit-invalid/default-style/input-image.html
new file mode 100644
index 0000000000..1ab153bd2b
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/default-style/input-image.html
@@ -0,0 +1,21 @@
+<!DOCTYPE>
+<html class="reftest-wait">
+ <style>
+ input:invalid {
+ display: none;
+ }
+ </style>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('e').setCustomValidity('foo');
+ document.documentElement.className='';
+ }
+ </script>
+ <body onload="onloadHandler();">
+ <form>
+ <input id='e'>
+ <input type='image'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/default-style/input-submit-ref.html b/layout/reftests/css-submit-invalid/default-style/input-submit-ref.html
new file mode 100644
index 0000000000..77c3fbf702
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/default-style/input-submit-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE>
+<html>
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <form>
+ <input type='submit' class='submit-invalid-ref'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/default-style/input-submit.html b/layout/reftests/css-submit-invalid/default-style/input-submit.html
new file mode 100644
index 0000000000..ccc37dff41
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/default-style/input-submit.html
@@ -0,0 +1,21 @@
+<!DOCTYPE>
+<html class="reftest-wait">
+ <style>
+ input:invalid {
+ display: none;
+ }
+ </style>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('e').setCustomValidity('foo');
+ document.documentElement.className='';
+ }
+ </script>
+ <body onload="onloadHandler();">
+ <form>
+ <input id='e'>
+ <input type='submit'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/default-style/reftest.list b/layout/reftests/css-submit-invalid/default-style/reftest.list
new file mode 100644
index 0000000000..93065dd323
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/default-style/reftest.list
@@ -0,0 +1,3 @@
+== input-submit.html input-submit-ref.html
+== input-image.html input-image-ref.html
+== button-submit.html button-submit-ref.html
diff --git a/layout/reftests/css-submit-invalid/default-style/style.css b/layout/reftests/css-submit-invalid/default-style/style.css
new file mode 100644
index 0000000000..93fd2e5976
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/default-style/style.css
@@ -0,0 +1,2 @@
+.submit-invalid-ref {
+}
diff --git a/layout/reftests/css-submit-invalid/input-image/add-invalid-element.html b/layout/reftests/css-submit-invalid/input-image/add-invalid-element.html
new file mode 100644
index 0000000000..6b697a7db8
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/add-invalid-element.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.forms[0].appendChild(document.getElementById('i'));
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <input id='i' type='email' value='foo'>
+ <form>
+ <input type='image'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/add-submit-control.html b/layout/reftests/css-submit-invalid/input-image/add-submit-control.html
new file mode 100644
index 0000000000..b6bbc9cc0f
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/add-submit-control.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.forms[0].appendChild(document.getElementById('i'));
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <input id='i' type='image'>
+ <form>
+ <input required>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/change-type-not-submit-control.html b/layout/reftests/css-submit-invalid/input-image/change-type-not-submit-control.html
new file mode 100644
index 0000000000..f9656f6c0b
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/change-type-not-submit-control.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('i').type = 'text';
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input required>
+ <input id='i' type='image'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/change-type-submit-control.html b/layout/reftests/css-submit-invalid/input-image/change-type-submit-control.html
new file mode 100644
index 0000000000..370743bf8d
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/change-type-submit-control.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('i').type = 'image';
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input required>
+ <input id='i'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/dynamic-invalid-barred-2.html b/layout/reftests/css-submit-invalid/input-image/dynamic-invalid-barred-2.html
new file mode 100644
index 0000000000..86782baf4b
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/dynamic-invalid-barred-2.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('i').value = '';
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input id='i' value='foo' required readonly>
+ <input type='image'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/dynamic-invalid-barred.html b/layout/reftests/css-submit-invalid/input-image/dynamic-invalid-barred.html
new file mode 100644
index 0000000000..b54b8f123a
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/dynamic-invalid-barred.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('i').readOnly = 'ro';
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input id='i' required>
+ <input type='image'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/dynamic-invalid-not-barred.html b/layout/reftests/css-submit-invalid/input-image/dynamic-invalid-not-barred.html
new file mode 100644
index 0000000000..77fd695269
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/dynamic-invalid-not-barred.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('i').removeAttribute('readonly');
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input id='i' required readonly>
+ <input type='image'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/dynamic-invalid.html b/layout/reftests/css-submit-invalid/input-image/dynamic-invalid.html
new file mode 100644
index 0000000000..e13a3f1ec6
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/dynamic-invalid.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ :-moz-ui-invalid { box-shadow: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('i').value = '';
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input id='i' value='foo' required>
+ <input type='image'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/dynamic-valid.html b/layout/reftests/css-submit-invalid/input-image/dynamic-valid.html
new file mode 100644
index 0000000000..342efb17dc
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/dynamic-valid.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('i').value = 'foo';
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input id='i' required>
+ <input type='image'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/invalid-barred-ref.html b/layout/reftests/css-submit-invalid/input-image/invalid-barred-ref.html
new file mode 100644
index 0000000000..305b03698f
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/invalid-barred-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <form>
+ <input required readonly>
+ <input type='image'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/invalid-ref-2.html b/layout/reftests/css-submit-invalid/input-image/invalid-ref-2.html
new file mode 100644
index 0000000000..dd03dc812f
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/invalid-ref-2.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <form>
+ <input type='email' value='foo'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/invalid-ref-3.html b/layout/reftests/css-submit-invalid/input-image/invalid-ref-3.html
new file mode 100644
index 0000000000..8a82bdafaa
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/invalid-ref-3.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <table id='t'>
+ <tr><td><input required></td></tr>
+ <tr><td><input type='image'></td></tr>
+ </table>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/invalid-ref.html b/layout/reftests/css-submit-invalid/input-image/invalid-ref.html
new file mode 100644
index 0000000000..76d80f6fa4
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/invalid-ref.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <form>
+ <input required>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/reftest.list b/layout/reftests/css-submit-invalid/input-image/reftest.list
new file mode 100644
index 0000000000..cfb8df94e4
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/reftest.list
@@ -0,0 +1,16 @@
+== static-valid.html valid-ref.html
+== dynamic-valid.html valid-ref.html
+== static-invalid.html invalid-ref.html
+== dynamic-invalid.html invalid-ref.html
+== dynamic-invalid-barred.html invalid-barred-ref.html
+== dynamic-invalid-barred-2.html invalid-barred-ref.html
+== dynamic-invalid-not-barred.html invalid-ref.html
+== static-invalid-barred.html invalid-barred-ref.html
+== remove-invalid-element.html valid-ref-2.html
+== add-invalid-element.html invalid-ref-2.html
+== add-submit-control.html invalid-ref.html
+== remove-submit-control.html valid-ref-3.html
+== change-type-submit-control.html invalid-ref.html
+== change-type-not-submit-control.html valid-ref-4.html
+== self-invalid.html about:blank
+== remove-form.html invalid-ref-3.html
diff --git a/layout/reftests/css-submit-invalid/input-image/remove-form.html b/layout/reftests/css-submit-invalid/input-image/remove-form.html
new file mode 100644
index 0000000000..628694b8af
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/remove-form.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('t').removeChild(document.forms[0]);
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <table id='t'>
+ <form>
+ <tr><td><input required></td></tr>
+ <tr><td><input type='image'></td></tr>
+ </form>
+ </table>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/remove-invalid-element.html b/layout/reftests/css-submit-invalid/input-image/remove-invalid-element.html
new file mode 100644
index 0000000000..643fd0da87
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/remove-invalid-element.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.forms[0].removeChild(document.getElementById('i'));
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input id='i' type='email' value='foo'>
+ <input type='image'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/remove-submit-control.html b/layout/reftests/css-submit-invalid/input-image/remove-submit-control.html
new file mode 100644
index 0000000000..81e7f0cf08
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/remove-submit-control.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.body.appendChild(document.getElementById('i'));
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input required>
+ <input id='i' type='image'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/self-invalid.html b/layout/reftests/css-submit-invalid/input-image/self-invalid.html
new file mode 100644
index 0000000000..76d7a4626d
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/self-invalid.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('i').setCustomValidity('foo');
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input id='i' type='image'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/static-invalid-barred.html b/layout/reftests/css-submit-invalid/input-image/static-invalid-barred.html
new file mode 100644
index 0000000000..b4d68cc260
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/static-invalid-barred.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <body>
+ <form>
+ <input required readonly>
+ <input type='image'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/static-invalid.html b/layout/reftests/css-submit-invalid/input-image/static-invalid.html
new file mode 100644
index 0000000000..5bf007b74a
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/static-invalid.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <body>
+ <form>
+ <input required>
+ <input type='image'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/static-valid.html b/layout/reftests/css-submit-invalid/input-image/static-valid.html
new file mode 100644
index 0000000000..fea6dd8ae3
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/static-valid.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <body>
+ <form>
+ <input value='foo' required>
+ <input type='image'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/valid-ref-2.html b/layout/reftests/css-submit-invalid/input-image/valid-ref-2.html
new file mode 100644
index 0000000000..56c903dc4d
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/valid-ref-2.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <form>
+ <input type='image'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/valid-ref-3.html b/layout/reftests/css-submit-invalid/input-image/valid-ref-3.html
new file mode 100644
index 0000000000..91bf77cc83
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/valid-ref-3.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <form>
+ <input required>
+ </form>
+ <input type='image'>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/valid-ref-4.html b/layout/reftests/css-submit-invalid/input-image/valid-ref-4.html
new file mode 100644
index 0000000000..df70b8f346
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/valid-ref-4.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <form>
+ <input required>
+ <input>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-image/valid-ref.html b/layout/reftests/css-submit-invalid/input-image/valid-ref.html
new file mode 100644
index 0000000000..634a8c7efa
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-image/valid-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <form>
+ <input value='foo' required>
+ <input type='image'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/add-invalid-element.html b/layout/reftests/css-submit-invalid/input-submit/add-invalid-element.html
new file mode 100644
index 0000000000..2c15539146
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/add-invalid-element.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.forms[0].appendChild(document.getElementById('i'));
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <input id='i' type='email' value='foo'>
+ <form>
+ <input type='submit'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/add-submit-control.html b/layout/reftests/css-submit-invalid/input-submit/add-submit-control.html
new file mode 100644
index 0000000000..ca50270dbd
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/add-submit-control.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.forms[0].appendChild(document.getElementById('i'));
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <input id='i' type='submit'>
+ <form>
+ <input required>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/change-type-not-submit-control.html b/layout/reftests/css-submit-invalid/input-submit/change-type-not-submit-control.html
new file mode 100644
index 0000000000..d1a2f34388
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/change-type-not-submit-control.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('i').type = 'text';
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input required>
+ <input id='i' type='submit'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/change-type-submit-control.html b/layout/reftests/css-submit-invalid/input-submit/change-type-submit-control.html
new file mode 100644
index 0000000000..5ce8dd7f77
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/change-type-submit-control.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('i').type = 'submit';
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input required>
+ <input id='i'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/dynamic-invalid-barred-2.html b/layout/reftests/css-submit-invalid/input-submit/dynamic-invalid-barred-2.html
new file mode 100644
index 0000000000..6768e71d01
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/dynamic-invalid-barred-2.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('i').value = '';
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input id='i' value='foo' required readonly>
+ <input type='submit'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/dynamic-invalid-barred.html b/layout/reftests/css-submit-invalid/input-submit/dynamic-invalid-barred.html
new file mode 100644
index 0000000000..327bbb200c
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/dynamic-invalid-barred.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('i').readOnly = 'ro';
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input id='i' required>
+ <input type='submit'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/dynamic-invalid-not-barred.html b/layout/reftests/css-submit-invalid/input-submit/dynamic-invalid-not-barred.html
new file mode 100644
index 0000000000..8c0eb90788
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/dynamic-invalid-not-barred.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('i').removeAttribute('readonly');
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input id='i' required readonly>
+ <input type='submit'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/dynamic-invalid.html b/layout/reftests/css-submit-invalid/input-submit/dynamic-invalid.html
new file mode 100644
index 0000000000..53aa64a2bd
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/dynamic-invalid.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ :-moz-ui-invalid { box-shadow: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('i').value = '';
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input id='i' value='foo' required>
+ <input type='submit'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/dynamic-valid.html b/layout/reftests/css-submit-invalid/input-submit/dynamic-valid.html
new file mode 100644
index 0000000000..1151e7bb70
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/dynamic-valid.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('i').value = 'foo';
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input id='i' required>
+ <input type='submit'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/invalid-barred-ref.html b/layout/reftests/css-submit-invalid/input-submit/invalid-barred-ref.html
new file mode 100644
index 0000000000..ff532c8193
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/invalid-barred-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <form>
+ <input required readonly>
+ <input type='submit'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/invalid-ref-2.html b/layout/reftests/css-submit-invalid/input-submit/invalid-ref-2.html
new file mode 100644
index 0000000000..dd03dc812f
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/invalid-ref-2.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <form>
+ <input type='email' value='foo'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/invalid-ref-3.html b/layout/reftests/css-submit-invalid/input-submit/invalid-ref-3.html
new file mode 100644
index 0000000000..ec4cbc4e94
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/invalid-ref-3.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <table id='t'>
+ <tr><td><input required></td></tr>
+ <tr><td><input type='submit'></td></tr>
+ </table>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/invalid-ref.html b/layout/reftests/css-submit-invalid/input-submit/invalid-ref.html
new file mode 100644
index 0000000000..76d80f6fa4
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/invalid-ref.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <form>
+ <input required>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/reftest.list b/layout/reftests/css-submit-invalid/input-submit/reftest.list
new file mode 100644
index 0000000000..cfb8df94e4
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/reftest.list
@@ -0,0 +1,16 @@
+== static-valid.html valid-ref.html
+== dynamic-valid.html valid-ref.html
+== static-invalid.html invalid-ref.html
+== dynamic-invalid.html invalid-ref.html
+== dynamic-invalid-barred.html invalid-barred-ref.html
+== dynamic-invalid-barred-2.html invalid-barred-ref.html
+== dynamic-invalid-not-barred.html invalid-ref.html
+== static-invalid-barred.html invalid-barred-ref.html
+== remove-invalid-element.html valid-ref-2.html
+== add-invalid-element.html invalid-ref-2.html
+== add-submit-control.html invalid-ref.html
+== remove-submit-control.html valid-ref-3.html
+== change-type-submit-control.html invalid-ref.html
+== change-type-not-submit-control.html valid-ref-4.html
+== self-invalid.html about:blank
+== remove-form.html invalid-ref-3.html
diff --git a/layout/reftests/css-submit-invalid/input-submit/remove-form.html b/layout/reftests/css-submit-invalid/input-submit/remove-form.html
new file mode 100644
index 0000000000..e33e79c59b
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/remove-form.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('t').removeChild(document.forms[0]);
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <table id='t'>
+ <form>
+ <tr><td><input required></td></tr>
+ <tr><td><input type='submit'></td></tr>
+ </form>
+ </table>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/remove-invalid-element.html b/layout/reftests/css-submit-invalid/input-submit/remove-invalid-element.html
new file mode 100644
index 0000000000..0e40a76e03
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/remove-invalid-element.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.forms[0].removeChild(document.getElementById('i'));
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input id='i' type='email' value='foo'>
+ <input type='submit'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/remove-submit-control.html b/layout/reftests/css-submit-invalid/input-submit/remove-submit-control.html
new file mode 100644
index 0000000000..7c7a0da057
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/remove-submit-control.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.body.appendChild(document.getElementById('i'));
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input required>
+ <input id='i' type='submit'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/self-invalid.html b/layout/reftests/css-submit-invalid/input-submit/self-invalid.html
new file mode 100644
index 0000000000..94d45217bc
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/self-invalid.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <head>
+ <style>
+ :invalid { display: none; }
+ </style>
+ </head>
+ <script>
+ function onloadHandler()
+ {
+ document.getElementById('i').setCustomValidity('foo');
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload='onloadHandler();'>
+ <form>
+ <input id='i' type='submit'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/static-invalid-barred.html b/layout/reftests/css-submit-invalid/input-submit/static-invalid-barred.html
new file mode 100644
index 0000000000..cc0b1c24a4
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/static-invalid-barred.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <body>
+ <form>
+ <input required readonly>
+ <input type='submit'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/static-invalid.html b/layout/reftests/css-submit-invalid/input-submit/static-invalid.html
new file mode 100644
index 0000000000..84c47cce6f
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/static-invalid.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <body>
+ <form>
+ <input required>
+ <input type='submit'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/static-valid.html b/layout/reftests/css-submit-invalid/input-submit/static-valid.html
new file mode 100644
index 0000000000..6401eb893a
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/static-valid.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ :-moz-submit-invalid { display: none; }
+ </style>
+ </head>
+ <body>
+ <form>
+ <input value='foo' required>
+ <input type='submit'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/valid-ref-2.html b/layout/reftests/css-submit-invalid/input-submit/valid-ref-2.html
new file mode 100644
index 0000000000..81ccd0610f
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/valid-ref-2.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <form>
+ <input type='submit'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/valid-ref-3.html b/layout/reftests/css-submit-invalid/input-submit/valid-ref-3.html
new file mode 100644
index 0000000000..ac162eaa41
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/valid-ref-3.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <form>
+ <input required>
+ </form>
+ <input type='submit'>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/valid-ref-4.html b/layout/reftests/css-submit-invalid/input-submit/valid-ref-4.html
new file mode 100644
index 0000000000..df70b8f346
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/valid-ref-4.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <form>
+ <input required>
+ <input>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/input-submit/valid-ref.html b/layout/reftests/css-submit-invalid/input-submit/valid-ref.html
new file mode 100644
index 0000000000..b8b5466dda
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/input-submit/valid-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <form>
+ <input value='foo' required>
+ <input type='submit'>
+ </form>
+ </body>
+</html>
diff --git a/layout/reftests/css-submit-invalid/reftest.list b/layout/reftests/css-submit-invalid/reftest.list
new file mode 100644
index 0000000000..5dd28ba916
--- /dev/null
+++ b/layout/reftests/css-submit-invalid/reftest.list
@@ -0,0 +1,4 @@
+include button-submit/reftest.list
+include input-image/reftest.list
+include input-submit/reftest.list
+include default-style/reftest.list