:in-range & :out-of-range CSS pseudo-classes shouldn't match disabled or readonly...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Jun 2016 05:19:29 +0000 (05:19 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Jun 2016 05:19:29 +0000 (05:19 +0000)
commite2101764b6de296765ffaef5f8c0c8716c9b6c2c
tree69e4c40182f0062e95d3cd4ef7b0eabe3dd420e5
parentfa517f4aaa8278c542f4d456f8858bb518833f9d
:in-range & :out-of-range CSS pseudo-classes shouldn't match disabled or readonly inputs
https://bugs.webkit.org/show_bug.cgi?id=156530

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-06-16
Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/selectors/pseudo-classes/inrange-outofrange-expected.txt:

Source/WebCore:

Elements should only match :in-range and :out-of-range
when they are candidate for constraint validation.

Tests: fast/css/pseudo-in-range-on-disabled-input-basics.html
       fast/css/pseudo-in-range-on-readonly-input-basics.html
       fast/css/pseudo-in-range-out-of-range-on-disabled-input-trivial.html
       fast/css/pseudo-out-of-range-on-disabled-input-basics.html
       fast/css/pseudo-out-of-range-on-readonly-input-basics.html
       fast/selectors/in-range-out-of-range-style-update.html

* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::minOrMaxAttributeChanged):
* html/NumberInputType.cpp:
(WebCore::NumberInputType::minOrMaxAttributeChanged):
I forgot to handle style update in r202143.
This is covered by the new style invalidation test.

* html/BaseDateAndTimeInputType.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isInRange):
(WebCore::HTMLInputElement::isOutOfRange):

LayoutTests:

* fast/css/pseudo-in-range-on-disabled-input-basics-expected.html: Added.
* fast/css/pseudo-in-range-on-disabled-input-basics.html: Added.
* fast/css/pseudo-in-range-on-readonly-input-basics-expected.html: Added.
* fast/css/pseudo-in-range-on-readonly-input-basics.html: Added.
* fast/css/pseudo-in-range-out-of-range-on-disabled-input-trivial-expected.html: Added.
* fast/css/pseudo-in-range-out-of-range-on-disabled-input-trivial.html: Added.
* fast/css/pseudo-out-of-range-on-disabled-input-basics-expected.html: Added.
* fast/css/pseudo-out-of-range-on-disabled-input-basics.html: Added.
* fast/css/pseudo-out-of-range-on-readonly-input-basics-expected.html: Added.
* fast/css/pseudo-out-of-range-on-readonly-input-basics.html: Added.
* fast/selectors/in-range-out-of-range-style-update-expected.txt: Added.
* fast/selectors/in-range-out-of-range-style-update.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202159 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/pseudo-in-range-on-disabled-input-basics-expected.html [new file with mode: 0644]
LayoutTests/fast/css/pseudo-in-range-on-disabled-input-basics.html [new file with mode: 0644]
LayoutTests/fast/css/pseudo-in-range-on-readonly-input-basics-expected.html [new file with mode: 0644]
LayoutTests/fast/css/pseudo-in-range-on-readonly-input-basics.html [new file with mode: 0644]
LayoutTests/fast/css/pseudo-in-range-out-of-range-on-disabled-input-trivial-expected.html [new file with mode: 0644]
LayoutTests/fast/css/pseudo-in-range-out-of-range-on-disabled-input-trivial.html [new file with mode: 0644]
LayoutTests/fast/css/pseudo-out-of-range-on-disabled-input-basics-expected.html [new file with mode: 0644]
LayoutTests/fast/css/pseudo-out-of-range-on-disabled-input-basics.html [new file with mode: 0644]
LayoutTests/fast/css/pseudo-out-of-range-on-readonly-input-basics-expected.html [new file with mode: 0644]
LayoutTests/fast/css/pseudo-out-of-range-on-readonly-input-basics.html [new file with mode: 0644]
LayoutTests/fast/selectors/in-range-out-of-range-style-update-expected.txt [new file with mode: 0644]
LayoutTests/fast/selectors/in-range-out-of-range-style-update.html [new file with mode: 0644]
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/inrange-outofrange-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/html/BaseDateAndTimeInputType.cpp
Source/WebCore/html/BaseDateAndTimeInputType.h
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/NumberInputType.cpp