Bug 259687 - [Legacy Line Layout] Single overflowing trailing whitespace prematurely breaks line
Summary: [Legacy Line Layout] Single overflowing trailing whitespace prematurely break...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Choi
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-08-01 09:49 PDT by David Choi
Modified: 2023-08-01 09:50 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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>