diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /layout/reftests/css-invalid/textarea | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/css-invalid/textarea')
19 files changed, 266 insertions, 0 deletions
diff --git a/layout/reftests/css-invalid/textarea/reftest.list b/layout/reftests/css-invalid/textarea/reftest.list new file mode 100644 index 0000000000..d290f294f3 --- /dev/null +++ b/layout/reftests/css-invalid/textarea/reftest.list @@ -0,0 +1,13 @@ +== textarea-valid.html textarea-ref.html +== textarea-customerror.html textarea-ref.html +== textarea-disabled.html textarea-ref.html +== textarea-dyn-disabled.html textarea-ref.html +== textarea-dyn-not-disabled.html textarea-ref.html +== textarea-readonly.html textarea-ref.html +== textarea-dyn-readonly.html textarea-ref.html +== textarea-dyn-not-readonly.html textarea-ref.html +== textarea-required-valid.html textarea-withtext-ref.html +== textarea-required-invalid.html textarea-ref.html +== textarea-disabled-fieldset-1.html textarea-fieldset-ref.html +== textarea-disabled-fieldset-2.html textarea-fieldset-ref.html +== textarea-fieldset-legend.html textarea-fieldset-legend-ref.html diff --git a/layout/reftests/css-invalid/textarea/style.css b/layout/reftests/css-invalid/textarea/style.css new file mode 100644 index 0000000000..1fec018af2 --- /dev/null +++ b/layout/reftests/css-invalid/textarea/style.css @@ -0,0 +1,26 @@ +/* Override default style */ +textarea { + border: 0px; +} + +textarea.ref { + background-color: green; +} + +textarea:invalid { + box-shadow: none; +} + +textarea.notinvalid { + background-color: green; +} +textarea.notinvalid:invalid { + background-color: red; +} + +textarea.invalid { + background-color: red; +} +textarea.invalid:invalid { + background-color: green; +} diff --git a/layout/reftests/css-invalid/textarea/textarea-customerror.html b/layout/reftests/css-invalid/textarea/textarea-customerror.html new file mode 100644 index 0000000000..1f6dd5ce67 --- /dev/null +++ b/layout/reftests/css-invalid/textarea/textarea-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 textarea has a custom error, it should be affected by :invalid + pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <textarea class='invalid' id='t'></textarea> + </body> +</html> diff --git a/layout/reftests/css-invalid/textarea/textarea-disabled-fieldset-1.html b/layout/reftests/css-invalid/textarea/textarea-disabled-fieldset-1.html new file mode 100644 index 0000000000..0c07f75ef4 --- /dev/null +++ b/layout/reftests/css-invalid/textarea/textarea-disabled-fieldset-1.html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<html> + <!-- Test: if textarea has a disabled fieldset ancestor, it is barred from + constraint validation and should not be affected by :invalid + pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <fieldset disabled> + <fieldset> + <textarea class='notinvalid' required></textarea> + </fieldset> + </fieldset> + </body> +</html> diff --git a/layout/reftests/css-invalid/textarea/textarea-disabled-fieldset-2.html b/layout/reftests/css-invalid/textarea/textarea-disabled-fieldset-2.html new file mode 100644 index 0000000000..4d2df60f90 --- /dev/null +++ b/layout/reftests/css-invalid/textarea/textarea-disabled-fieldset-2.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <!-- Test: if textarea has a disabled fieldset ancestor, it is barred from + constraint validation and should not be affected by :invalid + pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <script> + function onloadHandler() + { + var fieldsets = document.getElementsByTagName("fieldset"); + fieldsets[1].disabled = true; + fieldsets[0].disabled = false; + document.documentElement.className=''; + } + </script> + <body onload="onloadHandler();"> + <fieldset disabled> + <fieldset> + <textarea class='notinvalid' required></textarea> + </fieldset> + </fieldset> + </body> +</html> diff --git a/layout/reftests/css-invalid/textarea/textarea-disabled.html b/layout/reftests/css-invalid/textarea/textarea-disabled.html new file mode 100644 index 0000000000..1d0dd1067c --- /dev/null +++ b/layout/reftests/css-invalid/textarea/textarea-disabled.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> + <!-- Test: if textarea is disabled, it is barred from constraint validation + and should not be affected by :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <textarea class='notinvalid' disabled></textarea> + </body> +</html> diff --git a/layout/reftests/css-invalid/textarea/textarea-dyn-disabled.html b/layout/reftests/css-invalid/textarea/textarea-dyn-disabled.html new file mode 100644 index 0000000000..f206158b39 --- /dev/null +++ b/layout/reftests/css-invalid/textarea/textarea-dyn-disabled.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <!-- Test: if textarea is disabled and invalid, it is barred from constraint + validation and should not be affected by :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <script> + function doTest() + { + var e = document.getElementById('t'); + e.setCustomValidity('foo'); + e.disabled = 'true'; + document.documentElement.className=''; + } + document.addEventListener("MozReftestInvalidate", doTest); + </script> + <body> + <textarea class='notinvalid' id='t'></textarea> + </body> +</html> diff --git a/layout/reftests/css-invalid/textarea/textarea-dyn-not-disabled.html b/layout/reftests/css-invalid/textarea/textarea-dyn-not-disabled.html new file mode 100644 index 0000000000..bd20f3019c --- /dev/null +++ b/layout/reftests/css-invalid/textarea/textarea-dyn-not-disabled.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <!-- Test: if textarea is not disabled and invalid, it is candidate for + constraint validation and should be affected + by :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <script> + function doTest() + { + var e = document.getElementById('t'); + e.setCustomValidity('foo'); + e.removeAttribute('disabled'); + document.documentElement.className=''; + } + document.addEventListener("MozReftestInvalidate", doTest); + </script> + <body> + <textarea class='invalid' id='t' disabled></textarea> + </body> +</html> diff --git a/layout/reftests/css-invalid/textarea/textarea-dyn-not-readonly.html b/layout/reftests/css-invalid/textarea/textarea-dyn-not-readonly.html new file mode 100644 index 0000000000..a627c80784 --- /dev/null +++ b/layout/reftests/css-invalid/textarea/textarea-dyn-not-readonly.html @@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <head> + <script> + function doTest() { + document.getElementById('t').removeAttribute('readonly'); + document.documentElement.className=''; + } + document.addEventListener("MozReftestInvalidate", doTest); + </script> + </head> + <!-- Test: if textarea is no longer readonly, it is candidate for constraint + validation and should be affected by :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <textarea class='invalid' id='t' readonly required></textarea> + </body> +</html> diff --git a/layout/reftests/css-invalid/textarea/textarea-dyn-readonly.html b/layout/reftests/css-invalid/textarea/textarea-dyn-readonly.html new file mode 100644 index 0000000000..f583f5d2e7 --- /dev/null +++ b/layout/reftests/css-invalid/textarea/textarea-dyn-readonly.html @@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <head> + <script> + function doTest() { + document.getElementById('t').readOnly='ro'; + document.documentElement.className=''; + } + document.addEventListener("MozReftestInvalidate", doTest); + </script> + </head> + <!-- Test: if textarea is readonly, it is barred from constraint validation + and should not be affected by :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <textarea class='notinvalid' id='t' required></textarea> + </body> +</html> diff --git a/layout/reftests/css-invalid/textarea/textarea-fieldset-legend-ref.html b/layout/reftests/css-invalid/textarea/textarea-fieldset-legend-ref.html new file mode 100644 index 0000000000..8e81d23f1f --- /dev/null +++ b/layout/reftests/css-invalid/textarea/textarea-fieldset-legend-ref.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <fieldset> + <legend> + <textarea class="ref"></textarea> + </legend> + </fieldset> + </body> +</html> diff --git a/layout/reftests/css-invalid/textarea/textarea-fieldset-legend.html b/layout/reftests/css-invalid/textarea/textarea-fieldset-legend.html new file mode 100644 index 0000000000..0584250a88 --- /dev/null +++ b/layout/reftests/css-invalid/textarea/textarea-fieldset-legend.html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<html> + <!-- Test: if textarea has a disabled fieldset ancestor, but is in the first + legend, it is not barred from constraint validation and should be + affected by :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <fieldset disabled> + <legend> + <textarea class='invalid' required></textarea> + </legend> + </fieldset> + </body> +</html> diff --git a/layout/reftests/css-invalid/textarea/textarea-fieldset-ref.html b/layout/reftests/css-invalid/textarea/textarea-fieldset-ref.html new file mode 100644 index 0000000000..1d01eb0438 --- /dev/null +++ b/layout/reftests/css-invalid/textarea/textarea-fieldset-ref.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <fieldset> + <fieldset> + <textarea class="ref"></textarea> + </fieldset> + </fieldset> + </body> +</html> diff --git a/layout/reftests/css-invalid/textarea/textarea-readonly.html b/layout/reftests/css-invalid/textarea/textarea-readonly.html new file mode 100644 index 0000000000..dbc12b6503 --- /dev/null +++ b/layout/reftests/css-invalid/textarea/textarea-readonly.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> + <!-- Test: if textarea is readonly, it is barred from constraint validation + and should not be affected by :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <textarea class='notinvalid' readonly></textarea> + </body> +</html> diff --git a/layout/reftests/css-invalid/textarea/textarea-ref.html b/layout/reftests/css-invalid/textarea/textarea-ref.html new file mode 100644 index 0000000000..b370a02a0f --- /dev/null +++ b/layout/reftests/css-invalid/textarea/textarea-ref.html @@ -0,0 +1,7 @@ +<!DOCTYPE html> +<html> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <textarea class="ref"></textarea> + </body> +</html> diff --git a/layout/reftests/css-invalid/textarea/textarea-required-invalid.html b/layout/reftests/css-invalid/textarea/textarea-required-invalid.html new file mode 100644 index 0000000000..48a2652f8c --- /dev/null +++ b/layout/reftests/css-invalid/textarea/textarea-required-invalid.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html> + <!-- Test: if textarea isn't valid nor barred from constraint validation, + it should be affected by :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <textarea class='invalid' required></textarea> + </body> +</html> + diff --git a/layout/reftests/css-invalid/textarea/textarea-required-valid.html b/layout/reftests/css-invalid/textarea/textarea-required-valid.html new file mode 100644 index 0000000000..8c754fd4af --- /dev/null +++ b/layout/reftests/css-invalid/textarea/textarea-required-valid.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html> + <!-- Test: if textarea is valid and not barred from constraint validation, + it should not be affected by :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <textarea class='notinvalid' required>foo</textarea> + </body> +</html> + diff --git a/layout/reftests/css-invalid/textarea/textarea-valid.html b/layout/reftests/css-invalid/textarea/textarea-valid.html new file mode 100644 index 0000000000..e32d71cd24 --- /dev/null +++ b/layout/reftests/css-invalid/textarea/textarea-valid.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> + <!-- Test: if textarea is valid and is not barred from constraint validation, + it should not be affected by :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <textarea class='notinvalid'></textarea> + </body> +</html> diff --git a/layout/reftests/css-invalid/textarea/textarea-withtext-ref.html b/layout/reftests/css-invalid/textarea/textarea-withtext-ref.html new file mode 100644 index 0000000000..a6a2b79cfa --- /dev/null +++ b/layout/reftests/css-invalid/textarea/textarea-withtext-ref.html @@ -0,0 +1,7 @@ +<!DOCTYPE html> +<html> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <textarea class="ref">foo</textarea> + </body> +</html> |