Join GitHub today
[css-ui-4] Readonly form control and user-select #285
Currently, for user-select, CSS UI 4 says
and it defines "editable elements" as
It seems this would exclude readonly form controls from the computation rule above, because according to the HTML Standard, readonly form controls are not mutable. But I think that rule should be applied to those controls as well.
This suggestion does seem to match the current behavior of UAs. If you create a
Do you have a suggestion for the phrasing? The following would probably work, but it looks a bit clunky:
"normally mutable but in non mutable state" is an attempt to include
Actually, UAs other than Gecko allow text in disabled form controls to be selected as well... And there is a bug which urges Gecko to follow that behavior... But I don't think that makes much sense so I opened an issue for Chromium, hoping they could change their behavior.
For phrasing, I don't have any idea... Otherwise I would have included that in my post :)
I wonder whether it makes more sense to use user agent stylesheet to do that, rather than making it a computation rule.
Yes, it can be selected, but the selection cannot escape the element.
The fact that this is true no only with readonly but also with disabled is why I used the "non mutable state" wording in the proposed phrasing, instead of specifically referring to the readonly attribute.
As for whether that should be done via computation or via UA stylesheet, that's a good question, but regardless of the answer, we should put the desired behavior in the spec.
This was referenced
Oct 12, 2016
Actually, I don't think we want to do this with the UA stylesheet, as that would mean that authors could override it, which may not be implementable, since form controls are often rendered with native elements, and having a selection extent from one to outside may not be doable.
So I suggestn going with the phrasing proposed in #285 (comment)
I've checked if we could simply say that it computes to contain on replaced elements in general, but that does not seem to be true, as for instance there's not contain effect on embedded svg.
The Working Group just discussed
The full IRC log of that discussion<dael> Topic: Readonly form control and user-select Agenda+ F2F css-ui-4
<dael> github: https://github.com//issues/285
<dael> florian: Recap: across all browsers afaict when you have editable text area regardles if form control or from contenteditable. When you start selection inside it it can't extend outside. Selection is trapped within
<dael> florian: This behavior is exposed in user-select as contain. Current spec says on editable elements it always does contain. Currently spec as editable content is mutable form controls and contenteditable elements. Moz raised that read-only form controls are not mutable so we should update spec
<dael> florian: Second part is once we do it for normally mutable but currently unmutable switching to user-select: none might be okay. Not clear how editing would work with selection disabled and no one wants to do that.
<dael> florian: So making contain apply to normally mutable but not currently mutable and then making contain switch to none for those.
<dael> florian: Should I wordsmith that into spec or do people think I missed something?
<dael> Rossen: Opinions?
<dael> Rossen: Objections to accepting florian's proposal to the spec?
<tantek> I'd prefer to get Xidorn's opinion
<dael> Rossen: I think it's time to force progress since it's gone through 3 F2Fs.
<tantek> can we discuss in APAC call?
<tantek> otherwise I do not object
<dael> Rossen: tantek xidorn can add his opinion on github.
<dael> florian: We're resolving in favor of his opinion
<dael> tantek: I'm asking that...florian if that's true can you put that into the issue? Just a back and forth to confirm. Why not make sure. You've got wordsmithing, put it in the issue, give xidorn a chance to say yes
<dael> florian: Can I put in PR and merge when he says okay?
<dael> tantek: Sure
<dael> RESOLVED: Accept florian's proposal
<dael> Rossen: Summary is form controls should be selectable?
<dael> florian: More complicated
<dael> florian: I'll create a PR with proposal and merge
<dael> Rossen: We'll look at your PR