<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - :in-range &amp; :out-of-range CSS pseudo-classes shouldn't match disabled or readonly inputs"
   href="https://bugs.webkit.org/show_bug.cgi?id=156530">156530</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>:in-range &amp; :out-of-range CSS pseudo-classes shouldn't match disabled or readonly inputs
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>CSS
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>webkit&#64;chrisrebert.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=276300" name="attach_276300" title="Testcase demonstrating the bug">attachment 276300</a> <a href="attachment.cgi?id=276300&amp;action=edit" title="Testcase demonstrating the bug">[details]</a></span>
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 &lt;input&gt;s.

What is the expected behavior?
The outlines should be green, indicating that the disabled or readonly &lt;input type=number&gt;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 &lt;input type=number&gt;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 &lt;input&gt;s.

Per <a href="https://html.spec.whatwg.org/multipage/scripting.html#selector-in-range">https://html.spec.whatwg.org/multipage/scripting.html#selector-in-range</a>
<span class="quote">&gt; The :in-range pseudo-class must match all elements that are **candidates for constraint validation**, have range limitations, and [...]
&gt; The :out-of-range pseudo-class must match all elements that are **candidates for constraint validation**, have range limitations, and  [...]</span >

Per <a href="https://html.spec.whatwg.org/multipage/forms.html#candidate-for-constraint-validation">https://html.spec.whatwg.org/multipage/forms.html#candidate-for-constraint-validation</a>
<span class="quote">&gt; A submittable element is a **candidate for constraint validation** except when a condition has **barred the element from constraint validation**.</span >

Per <a href="https://html.spec.whatwg.org/multipage/forms.html#the-readonly-attribute:barred-from-constraint-validation">https://html.spec.whatwg.org/multipage/forms.html#the-readonly-attribute:barred-from-constraint-validation</a>
<span class="quote">&gt; If the **readonly** attribute is specified on an input element, the element is **barred from constraint validation**.</span >

Per <a href="https://html.spec.whatwg.org/multipage/forms.html#enabling-and-disabling-form-controls:-the-disabled-attribute:barred-from-constraint-validation">https://html.spec.whatwg.org/multipage/forms.html#enabling-and-disabling-form-controls:-the-disabled-attribute:barred-from-constraint-validation</a>
<span class="quote">&gt; If an element is **disabled**, it is **barred from constraint validation**.</span >

Thus, disabled and readonly &lt;input&gt;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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>