summaryrefslogtreecommitdiffstats
path: root/layout/reftests/css-ui-invalid/input
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
commit0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch)
treea31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /layout/reftests/css-ui-invalid/input
parentInitial commit. (diff)
downloadfirefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz
firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/css-ui-invalid/input')
-rw-r--r--layout/reftests/css-ui-invalid/input/input-button-ref.html6
-rw-r--r--layout/reftests/css-ui-invalid/input/input-button.html9
-rw-r--r--layout/reftests/css-ui-invalid/input/input-checkbox-required-invalid-changed.html16
-rw-r--r--layout/reftests/css-ui-invalid/input/input-checkbox-required-invalid-default.html15
-rw-r--r--layout/reftests/css-ui-invalid/input/input-customerror.html18
-rw-r--r--layout/reftests/css-ui-invalid/input/input-disabled-fieldset-1.html14
-rw-r--r--layout/reftests/css-ui-invalid/input/input-disabled-fieldset-2.html23
-rw-r--r--layout/reftests/css-ui-invalid/input/input-disabled.html9
-rw-r--r--layout/reftests/css-ui-invalid/input/input-dyn-disabled.html18
-rw-r--r--layout/reftests/css-ui-invalid/input/input-dyn-not-disabled.html19
-rw-r--r--layout/reftests/css-ui-invalid/input/input-dyn-not-readonly-changed.html11
-rw-r--r--layout/reftests/css-ui-invalid/input/input-dyn-not-readonly-not-changed.html9
-rw-r--r--layout/reftests/css-ui-invalid/input/input-dyn-readonly.html9
-rw-r--r--layout/reftests/css-ui-invalid/input/input-email-invalid-changed.html11
-rw-r--r--layout/reftests/css-ui-invalid/input/input-email-invalid-default.html10
-rw-r--r--layout/reftests/css-ui-invalid/input/input-email-ref.html6
-rw-r--r--layout/reftests/css-ui-invalid/input/input-email-valid.html10
-rw-r--r--layout/reftests/css-ui-invalid/input/input-fieldset-legend-ref.html10
-rw-r--r--layout/reftests/css-ui-invalid/input/input-fieldset-legend.html13
-rw-r--r--layout/reftests/css-ui-invalid/input/input-fieldset-ref.html10
-rw-r--r--layout/reftests/css-ui-invalid/input/input-file-ref.html6
-rw-r--r--layout/reftests/css-ui-invalid/input/input-file-required-invalid-changed.html11
-rw-r--r--layout/reftests/css-ui-invalid/input/input-file-required-invalid-default.html10
-rw-r--r--layout/reftests/css-ui-invalid/input/input-pattern-invalid-changed.html12
-rw-r--r--layout/reftests/css-ui-invalid/input/input-pattern-invalid-default.html11
-rw-r--r--layout/reftests/css-ui-invalid/input/input-pattern-valid.html10
-rw-r--r--layout/reftests/css-ui-invalid/input/input-radio-customerror.html18
-rw-r--r--layout/reftests/css-ui-invalid/input/input-radio-dyn-valid-1.html17
-rw-r--r--layout/reftests/css-ui-invalid/input/input-radio-dyn-valid-2.html18
-rw-r--r--layout/reftests/css-ui-invalid/input/input-radio-nogroup-required-invalid.html13
-rw-r--r--layout/reftests/css-ui-invalid/input/input-radio-nogroup-required-valid.html13
-rw-r--r--layout/reftests/css-ui-invalid/input/input-radio-required-invalid-changed.html16
-rw-r--r--layout/reftests/css-ui-invalid/input/input-radio-required-invalid-default.html15
-rw-r--r--layout/reftests/css-ui-invalid/input/input-radio-required.html18
-rw-r--r--layout/reftests/css-ui-invalid/input/input-readonly.html9
-rw-r--r--layout/reftests/css-ui-invalid/input/input-ref.html6
-rw-r--r--layout/reftests/css-ui-invalid/input/input-required-invalid-changed.html11
-rw-r--r--layout/reftests/css-ui-invalid/input/input-required-invalid-default.html11
-rw-r--r--layout/reftests/css-ui-invalid/input/input-required-valid.html10
-rw-r--r--layout/reftests/css-ui-invalid/input/input-reset.html10
-rw-r--r--layout/reftests/css-ui-invalid/input/input-type-barred.html10
-rw-r--r--layout/reftests/css-ui-invalid/input/input-type-invalid.html20
-rw-r--r--layout/reftests/css-ui-invalid/input/input-url-invalid-changed.html12
-rw-r--r--layout/reftests/css-ui-invalid/input/input-url-invalid-default.html11
-rw-r--r--layout/reftests/css-ui-invalid/input/input-url-ref.html6
-rw-r--r--layout/reftests/css-ui-invalid/input/input-url-valid.html10
-rw-r--r--layout/reftests/css-ui-invalid/input/input-valid.html9
-rw-r--r--layout/reftests/css-ui-invalid/input/input-withtext-ref.html6
-rw-r--r--layout/reftests/css-ui-invalid/input/reftest.list41
-rw-r--r--layout/reftests/css-ui-invalid/input/style.css23
-rw-r--r--layout/reftests/css-ui-invalid/input/success-ref.html6
51 files changed, 645 insertions, 0 deletions
diff --git a/layout/reftests/css-ui-invalid/input/input-button-ref.html b/layout/reftests/css-ui-invalid/input/input-button-ref.html
new file mode 100644
index 0000000000..3b828533e3
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/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-ui-invalid/input/input-button.html b/layout/reftests/css-ui-invalid/input/input-button.html
new file mode 100644
index 0000000000..1ec43cc1e7
--- /dev/null
+++ b/layout/reftests/css-ui-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 :-moz-ui-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-ui-invalid/input/input-checkbox-required-invalid-changed.html b/layout/reftests/css-ui-invalid/input/input-checkbox-required-invalid-changed.html
new file mode 100644
index 0000000000..1ad7860629
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-checkbox-required-invalid-changed.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ and its checkedness has changed,
+ it should be affected by :-moz-ui-invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').checked = false;
+ if (!document.getElementById('i').matches(':-moz-ui-invalid')) {
+ document.body.textContent='FAIL';
+ } else {
+ document.body.textContent='SUCCESS';
+ }
+ document.documentElement.className='';">
+ <input id='i' type='checkbox' required>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-invalid/input/input-checkbox-required-invalid-default.html b/layout/reftests/css-ui-invalid/input/input-checkbox-required-invalid-default.html
new file mode 100644
index 0000000000..ee01e0d381
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-checkbox-required-invalid-default.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ and its checkedness hasn't changed,
+ it should not be affected by :-moz-ui-invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="if (document.getElementById('i').matches(':-moz-ui-invalid')) {
+ document.body.textContent='FAIL';
+ } else {
+ document.body.textContent='SUCCESS';
+ }
+ document.documentElement.className='';">
+ <input id='i' type='checkbox' required>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-invalid/input/input-customerror.html b/layout/reftests/css-ui-invalid/input/input-customerror.html
new file mode 100644
index 0000000000..55b58ace60
--- /dev/null
+++ b/layout/reftests/css-ui-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 :-moz-ui-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-ui-invalid/input/input-disabled-fieldset-1.html b/layout/reftests/css-ui-invalid/input/input-disabled-fieldset-1.html
new file mode 100644
index 0000000000..7fbc040c90
--- /dev/null
+++ b/layout/reftests/css-ui-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 :-moz-ui-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-ui-invalid/input/input-disabled-fieldset-2.html b/layout/reftests/css-ui-invalid/input/input-disabled-fieldset-2.html
new file mode 100644
index 0000000000..4cda694575
--- /dev/null
+++ b/layout/reftests/css-ui-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 :-moz-ui-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-ui-invalid/input/input-disabled.html b/layout/reftests/css-ui-invalid/input/input-disabled.html
new file mode 100644
index 0000000000..6757fb0963
--- /dev/null
+++ b/layout/reftests/css-ui-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 :-moz-ui-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-ui-invalid/input/input-dyn-disabled.html b/layout/reftests/css-ui-invalid/input/input-dyn-disabled.html
new file mode 100644
index 0000000000..f2094b48bb
--- /dev/null
+++ b/layout/reftests/css-ui-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 :-moz-ui-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-ui-invalid/input/input-dyn-not-disabled.html b/layout/reftests/css-ui-invalid/input/input-dyn-not-disabled.html
new file mode 100644
index 0000000000..cff1501a46
--- /dev/null
+++ b/layout/reftests/css-ui-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 :-moz-ui-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-ui-invalid/input/input-dyn-not-readonly-changed.html b/layout/reftests/css-ui-invalid/input/input-dyn-not-readonly-changed.html
new file mode 100644
index 0000000000..e9686e98f7
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-dyn-not-readonly-changed.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input is no longer readonly, invalid and has it's value changed,
+ it's affected by :-moz-ui-invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').removeAttribute('readonly');
+ document.getElementById('i').value = '';
+ document.documentElement.className='';">
+ <input class='invalid' id='i' readonly required>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-invalid/input/input-dyn-not-readonly-not-changed.html b/layout/reftests/css-ui-invalid/input/input-dyn-not-readonly-not-changed.html
new file mode 100644
index 0000000000..b697b4200d
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-dyn-not-readonly-not-changed.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input is no longer readonly and invalid but it's value hasn't
+ changed, it's affected by :-moz-ui-invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').removeAttribute('readonly'); document.documentElement.className='';">
+ <input class='notinvalid' id='i' readonly required>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-invalid/input/input-dyn-readonly.html b/layout/reftests/css-ui-invalid/input/input-dyn-readonly.html
new file mode 100644
index 0000000000..474e8ff4b8
--- /dev/null
+++ b/layout/reftests/css-ui-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 :-moz-ui-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-ui-invalid/input/input-email-invalid-changed.html b/layout/reftests/css-ui-invalid/input/input-email-invalid-changed.html
new file mode 100644
index 0000000000..87f4568eaa
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-email-invalid-changed.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ and its value has changed,
+ it should be affected by :-moz-ui-invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').value = 'foo';
+ document.documentElement.className='';">
+ <input id='i' class='invalid' type='email' value='bar'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-invalid/input/input-email-invalid-default.html b/layout/reftests/css-ui-invalid/input/input-email-invalid-default.html
new file mode 100644
index 0000000000..d4a1c99bb5
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-email-invalid-default.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ but its default value hasn't been changed,
+ it should not be affected by :-moz-ui-invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notinvalid' type='email' value='foo'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-invalid/input/input-email-ref.html b/layout/reftests/css-ui-invalid/input/input-email-ref.html
new file mode 100644
index 0000000000..ecec613c26
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/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-ui-invalid/input/input-email-valid.html b/layout/reftests/css-ui-invalid/input/input-email-valid.html
new file mode 100644
index 0000000000..8e3fbd349e
--- /dev/null
+++ b/layout/reftests/css-ui-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 :-moz-ui-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-ui-invalid/input/input-fieldset-legend-ref.html b/layout/reftests/css-ui-invalid/input/input-fieldset-legend-ref.html
new file mode 100644
index 0000000000..763c383bda
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-fieldset-legend-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <fieldset>
+ <legend>
+ <input style="background-color: green;">
+ </legend>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-invalid/input/input-fieldset-legend.html b/layout/reftests/css-ui-invalid/input/input-fieldset-legend.html
new file mode 100644
index 0000000000..6f85637b4a
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-fieldset-legend.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is invalid but it's value hasn't changed, it's not
+ affected by :-moz-ui-invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <fieldset disabled>
+ <legend>
+ <input class='notinvalid' required>
+ </legend>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-invalid/input/input-fieldset-ref.html b/layout/reftests/css-ui-invalid/input/input-fieldset-ref.html
new file mode 100644
index 0000000000..a9e1239125
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/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-ui-invalid/input/input-file-ref.html b/layout/reftests/css-ui-invalid/input/input-file-ref.html
new file mode 100644
index 0000000000..73a4fc64cc
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-file-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input type='file' style="background-color: green;">
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-invalid/input/input-file-required-invalid-changed.html b/layout/reftests/css-ui-invalid/input/input-file-required-invalid-changed.html
new file mode 100644
index 0000000000..960b01b422
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-file-required-invalid-changed.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ but its default value hasn't been changed,
+ it should not be affected by :-moz-ui-invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').value='';
+ document.documentElement.className='';">
+ <input id='i' class='invalid' type='file' required>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-invalid/input/input-file-required-invalid-default.html b/layout/reftests/css-ui-invalid/input/input-file-required-invalid-default.html
new file mode 100644
index 0000000000..aa1d862d40
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-file-required-invalid-default.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ but its default value hasn't been changed,
+ it should not be affected by :-moz-ui-invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notinvalid' type='file' required>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-invalid/input/input-pattern-invalid-changed.html b/layout/reftests/css-ui-invalid/input/input-pattern-invalid-changed.html
new file mode 100644
index 0000000000..9973157700
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-pattern-invalid-changed.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ and its value isn't the default value,
+ it should be affected by :-moz-ui-invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').value='foo';
+ document.documentElement.className='';">
+ <input id='i' class='invalid' pattern='bar' value='f'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-ui-invalid/input/input-pattern-invalid-default.html b/layout/reftests/css-ui-invalid/input/input-pattern-invalid-default.html
new file mode 100644
index 0000000000..0a1a676a8c
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-pattern-invalid-default.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ but its value is stil lthe default value,
+ it should not be affected by :-moz-ui-invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notinvalid' pattern='bar' value='foo'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-ui-invalid/input/input-pattern-valid.html b/layout/reftests/css-ui-invalid/input/input-pattern-valid.html
new file mode 100644
index 0000000000..7def28f819
--- /dev/null
+++ b/layout/reftests/css-ui-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 :-moz-ui-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-ui-invalid/input/input-radio-customerror.html b/layout/reftests/css-ui-invalid/input/input-radio-customerror.html
new file mode 100644
index 0000000000..c797243a24
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-radio-customerror.html
@@ -0,0 +1,18 @@
+<!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').checked = false;
+ document.getElementById('i1').setCustomValidity('foo');
+ if (!document.getElementById('i1').matches(':-moz-ui-invalid') ||
+ document.getElementById('i2').matches(':-moz-ui-invalid')) {
+ 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-ui-invalid/input/input-radio-dyn-valid-1.html b/layout/reftests/css-ui-invalid/input/input-radio-dyn-valid-1.html
new file mode 100644
index 0000000000..d2fd008e15
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-radio-dyn-valid-1.html
@@ -0,0 +1,17 @@
+<!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;
+ if (document.getElementById('i1').matches(':-moz-ui-invalid') ||
+ document.getElementById('i2').matches(':-moz-ui-invalid')) {
+ 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-ui-invalid/input/input-radio-dyn-valid-2.html b/layout/reftests/css-ui-invalid/input/input-radio-dyn-valid-2.html
new file mode 100644
index 0000000000..f4ee5d171c
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-radio-dyn-valid-2.html
@@ -0,0 +1,18 @@
+<!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.getElementById('i1').required = false;
+ if (document.getElementById('i1').matches(':-moz-ui-invalid') ||
+ document.getElementById('i2').matches(':-moz-ui-invalid')) {
+ 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-ui-invalid/input/input-radio-nogroup-required-invalid.html b/layout/reftests/css-ui-invalid/input/input-radio-nogroup-required-invalid.html
new file mode 100644
index 0000000000..e17e92a958
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-radio-nogroup-required-invalid.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').checked = true;
+ if (document.getElementById('i').matches(':-moz-ui-invalid')) {
+ document.body.textContent='FAIL';
+ } else {
+ document.body.textContent='SUCCESS';
+ }
+ document.documentElement.className='';">
+ <input id='i' type='radio' required name='i'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-invalid/input/input-radio-nogroup-required-valid.html b/layout/reftests/css-ui-invalid/input/input-radio-nogroup-required-valid.html
new file mode 100644
index 0000000000..a3a173d0ab
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-radio-nogroup-required-valid.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').checked = false;
+ if (!document.getElementById('i').matches(':-moz-ui-invalid')) {
+ document.body.textContent='FAIL';
+ } else {
+ document.body.textContent='SUCCESS';
+ }
+ document.documentElement.className='';">
+ <input id='i' type='radio' required name='i'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-invalid/input/input-radio-required-invalid-changed.html b/layout/reftests/css-ui-invalid/input/input-radio-required-invalid-changed.html
new file mode 100644
index 0000000000..b58950c68c
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-radio-required-invalid-changed.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ and its checkedness has changed,
+ it should be affected by :-moz-ui-invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').checked = false;
+ if (!document.getElementById('i').matches(':-moz-ui-invalid')) {
+ document.body.textContent='FAIL';
+ } else {
+ document.body.textContent='SUCCESS';
+ }
+ document.documentElement.className='';">
+ <input id='i' type='radio' required name='i'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-invalid/input/input-radio-required-invalid-default.html b/layout/reftests/css-ui-invalid/input/input-radio-required-invalid-default.html
new file mode 100644
index 0000000000..cb2456533f
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-radio-required-invalid-default.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ and its checkedness hasn't changed,
+ it should not be affected by :-moz-ui-invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="if (document.getElementById('i').matches(':-moz-ui-invalid')) {
+ 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-ui-invalid/input/input-radio-required.html b/layout/reftests/css-ui-invalid/input/input-radio-required.html
new file mode 100644
index 0000000000..04b94997e8
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-radio-required.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if one radio in a group has the required attribute and no radio is
+ checked, all radio in the group should have :-moz-ui-invalid
+ pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i1').checked = false;
+ if (!document.getElementById('i1').matches(':-moz-ui-invalid') ||
+ !document.getElementById('i2').matches(':-moz-ui-invalid')) {
+ 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-ui-invalid/input/input-readonly.html b/layout/reftests/css-ui-invalid/input/input-readonly.html
new file mode 100644
index 0000000000..8f5ab0c3c9
--- /dev/null
+++ b/layout/reftests/css-ui-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 :-moz-ui-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-ui-invalid/input/input-ref.html b/layout/reftests/css-ui-invalid/input/input-ref.html
new file mode 100644
index 0000000000..65b4b97078
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/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-ui-invalid/input/input-required-invalid-changed.html b/layout/reftests/css-ui-invalid/input/input-required-invalid-changed.html
new file mode 100644
index 0000000000..64927141f7
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-required-invalid-changed.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ it should be affected by :-moz-ui-invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').value='';
+ document.documentElement.className='';">
+ <input id='i' class='invalid' required>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-ui-invalid/input/input-required-invalid-default.html b/layout/reftests/css-ui-invalid/input/input-required-invalid-default.html
new file mode 100644
index 0000000000..3d4e17aea9
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-required-invalid-default.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ but its value is still the default value,
+ it should not be affected by :-moz-ui-invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notinvalid' required>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-ui-invalid/input/input-required-valid.html b/layout/reftests/css-ui-invalid/input/input-required-valid.html
new file mode 100644
index 0000000000..34dca4585b
--- /dev/null
+++ b/layout/reftests/css-ui-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 :-moz-ui-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-ui-invalid/input/input-reset.html b/layout/reftests/css-ui-invalid/input/input-reset.html
new file mode 100644
index 0000000000..06092d45cf
--- /dev/null
+++ b/layout/reftests/css-ui-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 :-moz-ui-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-ui-invalid/input/input-type-barred.html b/layout/reftests/css-ui-invalid/input/input-type-barred.html
new file mode 100644
index 0000000000..145b114d6f
--- /dev/null
+++ b/layout/reftests/css-ui-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 :-moz-ui-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-ui-invalid/input/input-type-invalid.html b/layout/reftests/css-ui-invalid/input/input-type-invalid.html
new file mode 100644
index 0000000000..537c877c06
--- /dev/null
+++ b/layout/reftests/css-ui-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-ui-invalid/input/input-url-invalid-changed.html b/layout/reftests/css-ui-invalid/input/input-url-invalid-changed.html
new file mode 100644
index 0000000000..f00b5acbd7
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-url-invalid-changed.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ and its value is not the default value,
+ it should be affected by :-moz-ui-invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').value='foo';
+ document.documentElement.className='';">
+ <input id='i' class='invalid' type='url'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-ui-invalid/input/input-url-invalid-default.html b/layout/reftests/css-ui-invalid/input/input-url-invalid-default.html
new file mode 100644
index 0000000000..2ce04568a1
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/input-url-invalid-default.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ but its value is the default value,
+ it should not be affected by :-moz-ui-invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notinvalid' type='url' value='foo'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-ui-invalid/input/input-url-ref.html b/layout/reftests/css-ui-invalid/input/input-url-ref.html
new file mode 100644
index 0000000000..e95cdbca2e
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/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-ui-invalid/input/input-url-valid.html b/layout/reftests/css-ui-invalid/input/input-url-valid.html
new file mode 100644
index 0000000000..8b615a7709
--- /dev/null
+++ b/layout/reftests/css-ui-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 :-moz-ui-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-ui-invalid/input/input-valid.html b/layout/reftests/css-ui-invalid/input/input-valid.html
new file mode 100644
index 0000000000..a8b4157a80
--- /dev/null
+++ b/layout/reftests/css-ui-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 :-moz-ui-invalid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notinvalid'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-invalid/input/input-withtext-ref.html b/layout/reftests/css-ui-invalid/input/input-withtext-ref.html
new file mode 100644
index 0000000000..d54d052157
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/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-ui-invalid/input/reftest.list b/layout/reftests/css-ui-invalid/input/reftest.list
new file mode 100644
index 0000000000..43e3495433
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/reftest.list
@@ -0,0 +1,41 @@
+== input-valid.html input-ref.html
+fuzzy(0-64,0-4) == input-customerror.html input-ref.html
+fuzzy(0-1,0-3) == input-disabled.html input-ref.html
+fuzzy(0-1,0-3) == input-dyn-disabled.html input-ref.html
+fuzzy(0-1,0-3) == input-dyn-not-disabled.html input-ref.html
+fuzzy(0-1,0-3) == input-readonly.html input-ref.html
+fuzzy(0-1,0-3) == input-dyn-readonly.html input-ref.html
+fuzzy(0-1,0-3) == input-dyn-not-readonly-not-changed.html input-ref.html
+fuzzy(0-1,0-3) == input-dyn-not-readonly-changed.html input-ref.html
+== input-required-valid.html input-withtext-ref.html
+fuzzy(0-1,0-3) == input-required-invalid-default.html input-ref.html
+fuzzy(0-1,0-3) == input-required-invalid-changed.html input-ref.html
+fuzzy(0-2,0-5) == input-button.html input-button-ref.html
+fuzzy(0-2,0-5) == input-reset.html input-button-ref.html
+== input-email-invalid-default.html input-withtext-ref.html
+== input-email-invalid-changed.html input-withtext-ref.html
+fuzzy(0-2,0-5) == input-email-valid.html input-email-ref.html
+== input-url-invalid-changed.html input-withtext-ref.html
+== input-url-invalid-default.html input-withtext-ref.html
+== input-url-valid.html input-url-ref.html
+== input-pattern-valid.html input-withtext-ref.html
+== input-pattern-invalid-default.html input-withtext-ref.html
+== input-pattern-invalid-changed.html input-withtext-ref.html
+fuzzy(0-2,0-5) == input-type-barred.html input-button-ref.html
+fuzzy(0-64,0-4) == input-type-invalid.html input-ref.html
+== input-disabled-fieldset-1.html input-fieldset-ref.html
+fuzzy(0-1,0-3) == input-disabled-fieldset-2.html input-fieldset-ref.html
+fuzzy(0-1,0-3) == input-fieldset-legend.html input-fieldset-legend-ref.html
+== input-checkbox-required-invalid-changed.html success-ref.html
+== input-checkbox-required-invalid-default.html success-ref.html
+== input-radio-required-invalid-changed.html success-ref.html
+== input-radio-required-invalid-default.html success-ref.html
+== input-file-required-invalid-changed.html input-file-ref.html
+== input-file-required-invalid-default.html input-file-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 type='hidden' shouldn't show
diff --git a/layout/reftests/css-ui-invalid/input/style.css b/layout/reftests/css-ui-invalid/input/style.css
new file mode 100644
index 0000000000..93a61a020d
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/style.css
@@ -0,0 +1,23 @@
+/* Override default style */
+input:-moz-ui-invalid {
+ box-shadow: none;
+}
+
+input.notinvalid {
+ background-color: green;
+}
+input.notinvalid:-moz-ui-invalid {
+ background-color: red;
+}
+
+input.invalid {
+ background-color: red;
+}
+input.invalid:-moz-ui-invalid {
+ background-color: green;
+}
+
+input[type=checkbox],
+input[type=radio] {
+ display: none;
+}
diff --git a/layout/reftests/css-ui-invalid/input/success-ref.html b/layout/reftests/css-ui-invalid/input/success-ref.html
new file mode 100644
index 0000000000..bfa8e0a12c
--- /dev/null
+++ b/layout/reftests/css-ui-invalid/input/success-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ SUCCESS
+ </body>
+</html>