<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 & :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 & :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@lists.webkit.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>webkit@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&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 <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 <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">> 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 [...]</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">> 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">> 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">> If an element is **disabled**, it is **barred from constraint validation**.</span >
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.</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>