summaryrefslogtreecommitdiffstats
path: root/layout/reftests/css-ui-valid/input
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /layout/reftests/css-ui-valid/input
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/css-ui-valid/input')
-rw-r--r--layout/reftests/css-ui-valid/input/input-button-ref.html6
-rw-r--r--layout/reftests/css-ui-valid/input/input-button.html9
-rw-r--r--layout/reftests/css-ui-valid/input/input-checkbox-valid-changed.html15
-rw-r--r--layout/reftests/css-ui-valid/input/input-checkbox-valid-default.html14
-rw-r--r--layout/reftests/css-ui-valid/input/input-customerror.html18
-rw-r--r--layout/reftests/css-ui-valid/input/input-disabled-fieldset-1.html14
-rw-r--r--layout/reftests/css-ui-valid/input/input-disabled-fieldset-2.html23
-rw-r--r--layout/reftests/css-ui-valid/input/input-disabled.html9
-rw-r--r--layout/reftests/css-ui-valid/input/input-dyn-disabled.html9
-rw-r--r--layout/reftests/css-ui-valid/input/input-dyn-not-disabled-changed.html11
-rw-r--r--layout/reftests/css-ui-valid/input/input-dyn-not-disabled.html10
-rw-r--r--layout/reftests/css-ui-valid/input/input-dyn-not-readonly-changed.html11
-rw-r--r--layout/reftests/css-ui-valid/input/input-dyn-not-readonly.html10
-rw-r--r--layout/reftests/css-ui-valid/input/input-dyn-readonly.html9
-rw-r--r--layout/reftests/css-ui-valid/input/input-email-invalid.html10
-rw-r--r--layout/reftests/css-ui-valid/input/input-email-ref.html6
-rw-r--r--layout/reftests/css-ui-valid/input/input-email-valid-changed.html11
-rw-r--r--layout/reftests/css-ui-valid/input/input-email-valid.html10
-rw-r--r--layout/reftests/css-ui-valid/input/input-fieldset-legend-ref.html10
-rw-r--r--layout/reftests/css-ui-valid/input/input-fieldset-legend.html14
-rw-r--r--layout/reftests/css-ui-valid/input/input-fieldset-ref.html10
-rw-r--r--layout/reftests/css-ui-valid/input/input-file-ref.html6
-rw-r--r--layout/reftests/css-ui-valid/input/input-file-valid-changed.html10
-rw-r--r--layout/reftests/css-ui-valid/input/input-file-valid-default.html9
-rw-r--r--layout/reftests/css-ui-valid/input/input-pattern-invalid.html10
-rw-r--r--layout/reftests/css-ui-valid/input/input-pattern-valid-changed.html11
-rw-r--r--layout/reftests/css-ui-valid/input/input-pattern-valid.html10
-rw-r--r--layout/reftests/css-ui-valid/input/input-radio-customerror.html16
-rw-r--r--layout/reftests/css-ui-valid/input/input-radio-dyn-valid-1.html15
-rw-r--r--layout/reftests/css-ui-valid/input/input-radio-dyn-valid-2.html16
-rw-r--r--layout/reftests/css-ui-valid/input/input-radio-nogroup-required-invalid.html13
-rw-r--r--layout/reftests/css-ui-valid/input/input-radio-nogroup-required-valid.html13
-rw-r--r--layout/reftests/css-ui-valid/input/input-radio-required.html15
-rw-r--r--layout/reftests/css-ui-valid/input/input-radio-valid-changed.html15
-rw-r--r--layout/reftests/css-ui-valid/input/input-radio-valid-default.html14
-rw-r--r--layout/reftests/css-ui-valid/input/input-readonly.html9
-rw-r--r--layout/reftests/css-ui-valid/input/input-ref.html6
-rw-r--r--layout/reftests/css-ui-valid/input/input-required-invalid.html10
-rw-r--r--layout/reftests/css-ui-valid/input/input-required-valid-changed.html11
-rw-r--r--layout/reftests/css-ui-valid/input/input-required-valid.html10
-rw-r--r--layout/reftests/css-ui-valid/input/input-reset.html10
-rw-r--r--layout/reftests/css-ui-valid/input/input-type-barred.html10
-rw-r--r--layout/reftests/css-ui-valid/input/input-type-invalid.html20
-rw-r--r--layout/reftests/css-ui-valid/input/input-url-invalid.html10
-rw-r--r--layout/reftests/css-ui-valid/input/input-url-ref.html6
-rw-r--r--layout/reftests/css-ui-valid/input/input-url-valid-changed.html11
-rw-r--r--layout/reftests/css-ui-valid/input/input-url-valid.html10
-rw-r--r--layout/reftests/css-ui-valid/input/input-valid.html9
-rw-r--r--layout/reftests/css-ui-valid/input/input-withtext-ref.html6
-rw-r--r--layout/reftests/css-ui-valid/input/reftest.list40
-rw-r--r--layout/reftests/css-ui-valid/input/style.css18
-rw-r--r--layout/reftests/css-ui-valid/input/success-ref.html6
52 files changed, 614 insertions, 0 deletions
diff --git a/layout/reftests/css-ui-valid/input/input-button-ref.html b/layout/reftests/css-ui-valid/input/input-button-ref.html
new file mode 100644
index 0000000000..3b828533e3
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-button-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input type='button' style="background-color: green;">
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-button.html b/layout/reftests/css-ui-valid/input/input-button.html
new file mode 100644
index 0000000000..75898b5653
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-button.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is of button type, it is barred from constraint validation
+ and should not be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid' type='button'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-checkbox-valid-changed.html b/layout/reftests/css-ui-valid/input/input-checkbox-valid-changed.html
new file mode 100644
index 0000000000..3ba877abb9
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-checkbox-valid-changed.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input is valid and its checkedness has changed,
+ it should be affected by :-moz-ui-valid 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-valid')) {
+ document.body.textContent='FAIL';
+ } else {
+ document.body.textContent='SUCCESS';
+ }
+ document.documentElement.className='';">
+ <input id='i' type='checkbox'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-checkbox-valid-default.html b/layout/reftests/css-ui-valid/input/input-checkbox-valid-default.html
new file mode 100644
index 0000000000..fd7a9c5943
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-checkbox-valid-default.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input is valid and its checkedness hasn't changed,
+ it should not be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="if (document.getElementById('i').matches(':-moz-ui-valid')) {
+ document.body.textContent='FAIL';
+ } else {
+ document.body.textContent='SUCCESS';
+ }
+ document.documentElement.className='';">
+ <input id='i' type='checkbox'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-customerror.html b/layout/reftests/css-ui-valid/input/input-customerror.html
new file mode 100644
index 0000000000..394b141473
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-customerror.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <script>
+ function doTest() {
+ document.getElementById('t').setCustomValidity('foo');
+ document.documentElement.className='';
+ }
+ document.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </head>
+ <!-- Test: if input has a custom error, it should not be affected by :-moz-ui-valid
+ pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid' id='t'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-disabled-fieldset-1.html b/layout/reftests/css-ui-valid/input/input-disabled-fieldset-1.html
new file mode 100644
index 0000000000..2a84501329
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-disabled-fieldset-1.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input has a disabled fieldset ancestor, it is barred from
+ constraint validation and should not be affected by :-moz-ui-valid
+ pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <fieldset disabled>
+ <fieldset>
+ <input class='notvalid'>
+ </fieldset>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-disabled-fieldset-2.html b/layout/reftests/css-ui-valid/input/input-disabled-fieldset-2.html
new file mode 100644
index 0000000000..db13e2559b
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-disabled-fieldset-2.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input has a disabled fieldset ancestor, it is barred from
+ constraint validation and should not be affected by :-moz-ui-valid
+ pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <script>
+ function onloadHandler()
+ {
+ var fieldsets = document.getElementsByTagName("fieldset");
+ fieldsets[1].disabled = true;
+ fieldsets[0].disabled = false;
+ document.documentElement.className='';
+ }
+ </script>
+ <body onload="onloadHandler();">
+ <fieldset disabled>
+ <fieldset>
+ <input class='notvalid'>
+ </fieldset>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-disabled.html b/layout/reftests/css-ui-valid/input/input-disabled.html
new file mode 100644
index 0000000000..f658b2d0cd
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-disabled.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is disabled, it is barred from constraint validation
+ and should not be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid' disabled>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-dyn-disabled.html b/layout/reftests/css-ui-valid/input/input-dyn-disabled.html
new file mode 100644
index 0000000000..dc8978196e
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-dyn-disabled.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input is disabled, it is barred from constraint validation
+ and should not be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').disabled='true'; document.documentElement.className='';">
+ <input class='notvalid' id='i'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-dyn-not-disabled-changed.html b/layout/reftests/css-ui-valid/input/input-dyn-not-disabled-changed.html
new file mode 100644
index 0000000000..535121db18
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-dyn-not-disabled-changed.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input is not disabled and its value has been changed,
+ it should be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').removeAttribute('disabled');
+ document.getElementById('i').value = '';
+ document.documentElement.className='';">
+ <input class='valid' id='i' disabled>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-dyn-not-disabled.html b/layout/reftests/css-ui-valid/input/input-dyn-not-disabled.html
new file mode 100644
index 0000000000..3ba00d7a5d
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-dyn-not-disabled.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input is not disabled but its value hasn't been changed,
+ it should not be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').removeAttribute('disabled');
+ document.documentElement.className='';">
+ <input class='notvalid' id='i' disabled>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-dyn-not-readonly-changed.html b/layout/reftests/css-ui-valid/input/input-dyn-not-readonly-changed.html
new file mode 100644
index 0000000000..c50a61a454
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-dyn-not-readonly-changed.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input is no longer readonly and its value has been changed,
+ it should be affected by :-moz-ui-valid 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='valid' id='i' readonly>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-dyn-not-readonly.html b/layout/reftests/css-ui-valid/input/input-dyn-not-readonly.html
new file mode 100644
index 0000000000..9a6c92d39f
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-dyn-not-readonly.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input is no longer readonly and its value hasn't been changed,
+ it should not be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').removeAttribute('readonly');
+ document.documentElement.className='';">
+ <input class='notvalid' id='i' readonly>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-dyn-readonly.html b/layout/reftests/css-ui-valid/input/input-dyn-readonly.html
new file mode 100644
index 0000000000..63cec69cb4
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-dyn-readonly.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input is readonly, it is barred from constraint validation
+ and should not be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').readOnly='ro'; document.documentElement.className='';">
+ <input class='notvalid' id='i'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-email-invalid.html b/layout/reftests/css-ui-valid/input/input-email-invalid.html
new file mode 100644
index 0000000000..622ccc142e
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-email-invalid.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ it should not be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid' type='email' value='foo'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-ui-valid/input/input-email-ref.html b/layout/reftests/css-ui-valid/input/input-email-ref.html
new file mode 100644
index 0000000000..ecec613c26
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-email-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input value='foo@bar.com' style="background-color: green;">
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-email-valid-changed.html b/layout/reftests/css-ui-valid/input/input-email-valid-changed.html
new file mode 100644
index 0000000000..ea3a33e8c7
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-email-valid-changed.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <!-- Test: if input is valid and its value has been changed,
+ it should be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').value = 'foo@bar.com';
+ document.documentElement.className = '';">
+ <input id='i' class='valid' type='email'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-ui-valid/input/input-email-valid.html b/layout/reftests/css-ui-valid/input/input-email-valid.html
new file mode 100644
index 0000000000..05020dac8b
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-email-valid.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is valid but its value hasn't been changed,
+ it should not be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid' type='email' value='foo@bar.com'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-ui-valid/input/input-fieldset-legend-ref.html b/layout/reftests/css-ui-valid/input/input-fieldset-legend-ref.html
new file mode 100644
index 0000000000..8d39d91646
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-fieldset-legend-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <fieldset>
+ <legend>
+ <input style="background-color: green;"></input>
+ </legend>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-fieldset-legend.html b/layout/reftests/css-ui-valid/input/input-fieldset-legend.html
new file mode 100644
index 0000000000..f48b46c1c3
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-fieldset-legend.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input has a disabled fieldset ancestor, but is in the first
+ legend, it is not barred from constraint validation and should be
+ affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <fieldset disabled>
+ <legend>
+ <input class='notvalid'></input>
+ </legend>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-fieldset-ref.html b/layout/reftests/css-ui-valid/input/input-fieldset-ref.html
new file mode 100644
index 0000000000..a9e1239125
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-fieldset-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <fieldset>
+ <fieldset>
+ <input style="background-color: green;">
+ </fieldset>
+ </fieldset>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-file-ref.html b/layout/reftests/css-ui-valid/input/input-file-ref.html
new file mode 100644
index 0000000000..73a4fc64cc
--- /dev/null
+++ b/layout/reftests/css-ui-valid/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-valid/input/input-file-valid-changed.html b/layout/reftests/css-ui-valid/input/input-file-valid-changed.html
new file mode 100644
index 0000000000..9ea52fcea5
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-file-valid-changed.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <!-- Test: if input is valid and its default value has been changed,
+ it should be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').value='';
+ document.documentElement.className='';">
+ <input id='i' class='valid' type='file'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-file-valid-default.html b/layout/reftests/css-ui-valid/input/input-file-valid-default.html
new file mode 100644
index 0000000000..b940be643d
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-file-valid-default.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is valid but its default value hasn't been changed,
+ it should not be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid' type='file'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-pattern-invalid.html b/layout/reftests/css-ui-valid/input/input-pattern-invalid.html
new file mode 100644
index 0000000000..2efb1748cc
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-pattern-invalid.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ it should not be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid' pattern='bar' value='foo'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-ui-valid/input/input-pattern-valid-changed.html b/layout/reftests/css-ui-valid/input/input-pattern-valid-changed.html
new file mode 100644
index 0000000000..edf4bc710e
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-pattern-valid-changed.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <!-- Test: if input is valid and its value has been changed,
+ it should be affected by :-moz-ui-valid 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='valid' pattern='foo'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-ui-valid/input/input-pattern-valid.html b/layout/reftests/css-ui-valid/input/input-pattern-valid.html
new file mode 100644
index 0000000000..b9f4db273e
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-pattern-valid.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is valid but its value hasn't been changed,
+ it should not be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid' pattern='foo' value='foo'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-ui-valid/input/input-radio-customerror.html b/layout/reftests/css-ui-valid/input/input-radio-customerror.html
new file mode 100644
index 0000000000..6917667238
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-radio-customerror.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <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-valid') ||
+ !document.getElementById('i2').matches(':-moz-ui-valid')) {
+ document.body.textContent='FAIL';
+ } else {
+ document.body.textContent='SUCCESS';
+ }
+ document.documentElement.className='';">
+ <input id='i1' name='foo' type='radio'>
+ <input id='i2' name='foo' type='radio'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-radio-dyn-valid-1.html b/layout/reftests/css-ui-valid/input/input-radio-dyn-valid-1.html
new file mode 100644
index 0000000000..3aa77deee2
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-radio-dyn-valid-1.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i1').checked = true;
+ if (!document.getElementById('i1').matches(':-moz-ui-valid') ||
+ !document.getElementById('i2').matches(':-moz-ui-valid')) {
+ document.body.textContent='FAIL';
+ } else {
+ document.body.textContent='SUCCESS';
+ }
+ document.documentElement.className='';">
+ <input id='i1' name='foo' type='radio' required>
+ <input id='i2' name='foo' type='radio'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-radio-dyn-valid-2.html b/layout/reftests/css-ui-valid/input/input-radio-dyn-valid-2.html
new file mode 100644
index 0000000000..c5fbb9eaca
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-radio-dyn-valid-2.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <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-valid') ||
+ !document.getElementById('i2').matches(':-moz-ui-valid')) {
+ document.body.textContent='FAIL';
+ } else {
+ document.body.textContent='SUCCESS';
+ }
+ document.documentElement.className='';">
+ <input id='i1' name='foo' type='radio' required>
+ <input id='i2' name='foo' type='radio'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-radio-nogroup-required-invalid.html b/layout/reftests/css-ui-valid/input/input-radio-nogroup-required-invalid.html
new file mode 100644
index 0000000000..43285750c3
--- /dev/null
+++ b/layout/reftests/css-ui-valid/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-valid')) {
+ document.body.textContent='FAIL';
+ } else {
+ document.body.textContent='SUCCESS';
+ }
+ document.documentElement.className='';">
+ <input id='i' type='radio' required>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-radio-nogroup-required-valid.html b/layout/reftests/css-ui-valid/input/input-radio-nogroup-required-valid.html
new file mode 100644
index 0000000000..6808b0186b
--- /dev/null
+++ b/layout/reftests/css-ui-valid/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-valid')) {
+ 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-valid/input/input-radio-required.html b/layout/reftests/css-ui-valid/input/input-radio-required.html
new file mode 100644
index 0000000000..8af43a24cc
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-radio-required.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i1').checked = false;
+ if (document.getElementById('i1').matches(':-moz-ui-valid') ||
+ document.getElementById('i2').matches(':-moz-ui-valid')) {
+ document.body.textContent='FAIL';
+ } else {
+ document.body.textContent='SUCCESS';
+ }
+ document.documentElement.className='';">
+ <input id='i1' name='foo' type='radio' required>
+ <input id='i2' name='foo' type='radio'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-radio-valid-changed.html b/layout/reftests/css-ui-valid/input/input-radio-valid-changed.html
new file mode 100644
index 0000000000..77b5900e6b
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-radio-valid-changed.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input is valid and its checkedness has changed,
+ it should be affected by :-moz-ui-valid 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-valid')) {
+ document.body.textContent='FAIL';
+ } else {
+ document.body.textContent='SUCCESS';
+ }
+ document.documentElement.className='';">
+ <input id='i' type='radio'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-radio-valid-default.html b/layout/reftests/css-ui-valid/input/input-radio-valid-default.html
new file mode 100644
index 0000000000..360aeb21fe
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-radio-valid-default.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if input is valid and its checkedness hasn't changed,
+ it should not be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="if (document.getElementById('i').matches(':-moz-ui-valid')) {
+ document.body.textContent='FAIL';
+ } else {
+ document.body.textContent='SUCCESS';
+ }
+ document.documentElement.className='';">
+ <input id='i' type='radio'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-readonly.html b/layout/reftests/css-ui-valid/input/input-readonly.html
new file mode 100644
index 0000000000..f52a189f0b
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-readonly.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is readonly, it is barred from constraint validation
+ and should not be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid' readonly>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-ref.html b/layout/reftests/css-ui-valid/input/input-ref.html
new file mode 100644
index 0000000000..65b4b97078
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input style="background-color: green;">
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-required-invalid.html b/layout/reftests/css-ui-valid/input/input-required-invalid.html
new file mode 100644
index 0000000000..56ac86422c
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-required-invalid.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ it should not be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid' required>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-ui-valid/input/input-required-valid-changed.html b/layout/reftests/css-ui-valid/input/input-required-valid-changed.html
new file mode 100644
index 0000000000..f67732eaf5
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-required-valid-changed.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <!-- Test: if input is valid and its value has been changed,
+ it should be affected by :-moz-ui-valid 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='valid' required>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-ui-valid/input/input-required-valid.html b/layout/reftests/css-ui-valid/input/input-required-valid.html
new file mode 100644
index 0000000000..a4fe4e0066
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-required-valid.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is valid and its value hasn't been changed,
+ it should not be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid' value='foo' required>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-ui-valid/input/input-reset.html b/layout/reftests/css-ui-valid/input/input-reset.html
new file mode 100644
index 0000000000..6e73d6a13a
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-reset.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is of reset type, it is barred from constraint validation
+ and should not be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <!-- Setting value to the empty string let us check against input-button-ref.html -->
+ <input class='notvalid' type='reset' value=''>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-type-barred.html b/layout/reftests/css-ui-valid/input/input-type-barred.html
new file mode 100644
index 0000000000..fea39eb5a8
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-type-barred.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if an input has is candidate for constraint validation then change
+ its type to be barred from constraint validation, it should not be
+ affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').type='button'; document.documentElement.className='';">
+ <input class='notvalid' id='i'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-type-invalid.html b/layout/reftests/css-ui-valid/input/input-type-invalid.html
new file mode 100644
index 0000000000..b3e342aab9
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-type-invalid.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: if an input has a custom error when barred from constraint
+ validation then move a type candidate for constraint validation,
+ it should not be affected by :-moz-ui-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='notvalid' type='button' id='i'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-url-invalid.html b/layout/reftests/css-ui-valid/input/input-url-invalid.html
new file mode 100644
index 0000000000..f0f99a01e5
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-url-invalid.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input isn't valid nor barred from constraint validation,
+ it should not be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid' type='url' value='foo'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-ui-valid/input/input-url-ref.html b/layout/reftests/css-ui-valid/input/input-url-ref.html
new file mode 100644
index 0000000000..e95cdbca2e
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-url-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input value='http://mozilla.org/' style="background-color: green;">
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-url-valid-changed.html b/layout/reftests/css-ui-valid/input/input-url-valid-changed.html
new file mode 100644
index 0000000000..76bfea089d
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-url-valid-changed.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <!-- Test: if input is valid and its value has been changed,
+ it should be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementById('i').value = 'http://mozilla.org/';
+ document.documentElement.className = '';">
+ <input id='i' class='valid' type='url'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-ui-valid/input/input-url-valid.html b/layout/reftests/css-ui-valid/input/input-url-valid.html
new file mode 100644
index 0000000000..7d20970a4d
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-url-valid.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is valid and its value hasn't been changed,
+ it should not be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid' type='url' value='http://mozilla.org/'>
+ </body>
+</html>
+
diff --git a/layout/reftests/css-ui-valid/input/input-valid.html b/layout/reftests/css-ui-valid/input/input-valid.html
new file mode 100644
index 0000000000..0e0440d0e7
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-valid.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: if input is valid and is not barred from constraint validation,
+ it should be affected by :-moz-ui-valid pseudo-class. -->
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input class='notvalid'>
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/input-withtext-ref.html b/layout/reftests/css-ui-valid/input/input-withtext-ref.html
new file mode 100644
index 0000000000..d54d052157
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/input-withtext-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input value='foo' style="background-color: green;">
+ </body>
+</html>
diff --git a/layout/reftests/css-ui-valid/input/reftest.list b/layout/reftests/css-ui-valid/input/reftest.list
new file mode 100644
index 0000000000..1dc3c73d92
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/reftest.list
@@ -0,0 +1,40 @@
+== input-valid.html input-ref.html
+fuzzy(0-11,0-4) == input-customerror.html input-ref.html
+== 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-dyn-not-disabled-changed.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.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
+== input-required-valid-changed.html input-withtext-ref.html
+fuzzy(0-1,0-3) == input-required-invalid.html input-ref.html
+== input-button.html input-button-ref.html
+== input-reset.html input-button-ref.html
+== input-email-invalid.html input-withtext-ref.html
+== input-email-valid.html input-email-ref.html
+== input-email-valid-changed.html input-email-ref.html
+== input-url-invalid.html input-withtext-ref.html
+== input-url-valid.html input-url-ref.html
+== input-url-valid-changed.html input-url-ref.html
+== input-pattern-valid.html input-withtext-ref.html
+== input-pattern-valid-changed.html input-withtext-ref.html
+== input-pattern-invalid.html input-withtext-ref.html
+== 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-valid-changed.html success-ref.html
+== input-checkbox-valid-default.html success-ref.html
+== input-file-valid-changed.html input-file-ref.html
+== input-file-valid-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-valid/input/style.css b/layout/reftests/css-ui-valid/input/style.css
new file mode 100644
index 0000000000..aa3f74b3c7
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/style.css
@@ -0,0 +1,18 @@
+/* Override default style */
+input:invalid {
+ box-shadow: none;
+}
+
+input.notvalid {
+ background-color: green;
+}
+input.notvalid:-moz-ui-valid {
+ background-color: red;
+}
+
+input.valid {
+ background-color: red;
+}
+input.valid:-moz-ui-valid {
+ background-color: green;
+}
diff --git a/layout/reftests/css-ui-valid/input/success-ref.html b/layout/reftests/css-ui-valid/input/success-ref.html
new file mode 100644
index 0000000000..bfa8e0a12c
--- /dev/null
+++ b/layout/reftests/css-ui-valid/input/success-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ SUCCESS
+ </body>
+</html>