| Summary: | setBaseAndExtent not setting focus as requested | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Jamie Birch <jamie> | ||||
| Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> | ||||
| Status: | RESOLVED CONFIGURATION CHANGED | ||||||
| Severity: | Normal | CC: | ahmad.saleem792, brian, gsnedders, karlcow, rniwa, webkit-bug-importer, wenson_hsieh | ||||
| Priority: | P2 | Keywords: | BrowserCompat, InRadar | ||||
| Version: | Safari Technology Preview | ||||||
| Hardware: | Mac (Apple Silicon) | ||||||
| OS: | macOS 12 | ||||||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=244976 | ||||||
| Attachments: |
|
||||||
Spec: https://w3c.github.io/selection-api/#dom-selection-setbaseandextent Tests: https://wpt.fyi/results/selection/setBaseAndExtent.html?label=experimental&label=master&aligned I wonder how reliable the tests are with regards to the current spec. I think Selection API ‘Live Range’ fixed it since now we are passing all WPT tests cases mentioned by Comment 02 and also in the attached, I am gettign “Expected Result” using WebKit ToT and Safari Technology Preview 165. { "focusNode": "#text:Text outside:", "focusOffset": 13, "anchorNode": "#text:_", "anchorOffset": 1 } Nice |
Created attachment 462386 [details] HTML file reproducing the issue. STR: 1: Open attachment: setbaseandextent_not_setting_focus_as_requested_repro.html 2. Click the "Generate selection" button. Expected results: On-screen logger should report the resulting selection, which reflects the focusNode and focusOffset passed as parameters in the call to Selection.setBaseTextAndExtent(): { "focusNode": "#text:Text outside:", "focusOffset": 13, "anchorNode": "#text:_", "anchorOffset": 1 } Actual results: On-screen logger reports a different focusNode and focusOffset (the start of the text node from the neighbouring element): { "focusNode": "#text:_", "focusOffset": 0, "anchorNode": "#text:_", "anchorOffset": 1 } Firefox and Chrome produce the expected results.