diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /layout/reftests/css-valid/select | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/css-valid/select')
20 files changed, 223 insertions, 0 deletions
diff --git a/layout/reftests/css-valid/select/reftest.list b/layout/reftests/css-valid/select/reftest.list new file mode 100644 index 0000000000..1044775949 --- /dev/null +++ b/layout/reftests/css-valid/select/reftest.list @@ -0,0 +1,12 @@ +fuzzy(0-2,0-7) needs-focus == select-valid.html select-ref.html +fuzzy(0-2,0-5) needs-focus == select-invalid.html select-ref.html +needs-focus == select-disabled.html select-disabled-ref.html +fuzzy(0-1,0-5) needs-focus == select-dyn-disabled.html select-disabled-ref.html +fuzzy(0-2,0-5) needs-focus == select-dyn-not-disabled.html select-ref.html +needs-focus == select-required-invalid.html select-required-ref.html +needs-focus == select-required-valid.html select-required-ref.html +needs-focus == select-required-multiple-still-valid.html select-required-multiple-ref.html +fuzzy(0-1,0-250) needs-focus == select-required-multiple-valid.html select-required-multiple-ref.html +needs-focus == select-disabled-fieldset-1.html select-fieldset-ref.html +fuzzy-if(!Android,0-1,0-3) needs-focus == select-disabled-fieldset-2.html select-fieldset-ref.html +needs-focus == select-fieldset-legend.html select-fieldset-legend-ref.html diff --git a/layout/reftests/css-valid/select/select-disabled-fieldset-1.html b/layout/reftests/css-valid/select/select-disabled-fieldset-1.html new file mode 100644 index 0000000000..856dc9c69d --- /dev/null +++ b/layout/reftests/css-valid/select/select-disabled-fieldset-1.html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<html> + <!-- Test: if select has a disabled fieldset ancestor, it is barred from + constraint validation and should not be affected by :valid + pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <fieldset disabled> + <fieldset> + <select class='notvalid'></select> + </fieldset> + </fieldset> + </body> +</html> diff --git a/layout/reftests/css-valid/select/select-disabled-fieldset-2.html b/layout/reftests/css-valid/select/select-disabled-fieldset-2.html new file mode 100644 index 0000000000..c05671a73b --- /dev/null +++ b/layout/reftests/css-valid/select/select-disabled-fieldset-2.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <!-- Test: if select has a disabled fieldset ancestor, it is barred from + constraint validation and should not be affected by :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> + <select class='notvalid'></select> + </fieldset> + </fieldset> + </body> +</html> diff --git a/layout/reftests/css-valid/select/select-disabled-ref.html b/layout/reftests/css-valid/select/select-disabled-ref.html new file mode 100644 index 0000000000..e3a228a897 --- /dev/null +++ b/layout/reftests/css-valid/select/select-disabled-ref.html @@ -0,0 +1,6 @@ +<!DOCTYPE html> +<html> + <body> + <select disabled style="background-color: green;"></select> + </body> +</html> diff --git a/layout/reftests/css-valid/select/select-disabled.html b/layout/reftests/css-valid/select/select-disabled.html new file mode 100644 index 0000000000..4d03a70f80 --- /dev/null +++ b/layout/reftests/css-valid/select/select-disabled.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> + <!-- Test: if select is disabled, it is barred from constraint validation + and should not be affected by :valid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <select class='notvalid' disabled></select> + </body> +</html> diff --git a/layout/reftests/css-valid/select/select-dyn-disabled.html b/layout/reftests/css-valid/select/select-dyn-disabled.html new file mode 100644 index 0000000000..b37feda47a --- /dev/null +++ b/layout/reftests/css-valid/select/select-dyn-disabled.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <!-- Test: if select is disabled, it is barred from constraint validation + and should not be affected by :valid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body onload="document.getElementById('s').disabled='true'; document.documentElement.className='';"> + <select class='notvalid' id='s'></select> + </body> +</html> diff --git a/layout/reftests/css-valid/select/select-dyn-not-disabled.html b/layout/reftests/css-valid/select/select-dyn-not-disabled.html new file mode 100644 index 0000000000..debad37641 --- /dev/null +++ b/layout/reftests/css-valid/select/select-dyn-not-disabled.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <!-- Test: if select is not disabled, it is candidate for constraint validation + and should be affected by :valid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body onload="document.getElementById('s').removeAttribute('disabled'); document.documentElement.className='';"> + <select class='valid' id='s' disabled></select> + </body> +</html> diff --git a/layout/reftests/css-valid/select/select-fieldset-legend-ref.html b/layout/reftests/css-valid/select/select-fieldset-legend-ref.html new file mode 100644 index 0000000000..5083cea90d --- /dev/null +++ b/layout/reftests/css-valid/select/select-fieldset-legend-ref.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html> + <body> + <fieldset> + <legend> + <select style="background-color: green;"></select> + </legend> + </fieldset> + </body> +</html> diff --git a/layout/reftests/css-valid/select/select-fieldset-legend.html b/layout/reftests/css-valid/select/select-fieldset-legend.html new file mode 100644 index 0000000000..5020bc0be9 --- /dev/null +++ b/layout/reftests/css-valid/select/select-fieldset-legend.html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<html> + <!-- Test: if select has a disabled fieldset ancestor, but is in the first + legend, it is not barred from constraint validation and should be + affected by :valid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <fieldset disabled> + <legend> + <select class='valid'></select> + </legend> + </fieldset> + </body> +</html> diff --git a/layout/reftests/css-valid/select/select-fieldset-ref.html b/layout/reftests/css-valid/select/select-fieldset-ref.html new file mode 100644 index 0000000000..ca82a8022d --- /dev/null +++ b/layout/reftests/css-valid/select/select-fieldset-ref.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html> + <body> + <fieldset> + <fieldset> + <select disabled style="background-color: green;"></select> + </fieldset> + </fieldset> + </body> +</html> diff --git a/layout/reftests/css-valid/select/select-invalid.html b/layout/reftests/css-valid/select/select-invalid.html new file mode 100644 index 0000000000..a30a1555a6 --- /dev/null +++ b/layout/reftests/css-valid/select/select-invalid.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <!-- Test: if select has a custom error, it should not be affected by :valid + pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body onload="document.getElementById('s').setCustomValidity('foo'); document.documentElement.className='';"> + <select class='notvalid' id='s'></select> + </body> +</html> diff --git a/layout/reftests/css-valid/select/select-ref.html b/layout/reftests/css-valid/select/select-ref.html new file mode 100644 index 0000000000..a28668557f --- /dev/null +++ b/layout/reftests/css-valid/select/select-ref.html @@ -0,0 +1,6 @@ +<!DOCTYPE html> +<html> + <body> + <select style="background-color: green;"></select> + </body> +</html> diff --git a/layout/reftests/css-valid/select/select-required-invalid.html b/layout/reftests/css-valid/select/select-required-invalid.html new file mode 100644 index 0000000000..45e38acb78 --- /dev/null +++ b/layout/reftests/css-valid/select/select-required-invalid.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html> + <!-- Test: if select is required and has a select option which has an empty + string value, :valid should not apply. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <select class='notvalid' required> + <option selected value="">foo</option> + </select> + </body> +</html></html> diff --git a/layout/reftests/css-valid/select/select-required-multiple-ref.html b/layout/reftests/css-valid/select/select-required-multiple-ref.html new file mode 100644 index 0000000000..a9477333f8 --- /dev/null +++ b/layout/reftests/css-valid/select/select-required-multiple-ref.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <select multiple style="background-color: green;"> + <option selected></option> + <option selected value="">foo</option> + </select> + </body> +</html> diff --git a/layout/reftests/css-valid/select/select-required-multiple-still-valid.html b/layout/reftests/css-valid/select/select-required-multiple-still-valid.html new file mode 100644 index 0000000000..d093c06772 --- /dev/null +++ b/layout/reftests/css-valid/select/select-required-multiple-still-valid.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> + <!-- Test: if select is required and has all selected option value set to the + empty string, :valid should still apply. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <select class='valid' required multiple> + <option selected></option> + <option selected value="">foo</option> + </select> + </body> +</html> diff --git a/layout/reftests/css-valid/select/select-required-multiple-valid.html b/layout/reftests/css-valid/select/select-required-multiple-valid.html new file mode 100644 index 0000000000..6bf74d623b --- /dev/null +++ b/layout/reftests/css-valid/select/select-required-multiple-valid.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> + <!-- Test: if select is required and has a selected option which has value + different from the empty string, :valid should apply. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <select class='valid' required multiple> + <option selected></option> + <option selected>foo</option> + </select> + </body> +</html> diff --git a/layout/reftests/css-valid/select/select-required-ref.html b/layout/reftests/css-valid/select/select-required-ref.html new file mode 100644 index 0000000000..3c2bde80a0 --- /dev/null +++ b/layout/reftests/css-valid/select/select-required-ref.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <select style="background-color: green;"> + <option selected value="">foo</option> + </selecT> + </body> +</html> diff --git a/layout/reftests/css-valid/select/select-required-valid.html b/layout/reftests/css-valid/select/select-required-valid.html new file mode 100644 index 0000000000..685995b673 --- /dev/null +++ b/layout/reftests/css-valid/select/select-required-valid.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html> + <!-- Test: if select is required and has a select option which has value + different from the empty string, :valid should apply. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <select class='valid' required> + <option selected>foo</option> + </select> + </body> +</html> diff --git a/layout/reftests/css-valid/select/select-valid.html b/layout/reftests/css-valid/select/select-valid.html new file mode 100644 index 0000000000..aab4313401 --- /dev/null +++ b/layout/reftests/css-valid/select/select-valid.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> + <!-- Test: if select has no custom error and is not barred from constraint + validation, it should be affected by :valid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <select class='valid'></select> + </body> +</html> diff --git a/layout/reftests/css-valid/select/style.css b/layout/reftests/css-valid/select/style.css new file mode 100644 index 0000000000..32bb6a7f00 --- /dev/null +++ b/layout/reftests/css-valid/select/style.css @@ -0,0 +1,18 @@ +/* Override default style */ +select:invalid { + box-shadow: none; +} + +select.notvalid { + background-color: green; +} +select.notvalid:valid { + background-color: red; +} + +select.valid { + background-color: red; +} +select.valid:valid { + background-color: green; +} |