Bug 167527

Summary: Regression (Safari 10): Selection highlight is drawn incorrectly when selecting the last two <br> elements in a block-level element
Product: WebKit Reporter: Sam Stephenson <sam>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: ahmad.saleem792, ap, bfulgham, javan, rniwa, simon.fraser, zalan
Priority: P2    
Version: Safari Technology Preview   
Hardware: Mac   
OS: macOS 10.12   
Attachments:
Description Flags
Minimal test case none

Sam Stephenson
Reported 2017-01-27 14:01:10 PST
Created attachment 299957 [details] Minimal test case Given the following markup: <div> <div><br><br><br><br><br></div> </div> After selecting the entire contents of the outermost <div>, the selection highlight is missing for the last two lines. This is new behavior in Safari 10.1/Safari Technology Preview. See the attached test case (line-break-selection.html). The behavior is also present for selections in contenteditable containers, which can lead to confusion about what text is actually selected in a rich text editor.
Attachments
Minimal test case (877 bytes, text/html)
2017-01-27 14:01 PST, Sam Stephenson
no flags
Ahmad Saleem
Comment 1 2022-07-26 13:15:31 PDT
I am not sure on expected behavior or web-spec but this is current beahvior in attached test case across browsers: *** Safari 15.6 on macOS 12.5 *** Clicking "Select All" shows "Selection" across field of <div conetenteditable> but since it is <br> or nothing, it just confuses that something is selected. *** Firefox Nightly 104 *** Clicking "Select All" do nothing and does not show any selection inside <div contenteditable>. *** Chrome Canary 106 *** Clicking "Select All" shows smalls election (2 or 4 px wide) in <div contenteditable>. I am not sure, which behavior is correct or aligned with web-spec but wanted to share latest test results. Thanks!
Alexey Proskuryakov
Comment 2 2022-07-27 19:04:38 PDT
This report is about how much of the box gets filled with a selection vertically, not horizontally. WebKit behavior seems most weird to me of these three.
Note You need to log in before you can comment on or make changes to this bug.