diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /layout/reftests/css-invalid/input | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'layout/reftests/css-invalid/input')
46 files changed, 571 insertions, 0 deletions
diff --git a/layout/reftests/css-invalid/input/input-button-ref.html b/layout/reftests/css-invalid/input/input-button-ref.html new file mode 100644 index 000000000..6f001b210 --- /dev/null +++ b/layout/reftests/css-invalid/input/input-button-ref.html @@ -0,0 +1,7 @@ +<!DOCTYPE html> +<html> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <input type='button' class='ref'> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-button.html b/layout/reftests/css-invalid/input/input-button.html new file mode 100644 index 000000000..5d708712a --- /dev/null +++ b/layout/reftests/css-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 :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-invalid/input/input-customerror.html b/layout/reftests/css-invalid/input/input-customerror.html new file mode 100644 index 000000000..b954d67c7 --- /dev/null +++ b/layout/reftests/css-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, false); + </script> + </head> + <!-- Test: if input has a custom error, it should be affected by :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-invalid/input/input-disabled-fieldset-1.html b/layout/reftests/css-invalid/input/input-disabled-fieldset-1.html new file mode 100644 index 000000000..1b82858f5 --- /dev/null +++ b/layout/reftests/css-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 :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-invalid/input/input-disabled-fieldset-2.html b/layout/reftests/css-invalid/input/input-disabled-fieldset-2.html new file mode 100644 index 000000000..c470f7733 --- /dev/null +++ b/layout/reftests/css-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 :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-invalid/input/input-disabled.html b/layout/reftests/css-invalid/input/input-disabled.html new file mode 100644 index 000000000..9015e7bc5 --- /dev/null +++ b/layout/reftests/css-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 :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-invalid/input/input-dyn-disabled.html b/layout/reftests/css-invalid/input/input-dyn-disabled.html new file mode 100644 index 000000000..770313752 --- /dev/null +++ b/layout/reftests/css-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 :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-invalid/input/input-dyn-not-disabled.html b/layout/reftests/css-invalid/input/input-dyn-not-disabled.html new file mode 100644 index 000000000..327c1ab8f --- /dev/null +++ b/layout/reftests/css-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 :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-invalid/input/input-dyn-not-readonly.html b/layout/reftests/css-invalid/input/input-dyn-not-readonly.html new file mode 100644 index 000000000..83bf1024e --- /dev/null +++ b/layout/reftests/css-invalid/input/input-dyn-not-readonly.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <!-- Test: if input 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 onload="document.getElementById('i').removeAttribute('readonly'); document.documentElement.className='';"> + <input class='invalid' id='i' readonly required> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-dyn-readonly.html b/layout/reftests/css-invalid/input/input-dyn-readonly.html new file mode 100644 index 000000000..e00ce5f48 --- /dev/null +++ b/layout/reftests/css-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 :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-invalid/input/input-email-invalid.html b/layout/reftests/css-invalid/input/input-email-invalid.html new file mode 100644 index 000000000..66604c45d --- /dev/null +++ b/layout/reftests/css-invalid/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 be affected by :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <input class='invalid' type='email' value='foo'> + </body> +</html> + diff --git a/layout/reftests/css-invalid/input/input-email-ref.html b/layout/reftests/css-invalid/input/input-email-ref.html new file mode 100644 index 000000000..8c598ef9d --- /dev/null +++ b/layout/reftests/css-invalid/input/input-email-ref.html @@ -0,0 +1,7 @@ +<!DOCTYPE html> +<html> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <input value='foo@bar.com' class='ref'> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-email-valid.html b/layout/reftests/css-invalid/input/input-email-valid.html new file mode 100644 index 000000000..7eb1c6f98 --- /dev/null +++ b/layout/reftests/css-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 :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-invalid/input/input-fieldset-legend-ref.html b/layout/reftests/css-invalid/input/input-fieldset-legend-ref.html new file mode 100644 index 000000000..2a171df0a --- /dev/null +++ b/layout/reftests/css-invalid/input/input-fieldset-legend-ref.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <fieldset> + <legend> + <input class='ref'> + </legend> + </fieldset> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-fieldset-legend.html b/layout/reftests/css-invalid/input/input-fieldset-legend.html new file mode 100644 index 000000000..4cdb026c7 --- /dev/null +++ b/layout/reftests/css-invalid/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 :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <fieldset disabled> + <legend> + <input class='invalid' required> + </legend> + </fieldset> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-fieldset-ref.html b/layout/reftests/css-invalid/input/input-fieldset-ref.html new file mode 100644 index 000000000..25c90be99 --- /dev/null +++ b/layout/reftests/css-invalid/input/input-fieldset-ref.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <fieldset> + <fieldset> + <input class='ref'> + </fieldset> + </fieldset> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-image-ref.html b/layout/reftests/css-invalid/input/input-image-ref.html new file mode 100644 index 000000000..1509fe487 --- /dev/null +++ b/layout/reftests/css-invalid/input/input-image-ref.html @@ -0,0 +1,7 @@ +<!DOCTYPE html> +<html> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <input type='image' class='ref'> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-image.html b/layout/reftests/css-invalid/input/input-image.html new file mode 100644 index 000000000..d949e66e1 --- /dev/null +++ b/layout/reftests/css-invalid/input/input-image.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 :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <input class='notinvalid' type='image'> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-pattern-invalid.html b/layout/reftests/css-invalid/input/input-pattern-invalid.html new file mode 100644 index 000000000..4a2325c61 --- /dev/null +++ b/layout/reftests/css-invalid/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 be affected by :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <input class='invalid' pattern='bar' value='foo'> + </body> +</html> + diff --git a/layout/reftests/css-invalid/input/input-pattern-valid.html b/layout/reftests/css-invalid/input/input-pattern-valid.html new file mode 100644 index 000000000..7e5283410 --- /dev/null +++ b/layout/reftests/css-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 :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-invalid/input/input-radio-checked-ref.html b/layout/reftests/css-invalid/input/input-radio-checked-ref.html new file mode 100644 index 000000000..45864b158 --- /dev/null +++ b/layout/reftests/css-invalid/input/input-radio-checked-ref.html @@ -0,0 +1,8 @@ +<!DOCTYPE html> +<html> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <input type='radio' class='ref' checked> + <input type='radio' class='ref'> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-radio-customerror.html b/layout/reftests/css-invalid/input/input-radio-customerror.html new file mode 100644 index 000000000..e5fadd514 --- /dev/null +++ b/layout/reftests/css-invalid/input/input-radio-customerror.html @@ -0,0 +1,11 @@ +<!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').setCustomValidity('foo'); + document.documentElement.className='';"> + <input class='invalid' id='i1' name='foo' type='radio'> + <input class='notinvalid' id='i2' name='foo' type='radio'> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-radio-dyn-valid-1.html b/layout/reftests/css-invalid/input/input-radio-dyn-valid-1.html new file mode 100644 index 000000000..30db7c015 --- /dev/null +++ b/layout/reftests/css-invalid/input/input-radio-dyn-valid-1.html @@ -0,0 +1,11 @@ +<!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.documentElement.className='';"> + <input class='notinvalid' id='i1' name='foo' type='radio' required> + <input class='notinvalid' id='i2' name='foo' type='radio'> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-radio-dyn-valid-2.html b/layout/reftests/css-invalid/input/input-radio-dyn-valid-2.html new file mode 100644 index 000000000..a2cfbd6a1 --- /dev/null +++ b/layout/reftests/css-invalid/input/input-radio-dyn-valid-2.html @@ -0,0 +1,11 @@ +<!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').required = false; + document.documentElement.className='';"> + <input class='notinvalid' id='i1' name='foo' type='radio' required> + <input class='notinvalid' id='i2' name='foo' type='radio'> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-radio-focus-click.html b/layout/reftests/css-invalid/input/input-radio-focus-click.html new file mode 100644 index 000000000..1ed298cae --- /dev/null +++ b/layout/reftests/css-invalid/input/input-radio-focus-click.html @@ -0,0 +1,30 @@ +<!DOCTYPE html> +<html> + <body class="reftest-wait"> + <!-- See bug 658282. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <script> + function loadHandler() { + var button = document.getElementsByTagName('button')[0]; + var radios = document.getElementsByName('foo'); + + button.onclick = function() { + for (var i = 0; i < radios.length; i++) { + radios[i].checked = false; + } + button.parentNode.removeChild(button); + document.documentElement.className=''; + }; + + radios[0].focus(); + radios[0].checked = true; + button.focus(); + button.click(); + } + </script> + <body onload="loadHandler();"> + <input class='invalid' id='i1' name='foo' type='radio' required> + <input class='invalid' id='i2' name='foo' type='radio' required> + <button></button> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-radio-nogroup-required-invalid.html b/layout/reftests/css-invalid/input/input-radio-nogroup-required-invalid.html new file mode 100644 index 000000000..d46b1607c --- /dev/null +++ b/layout/reftests/css-invalid/input/input-radio-nogroup-required-invalid.html @@ -0,0 +1,8 @@ +<!DOCTYPE html> +<html> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <input class='notinvalid' id='i' type='radio' checked required> + <input class='notinvalid' type='radio'> <!-- adding this one so we don't have to create a second ref --> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-radio-nogroup-required-valid.html b/layout/reftests/css-invalid/input/input-radio-nogroup-required-valid.html new file mode 100644 index 000000000..858761472 --- /dev/null +++ b/layout/reftests/css-invalid/input/input-radio-nogroup-required-valid.html @@ -0,0 +1,8 @@ +<!DOCTYPE html> +<html> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <input class='invalid' id='i' type='radio' required> + <input class='notinvalid' type='radio'> <!-- adding this one so we don't have to create a second ref --> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-radio-ref.html b/layout/reftests/css-invalid/input/input-radio-ref.html new file mode 100644 index 000000000..9abe06bca --- /dev/null +++ b/layout/reftests/css-invalid/input/input-radio-ref.html @@ -0,0 +1,8 @@ +<!DOCTYPE html> +<html> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <input type='radio' class='ref'> + <input type='radio' class='ref'> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-radio-required.html b/layout/reftests/css-invalid/input/input-radio-required.html new file mode 100644 index 000000000..1faaedc13 --- /dev/null +++ b/layout/reftests/css-invalid/input/input-radio-required.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html> + <!-- Test: if one radio in a group has the required attribute and no radio is + checked, all radio in the group should suffer from being missing. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <input class='invalid' id='i1' name='foo' type='radio' required> + <input class='invalid' id='i2' name='foo' type='radio'> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-readonly.html b/layout/reftests/css-invalid/input/input-readonly.html new file mode 100644 index 000000000..4aebf0026 --- /dev/null +++ b/layout/reftests/css-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 :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-invalid/input/input-ref.html b/layout/reftests/css-invalid/input/input-ref.html new file mode 100644 index 000000000..ad0de3cfb --- /dev/null +++ b/layout/reftests/css-invalid/input/input-ref.html @@ -0,0 +1,7 @@ +<!DOCTYPE html> +<html> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <input class='ref'> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-required-invalid.html b/layout/reftests/css-invalid/input/input-required-invalid.html new file mode 100644 index 000000000..eea8eb240 --- /dev/null +++ b/layout/reftests/css-invalid/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 be affected by :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <input class='invalid' required> + </body> +</html> + diff --git a/layout/reftests/css-invalid/input/input-required-valid.html b/layout/reftests/css-invalid/input/input-required-valid.html new file mode 100644 index 000000000..bde7d22aa --- /dev/null +++ b/layout/reftests/css-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 :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-invalid/input/input-reset.html b/layout/reftests/css-invalid/input/input-reset.html new file mode 100644 index 000000000..04d02f9e4 --- /dev/null +++ b/layout/reftests/css-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 :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-invalid/input/input-submit-ref.html b/layout/reftests/css-invalid/input/input-submit-ref.html new file mode 100644 index 000000000..a1a0aa7fb --- /dev/null +++ b/layout/reftests/css-invalid/input/input-submit-ref.html @@ -0,0 +1,7 @@ +<!DOCTYPE html> +<html> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <input type='submit' class='ref'> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-submit.html b/layout/reftests/css-invalid/input/input-submit.html new file mode 100644 index 000000000..180235bb6 --- /dev/null +++ b/layout/reftests/css-invalid/input/input-submit.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 :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <input class='notinvalid' type='submit'> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-type-barred.html b/layout/reftests/css-invalid/input/input-type-barred.html new file mode 100644 index 000000000..ac99c0f25 --- /dev/null +++ b/layout/reftests/css-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 :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-invalid/input/input-type-invalid.html b/layout/reftests/css-invalid/input/input-type-invalid.html new file mode 100644 index 000000000..e37173ede --- /dev/null +++ b/layout/reftests/css-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, false); + </script> + <body> + <input class='invalid' type='button' id='i'> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-url-invalid.html b/layout/reftests/css-invalid/input/input-url-invalid.html new file mode 100644 index 000000000..6df386a56 --- /dev/null +++ b/layout/reftests/css-invalid/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 be affected by :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <input class='invalid' type='url' value='foo'> + </body> +</html> + diff --git a/layout/reftests/css-invalid/input/input-url-ref.html b/layout/reftests/css-invalid/input/input-url-ref.html new file mode 100644 index 000000000..387a384d6 --- /dev/null +++ b/layout/reftests/css-invalid/input/input-url-ref.html @@ -0,0 +1,7 @@ +<!DOCTYPE html> +<html> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <input value='http://mozilla.org/' class='ref'> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-url-valid.html b/layout/reftests/css-invalid/input/input-url-valid.html new file mode 100644 index 000000000..08162538a --- /dev/null +++ b/layout/reftests/css-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 :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-invalid/input/input-valid.html b/layout/reftests/css-invalid/input/input-valid.html new file mode 100644 index 000000000..9b8e0e039 --- /dev/null +++ b/layout/reftests/css-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 :invalid pseudo-class. --> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <input class='notinvalid'> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/input-withtext-ref.html b/layout/reftests/css-invalid/input/input-withtext-ref.html new file mode 100644 index 000000000..1b4e93b00 --- /dev/null +++ b/layout/reftests/css-invalid/input/input-withtext-ref.html @@ -0,0 +1,7 @@ +<!DOCTYPE html> +<html> + <link rel='stylesheet' type='text/css' href='style.css'> + <body> + <input value='foo' class='ref'> + </body> +</html> diff --git a/layout/reftests/css-invalid/input/reftest-stylo.list b/layout/reftests/css-invalid/input/reftest-stylo.list new file mode 100644 index 000000000..dc9dc5e8c --- /dev/null +++ b/layout/reftests/css-invalid/input/reftest-stylo.list @@ -0,0 +1,38 @@ +# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing +== input-valid.html input-valid.html +fuzzy-if(skiaContent,2,10) == input-customerror.html input-customerror.html +skip-if(B2G||Mulet) == input-disabled.html input-disabled.html +# Initial mulet triage: parity with B2G/B2G Desktop +skip-if(B2G||Mulet) == input-dyn-disabled.html input-dyn-disabled.html +# Initial mulet triage: parity with B2G/B2G Desktop +== input-dyn-not-disabled.html input-dyn-not-disabled.html +== input-readonly.html input-readonly.html +== input-dyn-readonly.html input-dyn-readonly.html +== input-dyn-not-readonly.html input-dyn-not-readonly.html +skip == input-maxlength-valid.html input-maxlength-valid.html +skip == input-maxlength-invalid.html input-maxlength-invalid.html +== input-required-valid.html input-required-valid.html +== input-required-invalid.html input-required-invalid.html +== input-button.html input-button.html +skip == input-reset.html input-reset.html +== input-email-invalid.html input-email-invalid.html +== input-email-valid.html input-email-valid.html +== input-url-invalid.html input-url-invalid.html +== input-url-valid.html input-url-valid.html +== input-pattern-valid.html input-pattern-valid.html +== input-pattern-invalid.html input-pattern-invalid.html +== input-type-barred.html input-type-barred.html +== input-type-invalid.html input-type-invalid.html +== input-disabled-fieldset-1.html input-disabled-fieldset-1.html +== input-disabled-fieldset-2.html input-disabled-fieldset-2.html +skip == input-fieldset-legend.html input-fieldset-legend.html +== input-radio-required.html input-radio-required.html +fuzzy-if(skiaContent,2,10) == input-radio-customerror.html input-radio-customerror.html +fuzzy-if(skiaContent,2,10) == input-radio-dyn-valid-1.html input-radio-dyn-valid-1.html +fuzzy-if(skiaContent,2,10) == input-radio-dyn-valid-2.html input-radio-dyn-valid-2.html +fuzzy-if(skiaContent,2,10) == input-radio-nogroup-required-valid.html input-radio-nogroup-required-valid.html +fuzzy-if(skiaContent,2,10) == input-radio-nogroup-required-invalid.html input-radio-nogroup-required-invalid.html +skip == input-radio-focus-click.html input-radio-focus-click.html +== input-submit.html input-submit.html +== input-image.html input-image.html +# input type='hidden' shouldn't show diff --git a/layout/reftests/css-invalid/input/reftest.list b/layout/reftests/css-invalid/input/reftest.list new file mode 100644 index 000000000..2064ad16c --- /dev/null +++ b/layout/reftests/css-invalid/input/reftest.list @@ -0,0 +1,33 @@ +== input-valid.html input-ref.html +fuzzy(11,4) fuzzy-if(skiaContent,2,10) == input-customerror.html input-ref.html +== input-disabled.html input-ref.html +== input-dyn-disabled.html input-ref.html +== input-dyn-not-disabled.html input-ref.html +== input-readonly.html input-ref.html +== input-dyn-readonly.html input-ref.html +== input-dyn-not-readonly.html input-ref.html +== input-required-valid.html input-withtext-ref.html +== 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-url-invalid.html input-withtext-ref.html +== input-url-valid.html input-url-ref.html +== input-pattern-valid.html input-withtext-ref.html +== input-pattern-invalid.html input-withtext-ref.html +== input-type-barred.html input-button-ref.html +fuzzy(11,4) == input-type-invalid.html input-ref.html +== input-disabled-fieldset-1.html input-fieldset-ref.html +== input-disabled-fieldset-2.html input-fieldset-ref.html +== input-fieldset-legend.html input-fieldset-legend-ref.html +== input-radio-required.html input-radio-ref.html +fuzzy-if(skiaContent,2,10) == input-radio-customerror.html input-radio-ref.html +fuzzy-if(skiaContent,2,10) == input-radio-dyn-valid-1.html input-radio-checked-ref.html +fuzzy-if(skiaContent,2,10) == input-radio-dyn-valid-2.html input-radio-ref.html +fuzzy-if(skiaContent,2,10) == input-radio-nogroup-required-valid.html input-radio-ref.html +fuzzy-if(skiaContent,2,10) == input-radio-nogroup-required-invalid.html input-radio-checked-ref.html +fuzzy-if(skiaContent,2,10) == input-radio-focus-click.html input-radio-ref.html +== input-submit.html input-submit-ref.html +== input-image.html input-image-ref.html +# input type='hidden' shouldn't show diff --git a/layout/reftests/css-invalid/input/style.css b/layout/reftests/css-invalid/input/style.css new file mode 100644 index 000000000..e3e221a26 --- /dev/null +++ b/layout/reftests/css-invalid/input/style.css @@ -0,0 +1,26 @@ +/* Override default style */ +input { + -moz-appearance: none; + background: none; +} +input:invalid { + box-shadow: none; +} + +input.notinvalid { + box-shadow: 0 0 1.5px 1px green; +} +input.notinvalid:invalid { + box-shadow: 0 0 1.5px 1px red; +} + +input.invalid { + box-shadow: 0 0 1.5px 1px red; +} +input.invalid:invalid { + box-shadow: 0 0 1.5px 1px green; +} + +input.ref { + box-shadow: 0 0 1.5px 1px green; +} |