diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /layout/reftests/css-invalid/button | |
parent | Initial commit. (diff) | |
download | firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/css-invalid/button')
18 files changed, 251 insertions, 0 deletions
diff --git a/layout/reftests/css-invalid/button/button-button.html b/layout/reftests/css-invalid/button/button-button.html new file mode 100644 index 0000000000..41e76115b0 --- /dev/null +++ b/layout/reftests/css-invalid/button/button-button.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <!-- Test: if button is of the button type, it is barred from constraint + validation and should not be affected by :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body onload="document.getElementById('b').setCustomValidity('foo'); document.documentElement.className='';"> + <button class='notinvalid' id='b' type='button'></button> + </body> +</html> diff --git a/layout/reftests/css-invalid/button/button-disabled-fieldset-1.html b/layout/reftests/css-invalid/button/button-disabled-fieldset-1.html new file mode 100644 index 0000000000..4ce9b30dc3 --- /dev/null +++ b/layout/reftests/css-invalid/button/button-disabled-fieldset-1.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <!-- Test: if button 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 e = document.getElementById('b'); + e.setCustomValidity('foo'); + document.documentElement.className=''; + } + </script> + <body onload="onLoadHandler();"> + <fieldset disabled> + <fieldset> + <button class='notinvalid' id='b'></button> + </fieldset> + </fieldset> + </body> +</html> diff --git a/layout/reftests/css-invalid/button/button-disabled-fieldset-2.html b/layout/reftests/css-invalid/button/button-disabled-fieldset-2.html new file mode 100644 index 0000000000..f5b2a9e7d6 --- /dev/null +++ b/layout/reftests/css-invalid/button/button-disabled-fieldset-2.html @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <!-- Test: if button 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 e = document.getElementById('b'); + e.setCustomValidity('foo'); + var fieldsets = document.getElementsByTagName("fieldset"); + fieldsets[1].disabled = true; + fieldsets[0].disabled = false; + document.documentElement.className=''; + } + </script> + <body onload="onloadHandler();"> + <fieldset disabled> + <fieldset> + <button class='notinvalid' id='b'></button> + </fieldset> + </fieldset> + </body> +</html> diff --git a/layout/reftests/css-invalid/button/button-disabled-ref.html b/layout/reftests/css-invalid/button/button-disabled-ref.html new file mode 100644 index 0000000000..7de1ba7c5c --- /dev/null +++ b/layout/reftests/css-invalid/button/button-disabled-ref.html @@ -0,0 +1,6 @@ +<!DOCTYPE html> +<html> + <body> + <button style="background-color: green;" disabled></button> + </body> +</html> diff --git a/layout/reftests/css-invalid/button/button-disabled.html b/layout/reftests/css-invalid/button/button-disabled.html new file mode 100644 index 0000000000..73760ee3df --- /dev/null +++ b/layout/reftests/css-invalid/button/button-disabled.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> + <!-- Test: if button 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> + <button class='notinvalid' disabled></button> + </body> +</html> diff --git a/layout/reftests/css-invalid/button/button-dyn-disabled.html b/layout/reftests/css-invalid/button/button-dyn-disabled.html new file mode 100644 index 0000000000..1c7350d722 --- /dev/null +++ b/layout/reftests/css-invalid/button/button-dyn-disabled.html @@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <!-- Test: if button is disabled and invalid, it is barred from constraint + validation and should not be affected by :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <script> + function onLoadHandler() + { + var e = document.getElementById('b'); + e.setCustomValidity('foo'); + e.disabled = 'true'; + document.documentElement.className=''; + } + </script> + <body onload="onLoadHandler();"> + <button class='notinvalid' id='b'></button> + </body> +</html> diff --git a/layout/reftests/css-invalid/button/button-dyn-not-disabled.html b/layout/reftests/css-invalid/button/button-dyn-not-disabled.html new file mode 100644 index 0000000000..7ae667b8ec --- /dev/null +++ b/layout/reftests/css-invalid/button/button-dyn-not-disabled.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <!-- Test: if button is not disabled and invalid, it is candidate for + constraint validation and should be affected + by :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <script> + function onLoadHandler() + { + var e = document.getElementById('b'); + e.setCustomValidity('foo'); + e.removeAttribute('disabled'); + document.documentElement.className=''; + } + </script> + <body onload="onLoadHandler();"> + <button class='invalid' id='b' disabled></button> + </body> +</html> diff --git a/layout/reftests/css-invalid/button/button-fieldset-legend-ref.html b/layout/reftests/css-invalid/button/button-fieldset-legend-ref.html new file mode 100644 index 0000000000..22adc433cd --- /dev/null +++ b/layout/reftests/css-invalid/button/button-fieldset-legend-ref.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html> + <body> + <fieldset> + <legend> + <button style="background-color: green;"></button> + </legend> + </fieldset> + </body> +</html> diff --git a/layout/reftests/css-invalid/button/button-fieldset-legend.html b/layout/reftests/css-invalid/button/button-fieldset-legend.html new file mode 100644 index 0000000000..f308cc42ee --- /dev/null +++ b/layout/reftests/css-invalid/button/button-fieldset-legend.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <!-- Test: if button 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'> + <script> + function onLoadHandler() + { + var e = document.getElementById('b'); + e.setCustomValidity('foo'); + document.documentElement.className=''; + } + </script> + <body onload="onLoadHandler();"> + <fieldset disabled> + <legend> + <button class='invalid' id='b'></button> + </legend> + </fieldset> + </body> +</html> diff --git a/layout/reftests/css-invalid/button/button-fieldset-ref.html b/layout/reftests/css-invalid/button/button-fieldset-ref.html new file mode 100644 index 0000000000..60ab1a3ef0 --- /dev/null +++ b/layout/reftests/css-invalid/button/button-fieldset-ref.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html> + <body> + <fieldset> + <fieldset disabled> + <button style="background-color: green;"></button> + </fieldset> + </fieldset> + </body> +</html> diff --git a/layout/reftests/css-invalid/button/button-invalid.html b/layout/reftests/css-invalid/button/button-invalid.html new file mode 100644 index 0000000000..f4850ad422 --- /dev/null +++ b/layout/reftests/css-invalid/button/button-invalid.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <!-- Test: if button has a custom error, it should be affected by :invalid + pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body onload="document.getElementById('b').setCustomValidity('foo'); document.documentElement.className='';"> + <button class='invalid' id='b'></button> + </body> +</html> diff --git a/layout/reftests/css-invalid/button/button-ref.html b/layout/reftests/css-invalid/button/button-ref.html new file mode 100644 index 0000000000..422cc9315f --- /dev/null +++ b/layout/reftests/css-invalid/button/button-ref.html @@ -0,0 +1,6 @@ +<!DOCTYPE html> +<html> + <body> + <button style="background-color: green;"></button> + </body> +</html> diff --git a/layout/reftests/css-invalid/button/button-reset.html b/layout/reftests/css-invalid/button/button-reset.html new file mode 100644 index 0000000000..45c57cab7b --- /dev/null +++ b/layout/reftests/css-invalid/button/button-reset.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <!-- Test: if button is of the reset type, it is barred from constraint + validation and should not be affected by :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body onload="document.getElementById('b').setCustomValidity('foo'); document.documentElement.className='';"> + <button class='notinvalid' id='b' type='reset'></button> + </body> +</html> diff --git a/layout/reftests/css-invalid/button/button-type-barred.html b/layout/reftests/css-invalid/button/button-type-barred.html new file mode 100644 index 0000000000..3748615427 --- /dev/null +++ b/layout/reftests/css-invalid/button/button-type-barred.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <!-- Test: if a button has is candidate for constraint validation then change + its type to be barred from constraint validation, it should not be + affected by :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <script> + function onLoadHandler() + { + var b = document.getElementById('b'); + b.setCustomValidity('foo'); + b.type = 'button'; + document.documentElement.className=''; + } + </script> + <body onload="document.getElementById('b').type='button'; document.documentElement.className='';"> + <button class='notinvalid' type='submit' id='b'></button> + </body> +</html> diff --git a/layout/reftests/css-invalid/button/button-type-invalid.html b/layout/reftests/css-invalid/button/button-type-invalid.html new file mode 100644 index 0000000000..a6e20d1a94 --- /dev/null +++ b/layout/reftests/css-invalid/button/button-type-invalid.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <!-- Test: if a button has a custom error when barred from constraint + validation then move a type candidate for constraint validation, + it should not be affected by :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <script> + function onLoadHandler() + { + var b = document.getElementById('b'); + b.setCustomValidity('foo'); + b.type = 'submit'; + document.documentElement.className=''; + } + </script> + <body onload="onLoadHandler();"> + <button class='invalid' type='button' id='b'></button> + </body> +</html> diff --git a/layout/reftests/css-invalid/button/button-valid.html b/layout/reftests/css-invalid/button/button-valid.html new file mode 100644 index 0000000000..1b6f61ca24 --- /dev/null +++ b/layout/reftests/css-invalid/button/button-valid.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> + <!-- Test: if button has no custom error and is not barred from constraint + validation, it should be affected by :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <button class='notinvalid'</button> + </body> +</html> diff --git a/layout/reftests/css-invalid/button/reftest.list b/layout/reftests/css-invalid/button/reftest.list new file mode 100644 index 0000000000..c82e214add --- /dev/null +++ b/layout/reftests/css-invalid/button/reftest.list @@ -0,0 +1,12 @@ +fuzzy-if(skiaContent,0-1,0-3) == button-valid.html button-ref.html +fuzzy-if(skiaContent,0-1,0-5) == button-invalid.html button-ref.html +== button-disabled.html button-disabled-ref.html +fuzzy-if(skiaContent,0-1,0-5) == button-dyn-disabled.html button-disabled-ref.html +fuzzy-if(skiaContent,0-1,0-5) == button-dyn-not-disabled.html button-ref.html +fuzzy-if(skiaContent,0-1,0-5) == button-button.html button-ref.html +fuzzy-if(skiaContent,0-1,0-5) == button-reset.html button-ref.html +fuzzy-if(skiaContent,0-1,0-5) == button-type-invalid.html button-ref.html +fuzzy-if(skiaContent,0-1,0-5) == button-type-barred.html button-ref.html +fuzzy-if(skiaContent,0-1,0-3) == button-disabled-fieldset-1.html button-fieldset-ref.html +fuzzy-if(skiaContent,0-1,0-3) == button-disabled-fieldset-2.html button-fieldset-ref.html +fuzzy-if(skiaContent,0-1,0-3) == button-fieldset-legend.html button-fieldset-legend-ref.html diff --git a/layout/reftests/css-invalid/button/style.css b/layout/reftests/css-invalid/button/style.css new file mode 100644 index 0000000000..b52ea47cb5 --- /dev/null +++ b/layout/reftests/css-invalid/button/style.css @@ -0,0 +1,18 @@ +/* Override default style */ +button:invalid { + box-shadow: none; +} + +button.notinvalid { + background-color: green; +} +button.notinvalid:invalid { + background-color: red; +} + +button.invalid { + background-color: red; +} +button.invalid:invalid { + background-color: green; +} |