From 4de2de0492d769d03733b256b9c6990995e6984e Mon Sep 17 00:00:00 2001 From: Mounir Lamouri Date: Wed, 24 Nov 2010 11:13:05 +0100 Subject: [PATCH] Bug 613249 - should have :-moz-ui-invalid and :-moz-ui-valid applying. r=bz a=jst --HG-- rename : layout/reftests/css-invalid/output/output-invalid.html => layout/reftests/css-ui-invalid/output/output-invalid.html rename : layout/reftests/css-invalid/output/output-ref.html => layout/reftests/css-ui-invalid/output/output-ref.html rename : layout/reftests/css-invalid/output/output-valid.html => layout/reftests/css-ui-invalid/output/output-valid.html rename : layout/reftests/css-invalid/output/reftest.list => layout/reftests/css-ui-invalid/output/reftest.list rename : layout/reftests/css-invalid/output/style.css => layout/reftests/css-ui-invalid/output/style.css rename : layout/reftests/css-valid/output/output-invalid.html => layout/reftests/css-ui-valid/output/output-invalid.html rename : layout/reftests/css-valid/output/output-ref.html => layout/reftests/css-ui-valid/output/output-ref.html rename : layout/reftests/css-valid/output/output-valid.html => layout/reftests/css-ui-valid/output/output-valid.html rename : layout/reftests/css-valid/output/reftest.list => layout/reftests/css-ui-valid/output/reftest.list rename : layout/reftests/css-valid/output/style.css => layout/reftests/css-ui-valid/output/style.css --- .../html/content/src/nsHTMLOutputElement.cpp | 7 ++++-- content/html/content/test/test_bug612730.html | 4 ++-- .../default-style/output-ref.html | 7 ++++++ .../css-ui-invalid/default-style/output.html | 13 +++++++++++ .../css-ui-invalid/default-style/reftest.list | 1 + .../css-ui-invalid/default-style/style.css | 6 ++++- .../css-ui-invalid/output/output-invalid.html | 9 ++++++++ .../css-ui-invalid/output/output-ref.html | 7 ++++++ .../css-ui-invalid/output/output-valid.html | 9 ++++++++ .../css-ui-invalid/output/reftest.list | 2 ++ .../reftests/css-ui-invalid/output/style.css | 22 +++++++++++++++++++ layout/reftests/css-ui-invalid/reftest.list | 1 + .../css-ui-valid/output/output-invalid.html | 9 ++++++++ .../css-ui-valid/output/output-ref.html | 7 ++++++ .../css-ui-valid/output/output-valid.html | 9 ++++++++ .../reftests/css-ui-valid/output/reftest.list | 2 ++ layout/reftests/css-ui-valid/output/style.css | 22 +++++++++++++++++++ layout/reftests/css-ui-valid/reftest.list | 1 + layout/style/forms.css | 2 +- 19 files changed, 134 insertions(+), 6 deletions(-) create mode 100644 layout/reftests/css-ui-invalid/default-style/output-ref.html create mode 100644 layout/reftests/css-ui-invalid/default-style/output.html create mode 100644 layout/reftests/css-ui-invalid/output/output-invalid.html create mode 100644 layout/reftests/css-ui-invalid/output/output-ref.html create mode 100644 layout/reftests/css-ui-invalid/output/output-valid.html create mode 100644 layout/reftests/css-ui-invalid/output/reftest.list create mode 100644 layout/reftests/css-ui-invalid/output/style.css create mode 100644 layout/reftests/css-ui-valid/output/output-invalid.html create mode 100644 layout/reftests/css-ui-valid/output/output-ref.html create mode 100644 layout/reftests/css-ui-valid/output/output-valid.html create mode 100644 layout/reftests/css-ui-valid/output/reftest.list create mode 100644 layout/reftests/css-ui-valid/output/style.css diff --git a/content/html/content/src/nsHTMLOutputElement.cpp b/content/html/content/src/nsHTMLOutputElement.cpp index 5918a7b5e4f4..2b8d394dd1f0 100644 --- a/content/html/content/src/nsHTMLOutputElement.cpp +++ b/content/html/content/src/nsHTMLOutputElement.cpp @@ -160,7 +160,9 @@ nsHTMLOutputElement::SetCustomValidity(const nsAString& aError) if (doc) { MOZ_AUTO_DOC_UPDATE(doc, UPDATE_CONTENT_STATE, PR_TRUE); doc->ContentStatesChanged(this, nsnull, NS_EVENT_STATE_INVALID | - NS_EVENT_STATE_VALID); + NS_EVENT_STATE_VALID | + NS_EVENT_STATE_MOZ_UI_INVALID | + NS_EVENT_STATE_MOZ_UI_VALID); } return NS_OK; @@ -204,7 +206,8 @@ nsHTMLOutputElement::IntrinsicState() const // We don't have to call IsCandidateForConstraintValidation() // because can't be barred from constraint validation. - states |= IsValid() ? NS_EVENT_STATE_VALID : NS_EVENT_STATE_INVALID; + states |= IsValid() ? NS_EVENT_STATE_VALID | NS_EVENT_STATE_MOZ_UI_VALID + : NS_EVENT_STATE_INVALID | NS_EVENT_STATE_MOZ_UI_INVALID; return states; } diff --git a/content/html/content/test/test_bug612730.html b/content/html/content/test/test_bug612730.html index 91135262178d..94816f3b497f 100644 --- a/content/html/content/test/test_bug612730.html +++ b/content/html/content/test/test_bug612730.html @@ -37,8 +37,8 @@ function runTest() ok(!select.mozMatchesSelector(":-moz-ui-valid"), ":-moz-ui-valid should not apply"); - ok(!select.mozMatchesSelector(":-moz-ui-invalid"), - ":-moz-ui-invalid should not apply"); + todo(!select.mozMatchesSelector(":-moz-ui-invalid"), + ":-moz-ui-invalid should not apply"); SimpleTest.finish(); }, false); diff --git a/layout/reftests/css-ui-invalid/default-style/output-ref.html b/layout/reftests/css-ui-invalid/default-style/output-ref.html new file mode 100644 index 000000000000..f1ab90bc6471 --- /dev/null +++ b/layout/reftests/css-ui-invalid/default-style/output-ref.html @@ -0,0 +1,7 @@ + + + + + foo + + diff --git a/layout/reftests/css-ui-invalid/default-style/output.html b/layout/reftests/css-ui-invalid/default-style/output.html new file mode 100644 index 000000000000..6da555bbf19b --- /dev/null +++ b/layout/reftests/css-ui-invalid/default-style/output.html @@ -0,0 +1,13 @@ + + + + + foo + + diff --git a/layout/reftests/css-ui-invalid/default-style/reftest.list b/layout/reftests/css-ui-invalid/default-style/reftest.list index 3ce4650a6b63..4785c8ba1bea 100644 --- a/layout/reftests/css-ui-invalid/default-style/reftest.list +++ b/layout/reftests/css-ui-invalid/default-style/reftest.list @@ -3,3 +3,4 @@ == textarea.html textarea-ref.html == select.html select-ref.html == fieldset.html fieldset-ref.html +== output.html output-ref.html diff --git a/layout/reftests/css-ui-invalid/default-style/style.css b/layout/reftests/css-ui-invalid/default-style/style.css index 20cf1d8e16a1..298c96935225 100644 --- a/layout/reftests/css-ui-invalid/default-style/style.css +++ b/layout/reftests/css-ui-invalid/default-style/style.css @@ -1,6 +1,10 @@ -.invalid-ref { +:not(output).invalid-ref { box-shadow: 0 0 1.5px 1px red; } +output.invalid-ref { + color: red; +} + .barred-ref { } diff --git a/layout/reftests/css-ui-invalid/output/output-invalid.html b/layout/reftests/css-ui-invalid/output/output-invalid.html new file mode 100644 index 000000000000..1a5dd93577df --- /dev/null +++ b/layout/reftests/css-ui-invalid/output/output-invalid.html @@ -0,0 +1,9 @@ + + + + + + foo + + diff --git a/layout/reftests/css-ui-invalid/output/output-ref.html b/layout/reftests/css-ui-invalid/output/output-ref.html new file mode 100644 index 000000000000..0db2c440c753 --- /dev/null +++ b/layout/reftests/css-ui-invalid/output/output-ref.html @@ -0,0 +1,7 @@ + + + + + foo + + diff --git a/layout/reftests/css-ui-invalid/output/output-valid.html b/layout/reftests/css-ui-invalid/output/output-valid.html new file mode 100644 index 000000000000..feb564da9dc3 --- /dev/null +++ b/layout/reftests/css-ui-invalid/output/output-valid.html @@ -0,0 +1,9 @@ + + + + + + foo + + diff --git a/layout/reftests/css-ui-invalid/output/reftest.list b/layout/reftests/css-ui-invalid/output/reftest.list new file mode 100644 index 000000000000..74468e394a3d --- /dev/null +++ b/layout/reftests/css-ui-invalid/output/reftest.list @@ -0,0 +1,2 @@ +== output-valid.html output-ref.html +== output-invalid.html output-ref.html diff --git a/layout/reftests/css-ui-invalid/output/style.css b/layout/reftests/css-ui-invalid/output/style.css new file mode 100644 index 000000000000..e600dda9ae2e --- /dev/null +++ b/layout/reftests/css-ui-invalid/output/style.css @@ -0,0 +1,22 @@ +/* Override default style */ +output { + color: black; +} + +output.notinvalid { + color: green; +} +output.notinvalid:-moz-ui-invalid { + color: red; +} + +output.invalid { + color: red; +} +output.invalid:-moz-ui-invalid { + color: green; +} + +output.ref { + color: green; +} diff --git a/layout/reftests/css-ui-invalid/reftest.list b/layout/reftests/css-ui-invalid/reftest.list index 6f7cc14e327e..4563deee70c5 100644 --- a/layout/reftests/css-ui-invalid/reftest.list +++ b/layout/reftests/css-ui-invalid/reftest.list @@ -3,6 +3,7 @@ include button/reftest.list include input/reftest.list include select/reftest.list include textarea/reftest.list +include output/reftest.list # default :-moz-ui-invalid style include default-style/reftest.list diff --git a/layout/reftests/css-ui-valid/output/output-invalid.html b/layout/reftests/css-ui-valid/output/output-invalid.html new file mode 100644 index 000000000000..83e824350fcc --- /dev/null +++ b/layout/reftests/css-ui-valid/output/output-invalid.html @@ -0,0 +1,9 @@ + + + + + + foo + + diff --git a/layout/reftests/css-ui-valid/output/output-ref.html b/layout/reftests/css-ui-valid/output/output-ref.html new file mode 100644 index 000000000000..0db2c440c753 --- /dev/null +++ b/layout/reftests/css-ui-valid/output/output-ref.html @@ -0,0 +1,7 @@ + + + + + foo + + diff --git a/layout/reftests/css-ui-valid/output/output-valid.html b/layout/reftests/css-ui-valid/output/output-valid.html new file mode 100644 index 000000000000..9f7321dae784 --- /dev/null +++ b/layout/reftests/css-ui-valid/output/output-valid.html @@ -0,0 +1,9 @@ + + + + + + foo + + diff --git a/layout/reftests/css-ui-valid/output/reftest.list b/layout/reftests/css-ui-valid/output/reftest.list new file mode 100644 index 000000000000..74468e394a3d --- /dev/null +++ b/layout/reftests/css-ui-valid/output/reftest.list @@ -0,0 +1,2 @@ +== output-valid.html output-ref.html +== output-invalid.html output-ref.html diff --git a/layout/reftests/css-ui-valid/output/style.css b/layout/reftests/css-ui-valid/output/style.css new file mode 100644 index 000000000000..2e71a25d9970 --- /dev/null +++ b/layout/reftests/css-ui-valid/output/style.css @@ -0,0 +1,22 @@ +/* Override default style */ +output { + color: black; +} + +output.notvalid { + color: green; +} +output.notvalid:-moz-ui-valid { + color: red; +} + +output.valid { + color: red; +} +output.valid:-moz-ui-valid { + color: green; +} + +output.ref { + color: green; +} diff --git a/layout/reftests/css-ui-valid/reftest.list b/layout/reftests/css-ui-valid/reftest.list index b26667dc7929..5a765bd718f0 100644 --- a/layout/reftests/css-ui-valid/reftest.list +++ b/layout/reftests/css-ui-valid/reftest.list @@ -3,3 +3,4 @@ include button/reftest.list include input/reftest.list include select/reftest.list include textarea/reftest.list +include output/reftest.list diff --git a/layout/style/forms.css b/layout/style/forms.css index b73ec20238eb..9e3790228773 100644 --- a/layout/style/forms.css +++ b/layout/style/forms.css @@ -629,7 +629,7 @@ input[type="file"] > input[type="text"] { box-shadow: 0 0 1.5px 1px red; } -output:invalid { +output:-moz-ui-invalid { color: red; }