Bug 244780 - Position styles cause empty range selection highlighting to appear between nodes
Summary: Position styles cause empty range selection highlighting to appear between nodes
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: Safari 15
Hardware: Mac (Apple Silicon) macOS 12
: P2 Minor
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2022-09-04 12:24 PDT by John Flockton
Modified: 2022-09-05 13:03 PDT (History)
6 users (show)

See Also:


Attachments
Minimal reproducible example (1009 bytes, text/html)
2022-09-04 12:24 PDT, John Flockton
no flags Details
Screenshot (86.63 KB, image/png)
2022-09-04 12:40 PDT, John Flockton
no flags Details
rendering in Safari, Safari TP, firefox, chrome (199.52 KB, image/png)
2022-09-04 22:29 PDT, Karl Dubost
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Flockton 2022-09-04 12:24:57 PDT
Created attachment 462125 [details]
Minimal reproducible example

This was originally reported in a separate OSS issue report for our Rich Text Editor: https://github.com/facebook/lexical/issues/2797.

In the attached minimal reproducible example index.html, the issue should be immediately visible.

Repro steps:

1. Open the attached index.html in Safari 15.
2. Observe that the range selection highlighting is visible between both paragraph elements.
3. Remove the "position: relative" styling from both paragraphs on line 10.
4. Reload the page.
5. Observe that the range selection highlighting is no longer visible.

Even though the DOM range selection is uncollapsed, I would expect it to appear collapsed (regardless of whether or not a "position" style is defined on the nodes) as the anchorNode offset is the length of the anchorNode, and the focusNode has an offset of 0. This is the case on Chromium and Firefox.

Let me know if you need any more information.

Version info:
MacOS 12.5.1
Safari 15.6.1 (17613.3.9.1.16)
Comment 1 John Flockton 2022-09-04 12:40:28 PDT
Created attachment 462129 [details]
Screenshot
Comment 2 Karl Dubost 2022-09-04 22:29:04 PDT
Created attachment 462137 [details]
rendering in Safari, Safari TP, firefox, chrome

Tested on macOS 13.0
---
Safari                     16.1          18614.2.1.1.1
Safari Technology Preview  16.0          18615.1.2.3
Firefox Nightly            106.0a1       10622.9.1
Google Chrome Canary       107.0.5280.0  5280.0
Comment 3 Radar WebKit Bug Importer 2022-09-04 22:30:07 PDT
<rdar://problem/99557958>