Closed Bug 1518339 Opened 5 years ago Closed 5 years ago

user-select: none prevents selection in editable stuff in Gecko, but not in WebKit / Blink.

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Attached file Testcase

See test-case. We prevent selection even for editable stuff, but WebKit doesn't.

This is the underlying issue of bug 1511391.

Attachment #9034870 - Attachment mime type: text/plain → text/html

Mats, wdyt?

Would you be fine gating selection on both -moz-user-select and -moz-user-modify, so that -moz-user-modify: read-write always implies selectability?

Maybe other ideas? Or maybe we should file a Blink bug instead?

Meant to ni? for comment 1.

Flags: needinfo?(mats)

It seems cleaner to keep the properties orthogonal and true to their meaning.

Could we fix it by adding something like "[contenteditable=true] { -moz-user-select: text }" in the UA sheet instead?
Alternatively, hack "​UsedUserSelect" to stop the "inheritance" at an "independent selection" boundary?

Flags: needinfo?(mats)
This is the closest to the spec behavior, I think, and less likely to
cause interop issues, but if you prefer me to stop the 'inheritance' chain at
contenteditable elements or what not I can also do that.

This looks fine, but I'd prefer to add the IsEditingHost block after
the "style != StyleUserSelect::Auto" block, so that it's possible to
override it by explicitly setting a non-auto value on the editable element.
That's not what the spec currently says, but it's what you suggest in
https://github.com/w3c/csswg-drafts/issues/3344, right?

Attachment #9035085 - Attachment description: Bug 1518339 - Force the used value of user-select to be text for editing roots. → Bug 1518339 - Make user-select: auto behave like user-select: text for editing roots.

(In reply to Mats Palmgren (:mats) from comment #6)

This looks fine, but I'd prefer to add the IsEditingHost block after
the "style != StyleUserSelect::Auto" block, so that it's possible to
override it by explicitly setting a non-auto value on the editable element.
That's not what the spec currently says, but it's what you suggest in
https://github.com/w3c/csswg-drafts/issues/3344, right?

Yeah, I agree that's better over-all. Done :)

Assignee: nobody → emilio

Thanks. Yeah, it's easy to change if #3344 comes to a different consensus,
but for now this is good since it also allows us to see if it's web-compatible.

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0bacb9f000cc
Make user-select: auto behave like user-select: text for editing roots. r=mats
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
Blocks: 1526393
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: