Bug 208677

Summary: unprefix -webkit-user-select
Product: WebKit Reporter: Carlos Alberto Lopez Perez <clopez>
Component: CSSAssignee: Tim Nguyen (:ntim) <ntim>
Status: REOPENED ---    
Severity: Normal CC: ahmad.saleem792, bfulgham, calvaris, cdumez, changseok, dev, emilio, eric.carlson, esprehn+autocc, ews-watchlist, glenn, gsnedders, gyuyoung.kim, jer.noble, joepeck, kai.hollberg, kangil.han, karlcow, macpherson, megan_gardner, menard, mjs, ntim, philipj, rik, rniwa, sebastianzartner, sergio, simon.fraser, the.bull, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar, WebExposed
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=244448
Bug Depends on: 208682, 239514, 242006, 80159, 82692, 118009, 119711, 242366    
Bug Blocks: 217522    
Attachments:
Description Flags
Patch
simon.fraser: review+, ews-feeder: commit-queue-
Patch
none
Patch
ews-feeder: commit-queue-
Patch
ntim: commit-queue-
[fast-cq] Patch none

Description Carlos Alberto Lopez Perez 2020-03-05 17:02:50 PST
I think we should unprefix -webkit-user-select.

Firefox and Chrome support this CSS property "user-select" (without prefix) since a while [1].

So, I think we should unprefix it and make -webkit-user-select an alias to it (which its also required by the spec: https://www.w3.org/TR/css-ui-4/#propdef-user-select )


[1]
https://bugzilla.mozilla.org/show_bug.cgi?id=1492739
https://bugs.chromium.org/p/chromium/issues/detail?id=461018
Comment 1 Maciej Stachowiak 2020-03-06 21:50:30 PST
Is there any behavior difference between what we have and the standard version?

(Also we might need to add the unprefixed but keep the prefixed for web compat).
Comment 2 Ryosuke Niwa 2020-03-06 22:23:59 PST
(In reply to Maciej Stachowiak from comment #1)
> Is there any behavior difference between what we have and the standard
> version?
> 
> (Also we might need to add the unprefixed but keep the prefixed for web
> compat).

All the bug in "See Also" are good start like copying behavior.
Comment 3 Sam Sneddon [:gsnedders] 2021-08-13 10:16:21 PDT
Given most web developers are largely blindly using -webkit-user-select alongside user-select today, do we need to block unprefixing on fixing our outstanding spec compliance issues?
Comment 4 Radar WebKit Bug Importer 2021-12-06 15:53:52 PST
<rdar://problem/86127924>
Comment 5 Tim Nguyen (:ntim) 2022-04-19 12:03:17 PDT
Created attachment 457923 [details]
Patch
Comment 6 Simon Fraser (smfr) 2022-04-19 12:13:38 PDT
Comment on attachment 457923 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=457923&action=review

Please unprefix in all the UA stylesheets.

> Source/WebCore/css/CSSProperties.json:7284
> +            "status": "experimental",

Still true?
Comment 7 Tim Nguyen (:ntim) 2022-04-19 12:27:49 PDT
Created attachment 457928 [details]
Patch
Comment 8 Tim Nguyen (:ntim) 2022-04-19 12:29:08 PDT
(In reply to Simon Fraser (smfr) from comment #6)
> Comment on attachment 457923 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=457923&action=review
> 
> Please unprefix in all the UA stylesheets.

Done.

> > Source/WebCore/css/CSSProperties.json:7284
> > +            "status": "experimental",
> 
> Still true?

It's still in CSS UI 4, not in level 3. Level 4 is an editor's draft, so I would consider it experimental.
Comment 9 Tim Nguyen (:ntim) 2022-04-19 12:29:21 PDT
Created attachment 457929 [details]
Patch
Comment 10 Ryosuke Niwa 2022-04-19 20:12:10 PDT
We should fix https://bugs.webkit.org/show_bug.cgi?id=80159 before unprefixing this.
Comment 11 Ryosuke Niwa 2022-04-19 20:13:17 PDT
(In reply to Tim Nguyen (:ntim) from comment #8)
> (In reply to Simon Fraser (smfr) from comment #6)
> > Comment on attachment 457923 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=457923&action=review
> > 
> > Please unprefix in all the UA stylesheets.
> 
> Done.
> 
> > > Source/WebCore/css/CSSProperties.json:7284
> > > +            "status": "experimental",
> > 
> > Still true?
> 
> It's still in CSS UI 4, not in level 3. Level 4 is an editor's draft, so I
> would consider it experimental.

I don't think the status of a spec matters much. If we're shipping it, and all other browsers have been shipping this feature, then for all practical purposes, it's a stable feature. There are enough web content dependent on this CSS property as is.
Comment 12 Tim Nguyen (:ntim) 2022-04-20 00:33:33 PDT
Created attachment 457965 [details]
Patch
Comment 13 Tim Nguyen (:ntim) 2022-04-20 00:37:31 PDT
Comment on attachment 457965 [details]
Patch

Just saw Ryosuke's comments
Comment 14 Tim Nguyen (:ntim) 2022-04-20 03:38:03 PDT
(In reply to Ryosuke Niwa from comment #10)
> We should fix https://bugs.webkit.org/show_bug.cgi?id=80159 before
> unprefixing this.

I don't think we should be blocking on this. FWIW, the spec says that `user-select: none` is not a copy protection mechanism. 

We should fix this as a followup, and it sounds like something around VisibleSelection might need to be adjusted.
Comment 15 Tim Nguyen (:ntim) 2022-04-20 03:39:56 PDT
Created attachment 457972 [details]
[fast-cq] Patch
Comment 16 EWS 2022-04-20 03:44:48 PDT
Committed r293089 (249800@main): <https://commits.webkit.org/249800@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 457972 [details].
Comment 17 Emilio Cobos Álvarez (:emilio) 2022-04-20 08:41:33 PDT
It seems unfortunate to unprefix this while keeping it as an inherited property instead of doing what the spec says (and Firefox does)?
Comment 18 Tim Nguyen (:ntim) 2022-04-21 03:00:44 PDT
(In reply to Emilio Cobos Álvarez (:emilio) from comment #17)
> It seems unfortunate to unprefix this while keeping it as an inherited
> property instead of doing what the spec says (and Firefox does)?

Fixing this in bug 239514
Comment 19 Wenson Hsieh 2022-06-25 13:22:07 PDT
So one interesting compat issue here is that we treat `user-select: all;` elements that would otherwise be editable as non-editable in (most) places in WebKit, whereas Firefox and Chrome don't (e.g. the fourth contenteditable div in whsieh.github.io/examples/user-select).

On iOS 16 beta, this causes the body field to be non-editable when composing an email in Outlook (outlook.live.com).
Comment 20 Tim Nguyen (:ntim) 2022-06-25 13:29:58 PDT
(In reply to Wenson Hsieh from comment #19)
> So one interesting compat issue here is that we treat `user-select: all;`
> elements that would otherwise be editable as non-editable in (most) places
> in WebKit, whereas Firefox and Chrome don't (e.g. the fourth contenteditable
> div in whsieh.github.io/examples/user-select).
> 
> On iOS 16 beta, this causes the body field to be non-editable when composing
> an email in Outlook (outlook.live.com).

Can you please file a new bug with a reduced testcase? That does seem like a bug to me.
Comment 21 Wenson Hsieh 2022-06-25 13:38:01 PDT
(In reply to Tim Nguyen (:ntim) from comment #20)
> (In reply to Wenson Hsieh from comment #19)
> > So one interesting compat issue here is that we treat `user-select: all;`
> > elements that would otherwise be editable as non-editable in (most) places
> > in WebKit, whereas Firefox and Chrome don't (e.g. the fourth contenteditable
> > div in whsieh.github.io/examples/user-select).
> > 
> > On iOS 16 beta, this causes the body field to be non-editable when composing
> > an email in Outlook (outlook.live.com).
> 
> Can you please file a new bug with a reduced testcase? That does seem like a
> bug to me.

Filed: <https://bugs.webkit.org/show_bug.cgi?id=242006>.

The reduced test case is just `<div contenteditable style='user-select: all;'>`.
Comment 23 Ahmad Saleem 2022-10-16 03:07:28 PDT
I think JIRA is also one of the product having this issue as below:

https://jira.atlassian.com/browse/JRACLOUD-76566

Specifically this comment - https://jira.atlassian.com/browse/JRACLOUD-76566?focusedCommentId=3136522&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-3136522

They are using inline CSS on span with "user-select: none;" and not "-webkit-user-select: none".

Just wanted to update. Thanks!