Bug 119711 - Make CSS property user-select:none not to affect Document.caretRangeFromPoint()
Summary: Make CSS property user-select:none not to affect Document.caretRangeFromPoint()
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BlinkMergeCandidate
Depends on:
Blocks: 208677
  Show dependency treegraph
 
Reported: 2013-08-12 18:03 PDT by Ryosuke Niwa
Modified: 2023-05-19 10:18 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2013-08-12 18:03:48 PDT
Consider merging https://chromium.googlesource.com/chromium/blink/+/50bbb9f6ab3394327e8fa63312316e6ae217a7a2

This patch introduces PositionWithAffinity as return value of RenderObject::positionForPoint() for making CSS property user-select:none doesn't affect Document.caretRangeFromPoint() and changes caretRangeFromPoint() to use Position instead of VisiblePosition, which excludes user-select:none.
Comment 1 Alexey Proskuryakov 2013-08-13 09:58:24 PDT
I wonder if user-select:none breaks OS X Dictionary.
Comment 2 oleary.gabe 2022-01-20 14:02:09 PST
8+ years later and this bug is still present which makes certain functionality difficult if not impossible to replicate in iOS.
Comment 3 Ahmad Saleem 2022-08-21 09:58:48 PDT
I changed the test case from patch to JSFiddle:

Link - https://jsfiddle.net/4p7rexLf/

*** Safari 15.6.1 on macOS 12.5.1 / STP 151 ***

FAIL range.startContainer should be [object Text]. Was [object Text].
FAIL range.startOffset should be 2. Was 0.
PASS range.collapsed is true
PASS successfullyParsed is true

*** Firefox Nightly 105 ***

FAIL successfullyParsed should be true (of type boolean). Was undefined (of type undefined).

*** Chrome Canary 106 ***

PASS range.startContainer is $("sample").firstChild
PASS range.startOffset is 2
PASS range.collapsed is true
PASS successfullyParsed is true

______________

Just wanted to share updated test results. Thanks!
Comment 4 Ahmad Saleem 2023-01-29 14:17:27 PST
(In reply to Ahmad Saleem from comment #3)
> I changed the test case from patch to JSFiddle:
> 
> Link - https://jsfiddle.net/4p7rexLf/
> 
> *** Safari 15.6.1 on macOS 12.5.1 / STP 151 ***
> 
> FAIL range.startContainer should be [object Text]. Was [object Text].
> FAIL range.startOffset should be 2. Was 0.
> PASS range.collapsed is true
> PASS successfullyParsed is true
> 
> *** Firefox Nightly 105 ***
> 
> FAIL successfullyParsed should be true (of type boolean). Was undefined (of
> type undefined).
> 
> *** Chrome Canary 106 ***
> 
> PASS range.startContainer is $("sample").firstChild
> PASS range.startOffset is 2
> PASS range.collapsed is true
> PASS successfullyParsed is true
> 
> ______________
> 
> Just wanted to share updated test results. Thanks!

I get:

PASS range.startContainer is $("sample").firstChild
PASS range.startOffset is 2
PASS range.collapsed is true
PASS successfullyParsed is true

TEST COMPLETE
Before Test After

In Safari Technology Preview 162 - I think we can mark this as "RESOLVED CONFIGURATION CHANGED" now. Thanks!
Comment 5 Ahmad Saleem 2023-05-19 10:18:50 PDT
Working as expected in Safari 16.5 (might as well be in Safari 16.4).