Bug 258505

Summary: Hairline on selection
Product: WebKit Reporter: Ebrahim Byagowi <ebrahim>
Component: TextAssignee: zalan <zalan>
Status: NEW ---    
Severity: Normal CC: mmaxfield, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Safari vs Edge
none
test reduction
none
test reduction none

Description Ebrahim Byagowi 2023-06-25 19:03:05 PDT
Created attachment 466821 [details]
Safari vs Edge

It's similar to bugs like Bug 220548,

Reproduction:
1. Open https://the-decoder.com/why-large-ai-language-models-dont-lead-to-human-like-ai/
2. Select any paragraph from the article

Actual:
Note that one pixel lines after each word

Expected:
Similar to other browsers
Comment 1 zalan 2023-06-26 09:11:01 PDT
interesting, this seems to be caused by negative word-spacing. Thank you for filing it!
Comment 2 zalan 2023-06-26 09:11:26 PDT
Created attachment 466825 [details]
test reduction
Comment 3 zalan 2023-06-26 09:12:32 PDT
Created attachment 466826 [details]
test reduction
Comment 4 Ebrahim Byagowi 2023-06-26 13:25:31 PDT
Thanks for the quick response 😊

There is also a horizontal gap on selection on the second paragraph, maybe that can be interesting on a separate matter as it isn't related to white-space.
Comment 5 Ebrahim Byagowi 2023-06-27 12:13:47 PDT
Please ignore my previous comment as it's a spin off of the main issue here which now it's filed as Bug 258584
Comment 6 zalan 2023-06-27 18:37:38 PDT
(In reply to Ebrahim Byagowi from comment #5)
> Please ignore my previous comment as it's a spin off of the main issue here
> which now it's filed as Bug 258584
Thank you!
Comment 7 zalan 2023-06-27 20:28:18 PDT
For simple cases (like this one) we should be able to merge adjacent display boxes so that painting code sees them as one run, but in general we should teach TextBoxPainter to paint selection across runs.
Comment 8 Radar WebKit Bug Importer 2023-07-02 19:04:14 PDT
<rdar://problem/111661724>