[Webkit-unassigned] [Bug 156530] New: :in-range & :out-of-range CSS pseudo-classes shouldn't match disabled or readonly inputs

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 12 20:07:54 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=156530

            Bug ID: 156530
           Summary: :in-range & :out-of-range CSS pseudo-classes shouldn't
                    match disabled or readonly inputs
    Classification: Unclassified
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: webkit at chrisrebert.com

Created attachment 276300
  --> https://bugs.webkit.org/attachment.cgi?id=276300&action=review
Testcase demonstrating the bug

Steps to reproduce the problem:
1. Open the attached testcase webpage in WebKit Nightly.
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.

----

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160413/2860b786/attachment-0001.html>


More information about the webkit-unassigned mailing list