:in-range & :out-of-range CSS pseudo-classes shouldn't match disabled or readonly inputs
Reported by
cvreb...@gmail.com,
Apr 12 2016
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36 Steps to reproduce the problem: 1. Open the attached testcase webpage in Chrome. 2. Observe the colors of the outlines of the <input>s. What is the expected behavior? The outlines should be green, indicating that the disabled or readonly <input type=number>s did not match the :in-range or :out-of-range CSS pseudo-classes. What went wrong? The outlines are orange and red, indicating that the disabled or readonly <input type=number>s matched the :in-range or :out-of-range CSS pseudo-classes. Did this work before? N/A Chrome version: 52.0.2705.0 Channel: canary OS Version: OS X 10.11.4 Flash Version: Shockwave Flash 21.0 r0 Based on my reading of the HTML spec, :in-range and :out-of-range should never apply to disabled or readonly <input>s. Per https://html.spec.whatwg.org/multipage/scripting.html#selector-in-range > The :in-range pseudo-class must match all elements that are **candidates for constraint validation**, have range limitations, and [...] > The :out-of-range pseudo-class must match all elements that are **candidates for constraint validation**, have range limitations, and [...] Per https://html.spec.whatwg.org/multipage/forms.html#candidate-for-constraint-validation > A submittable element is a **candidate for constraint validation** except when a condition has **barred the element from constraint validation**. Per https://html.spec.whatwg.org/multipage/forms.html#the-readonly-attribute:barred-from-constraint-validation > If the **readonly** attribute is specified on an input element, the element is **barred from constraint validation**. Per https://html.spec.whatwg.org/multipage/forms.html#enabling-and-disabling-form-controls:-the-disabled-attribute:barred-from-constraint-validation > If an element is **disabled**, it is **barred from constraint validation**. Thus, disabled and readonly <input>s are barred from constraint validation, meaning they are not candidates for constraint validation, thus causing them to be disqualified by the 1st of the 3 conditions which are required for an element to match :in-range or :out-of-range.
,
Apr 13 2016
The spec references look valid to me. Firefox has the same issue. Did you report this for Firefox as well?
,
Apr 13 2016
Found it here: https://bugzilla.mozilla.org/show_bug.cgi?id=1264157
,
Apr 13 2016
I can guarantee I won't get to this.
,
Apr 13 2016
,
Apr 13 2016
,
Apr 13 2016
See also Issue 603268
,
Apr 14 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/cb289485c838f65f92a48813704b7671388c6c62 commit cb289485c838f65f92a48813704b7671388c6c62 Author: rune <rune@opera.com> Date: Thu Apr 14 07:46:34 2016 Check willValidate() for :in-range and :out-of-range. :in-range and :out-of-range should only match elements which are candidates for constraint validation[1], and they are not when they are disabled or read-only. https://html.spec.whatwg.org/multipage/scripting.html#selector-in-range R=tkent@chromium.org BUG= 602568 Review URL: https://codereview.chromium.org/1890633002 Cr-Commit-Position: refs/heads/master@{#387258} [delete] https://crrev.com/d03ae7a55e5f914eff4683634cc13354ceb1eac1/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/selectors/pseudo-classes/inrange-outofrange-expected.txt [modify] https://crrev.com/cb289485c838f65f92a48813704b7671388c6c62/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
,
Apr 14 2016
,
Apr 14 2016
|
||||
►
Sign in to add a comment |
||||
Comment 1 by ellyjo...@chromium.org
, Apr 12 2016Labels: -OS-Mac
Owner: thakis@chromium.org
Status: Assigned (was: Unconfirmed)