[text-box-trim] Wrong line is trimmed when inline on last line is fragmented
Categories
(Core :: Layout: Block and Inline, defect)
Tracking
()
People
(Reporter: sajidanwar, Assigned: sajidanwar)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 external file)
|
1.36 KB,
text/html
|
Details |
For text-box-trim, the last formatted line detection doesn't properly handle when there's an inline-level box in the last line (call it L1) that is fragmented (due to wrapping or a forced line break) and needs to continue onto another line. This split causes a new last line (call it L2) to be created for this continuation. But this new actual last line, L2, is initially empty because the continuation is still in the overflow list of the original box. L2 is only populated when it's reflowed for the first time. This is problematic for L1, because when it tries to determine if it's the last formatted line by scanning forward, it sees L2 but notes that it's empty and ignores it. L1 is then marked as the last formatted line and gets trimmed (incorrectly).
This scenario occurs when there's a fragmented inline as the block's last child (like <span>...<br>...</span>). But it also occurs for any block with a ::first-line declaration and any line break, because Gecko's implementation of ::first-line creates inline wrapper frames and continuations for the entire block.
| Assignee | ||
Comment 1•2 months ago
|
||
Shows four cases of the "fragmented inline box on last line":
::first-lineon the block with a<br>inside::first-lineon the block with natural wrapping<span>as the last child with a<br>inside<span>as the last child with natural wrapping
Blink and WebKit have no issues with these. Gecko with this bug shows a) the middle line is closer to the first line because the first line was selected for trim-end, and b) the actual last line is not flush with the bottom of the block because it wasn't selected for trim-end.
| Assignee | ||
Comment 2•2 months ago
|
||
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/61986 for changes under testing/web-platform/tests
Comment 5•2 months ago
|
||
| bugherder | ||
Comment 6•2 months ago
|
||
Since nightly and release are affected, beta will likely be affected too.
For more information, please visit BugBot documentation.
Comment 7•2 months ago
|
||
The patch landed in nightly and beta is affected.
:sajidanwar, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox155towontfix.
For more information, please visit BugBot documentation.
| Assignee | ||
Updated•2 months ago
|
Upstream PR merged by moz-wptsync-bot
Updated•2 months ago
|
Updated•2 months ago
|
Description
•