Bug 208682

Summary: Drag from a -webkit-user-select:none element should not start selection
Product: WebKit Reporter: Carlos Alberto Lopez Perez <clopez>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: benoit.rouleau, cdumez, esprehn+autocc, ews-watchlist, kangil.han, ntim, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 208677    
Attachments:
Description Flags
Patch ews-feeder: commit-queue-

Description Carlos Alberto Lopez Perez 2020-03-05 17:26:15 PST
The spec <https://www.w3.org/TR/css-ui-4/#propdef-user-select> is clear in this respect:
none
    The UA must not allow selections to be started in this element. 


So, as a fix to this consider merging chromium patch: https://chromium.googlesource.com/chromium/src/+/f6dcdcf4917ba56f5576ef7d5d11d869630d2760

Test case from https://bugs.chromium.org/p/chromium/issues/detail?id=481985
> Open http://jsbin.com/zufeva/1/
> Start dragging on the first box (-webkit-user-select:none) and drag into the second (no -webkit-user-select).
> IE and Firefox appear to implement their user-select variants differently where it controls whether selection can be STARTED.  So there, if you start in the first box, you won't select text anywhere.
Comment 1 Carlos Alberto Lopez Perez 2020-03-05 19:29:57 PST
(In reply to Carlos Alberto Lopez Perez from comment #0)
> 
> So, as a fix to this consider merging chromium patch:
> https://chromium.googlesource.com/chromium/src/+/
> f6dcdcf4917ba56f5576ef7d5d11d869630d2760
> 

This fix can't be merged as such. It causes issues on the web-inspector, the text on the console becomes non selectable. The same happened on chromium after merging it (it was reverted later). See: https://bugs.chromium.org/p/chromium/issues/detail?id=615227
Comment 2 Radar WebKit Bug Importer 2022-04-19 06:11:45 PDT
<rdar://problem/91955574>
Comment 3 Tim Nguyen (:ntim) 2022-04-19 11:06:43 PDT
Created attachment 457916 [details]
Patch
Comment 4 Tim Nguyen (:ntim) 2022-04-19 11:07:09 PDT
The Web inspector issue is still reproducible.
Comment 5 Tim Nguyen (:ntim) 2022-04-19 11:07:51 PDT
STR for the WI issue:
1) Open DevTools, open Console
2) "window" and press enter
3) Try to select the logged text by clicking and dragging