Bug 259687

Summary: [Legacy Line Layout] Single overflowing trailing whitespace prematurely breaks line
Product: WebKit Reporter: David Choi <david_choi5>
Component: Layout and RenderingAssignee: David Choi <david_choi5>
Status: NEW ---    
Severity: Normal CC: bfulgham, david_choi5, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description David Choi 2023-08-01 09:49:33 PDT
In legacy line layout, whenever a single trailing space/newline character causes the textual content to exceed the available width of a line box, it prematurely stops processing any further inline items, and instead places a line break immediately. This does not occur with consecutive trailing whitespace characters.

This leads to several problems:
1) Floats get pushed on to the next line even if they would otherwise fit in the original line.
Test case: https://jsfiddle.net/2k9gq45v/2/

2) If the trailing white space happens at the end of all inline content, the line break position does not reach the end of the RenderObject linked list, causing legacy line layout to not interpret this line box as the last line box. This causes incorrect behavior in text-align-last and text-justify.
Test case: https://jsfiddle.net/n6s5p1dr/2/
Comment 1 Radar WebKit Bug Importer 2023-08-01 09:50:24 PDT
<rdar://problem/113212304>