Bug 119711
Summary: | Make CSS property user-select:none not to affect Document.caretRangeFromPoint() | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> |
Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED CONFIGURATION CHANGED | ||
Severity: | Normal | CC: | ahmad.saleem792, ap, clopez, enrica, eoconnor, oleary.gabe, syoichi |
Priority: | P2 | Keywords: | BlinkMergeCandidate |
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | |||
Bug Blocks: | 208677 |
Ryosuke Niwa
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.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
I wonder if user-select:none breaks OS X Dictionary.
oleary.gabe
8+ years later and this bug is still present which makes certain functionality difficult if not impossible to replicate in iOS.
Ahmad Saleem
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!
Ahmad Saleem
(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!
Ahmad Saleem
Working as expected in Safari 16.5 (might as well be in Safari 16.4).