Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:read-only and :read-write selectors: Consistency and cross-UA behavior #3501

Closed
js-choi opened this issue Feb 23, 2018 · 4 comments
Closed
Assignees
Labels
compat Standard is not web compatible or proprietary feature needs standardizing interop Implementations are not interoperable with each other normative change topic: forms

Comments

@js-choi
Copy link

js-choi commented Feb 23, 2018

This is a cross-post of w3c/csswg-drafts#127 by @cvrebert, because its issues are more relevant to HTML than to CSS.

Copying this over from http://lists.w3.org/Archives/Public/www-style/2016Apr/0294.html
(Disclaimer: My opinions are my own, not my employer's.)

:read-only is currently spec'd as (basically) :not(:read-write), and :read-write is currently spec'd as matching:

  • <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 do not have a readonly attribute, and that are not disabled
  • elements that are editing hosts or editable and are neither <input> elements nor <textarea> elements (i.e. contentEditable / designMode)

(A) This leads to an anomaly: Some inputs that the user can interact with to alter their "value" (which most folks would thus casually deem "writable") match :read-only instead of :read-write.
Namely, <input>s of type range, color, checkbox, radio, and file are :read-only since the readonly attribute doesn't apply to them.
(One can argue that this is a bug in HTML and that HTML should just allow the readonly attribute on these input types.)

(B) There's a question of whether the buttonish <input>s (types: image, submit, reset, button) should be :read-only or :read-write. Arguably, they should be :read-only since the user cannot normally directly modify their values. They are interactive insofar as they're clickable, but they aren't editable. However, Chrome and Edge currently have them matching :read-write, which doesn't conform with the current spec.

(C) There's a question of whether <input type="hidden"> should match :read-only or :read-write or neither. Per spec, it currently matches :read-only. But in Chrome and Edge, it currently matches :read-write.

(D) I think there's some question as to how useful the contentEditable case is, particularly when it's lumped together with the form input cases.


Current state of affairs (FWICT):


And in light of the lack of compatibility and questions about the utility of these pseudos as-then-specd, it looks like Hixie asked the spec editors ~3 years ago in https://www.w3.org/Bugs/Public/show_bug.cgi?id=17812#c24 whether :read-only & :read-write could be removed from the spec altogether, but he never got a reply.

@js-choi
Copy link
Author

js-choi commented Feb 23, 2018

@cvrebert: Done. I think I fixed everything.

@annevk annevk added normative change needs implementer interest Moving the issue forward requires implementers to express interest labels Feb 24, 2018
@annevk annevk added compat Standard is not web compatible or proprietary feature needs standardizing interop Implementations are not interoperable with each other topic: forms and removed needs implementer interest Moving the issue forward requires implementers to express interest labels Oct 21, 2019
@annevk
Copy link
Member

annevk commented Oct 21, 2019

In that bug I see @tabatkins arguing for a slightly different definition as well, whereby, e.g., <select> is also matched. Any change at this point though needs implementer buy-in given how close everyone is relative to the standard.

cc @whatwg/css

@emilio
Copy link
Contributor

emilio commented May 14, 2020

So Safari is shipping the spec afaict. I'm fixing Gecko to follow the spec and unprefix the pseudo-classes, and I reopened https://bugs.chromium.org/p/chromium/issues/detail?id=255351.

So this can probably be closed for now if there's nobody actively working on changing the spec further?

@rniwa
Copy link

rniwa commented Aug 11, 2020

Can we close this issue given Gecko is aligning their behavior to WebKit's, and WebKit has no intention of changing it. Or is Google / Blink strongly objecting to the current behavior?

@annevk annevk added the agenda+ To be discussed at a triage meeting label May 10, 2021
@annevk annevk closed this as completed Jun 3, 2021
@annevk annevk removed the agenda+ To be discussed at a triage meeting label Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compat Standard is not web compatible or proprietary feature needs standardizing interop Implementations are not interoperable with each other normative change topic: forms
Development

No branches or pull requests

6 participants