New issue
Advanced search Search tips

Issue 604154 link

Starred by 4 users

Issue metadata

Status: Duplicate
Merged: issue 255351
Owner: ----
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature



Sign in to add a comment

:read-only CSS pseudo-class should match inputs to which the readonly attribute does not apply

Reported by cvreb...@gmail.com, Apr 16 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36

Steps to reproduce the problem:
1. Open the attached testcase in Chrome.
2. Observe the background colors of the words "Green".

What is the expected behavior?
Their background colors should be green.
See attached Safari screenshot (which is correct except for the <input type="color"> because Safari doesn't yet support <input type="color"> and thus interprets it as <input type="text">).

What went wrong?
Their background colors are red, indicating that the <input>s in question did not match the :read-only CSS pseudo-class, even though they should according to the current spec.
See attached Chrome screenshot.

Did this work before? No 

Chrome version: 52.0.2709.0  Channel: canary
OS Version: OS X 10.11.4
Flash Version: Shockwave Flash 21.0 r0

The spec admittedly gives unintuitive results here. I'm just arguing about spec compliance, not about the (un)reasonableness of the spec.

https://html.spec.whatwg.org/multipage/scripting.html#selector-read-only
> The :read-only pseudo-class must match all other HTML elements [which don't match :read-write].

https://html.spec.whatwg.org/multipage/scripting.html#selector-read-write
> The :read-write pseudo-class must match any element falling into one of the following categories [...]:
> * <input> elements to which the `readonly` attribute applies, and that are mutable (i.e. that do not have the `readonly` attribute specified and that are not disabled)
> * <textarea> elements that [...]
> * elements that are editing hosts or editable and are neither input elements nor textarea elements

Per the table in https://html.spec.whatwg.org/multipage/forms.html#concept-input-apply ,
the `readonly` attribute does not apply to <input>s of type hidden, range, color, checkbox, radio, file, image, submit, reset, or button.
Thus, such <input>s don't match :read-write, and therefore must match :read-only.

Note that MS Edge currently suffers from the same bug, and Firefox doesn't currently implement :read-only or :read-write.
 
testcase-read-only.html
733 bytes View Download
safari-almost-correct.png
26.2 KB View Download
chrome-wrong.png
39.9 KB View Download
Components: Blink>CSS
Labels: -OS-Mac M-52 OS-All
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on Windows 7, Ubuntu 14.04 and Mac OS 10.11.4 using chrome latest canary M52-52.0.2710.0. Observed the background of the words are in red color. 

This is a non-regression issue seen from past M35-35.0.1851.0, Hence marking it as untriaged.
Issue 604117 has been merged into this issue.

Comment 3 by cvreb...@gmail.com, Apr 18 2016

Currently under discussion at https://github.com/w3c/web-platform-tests/pull/2843

Comment 4 by nainar@chromium.org, Apr 19 2016

Status: Available (was: Untriaged)

Comment 5 by cvreb...@gmail.com, Apr 20 2016

Now under discussion at CSSWG/www-style:
https://lists.w3.org/Archives/Public/www-style/2016Apr/0294.html

Comment 6 by makoto...@gmail.com, Apr 20 2016

Tamura-san says won't fix due to compatibility issue.
 https://crbug.com/255351 
Project Member

Comment 7 by sheriffbot@chromium.org, Jun 1 2016

Labels: -M-52 M-53 MovedFrom-52
Moving this nonessential bug to the next milestone.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 8 by sheriffbot@chromium.org, Jul 13 2016

Labels: -M-53 MovedFrom-53
This issue has been moved once and is lower than Pri-1. Removing the milestone.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: Hotlist-Interop
Labels: -Type-Bug Type-Feature
Mergedinto: 255351
Status: Duplicate (was: Available)

Sign in to add a comment