mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-28 04:09:00 +00:00
LibWeb: Exclude trailing whitespace from line width when placing floats
When generating line boxes, we place floats simultaneously with the other items on the same line. The CSS text spec requires us to trim the whitespace at the end of each line, but we only did so after laying out all the line boxes. This changes the way we calculate the current line box width for floats by subtracting the amount of pixels that the current trailing whitespace is using. Fixes #4050.
This commit is contained in:
parent
e8644d43db
commit
002e79a658
Notes:
github-actions[bot]
2025-03-26 19:36:31 +00:00
Author: https://github.com/gmta
Commit: 002e79a658
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4101
5 changed files with 99 additions and 19 deletions
|
@ -0,0 +1,28 @@
|
|||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||
BlockContainer <html> at (0,0) content-size 800x33 [BFC] children: not-inline
|
||||
BlockContainer <body> at (8,8) content-size 784x17 children: not-inline
|
||||
BlockContainer <div.a> at (8,8) content-size 100x17 children: inline
|
||||
frag 0 from BlockContainer start: 0, length: 0, rect: [8,8 50x17] baseline: 13.296875
|
||||
TextNode <#text>
|
||||
BlockContainer <div.b> at (8,8) content-size 50x17 inline-block [BFC] children: inline
|
||||
frag 0 from TextNode start: 0, length: 3, rect: [8,8 27.15625x17] baseline: 13.296875
|
||||
"foo"
|
||||
TextNode <#text>
|
||||
TextNode <#text>
|
||||
BlockContainer <div.c> at (58,8) content-size 50x17 floating [BFC] children: inline
|
||||
frag 0 from TextNode start: 0, length: 3, rect: [58,8 27.640625x17] baseline: 13.296875
|
||||
"bar"
|
||||
TextNode <#text>
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> at (8,25) content-size 784x0 children: inline
|
||||
TextNode <#text>
|
||||
|
||||
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x33]
|
||||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x17]
|
||||
PaintableWithLines (BlockContainer<DIV>.a) [8,8 100x17]
|
||||
PaintableWithLines (BlockContainer<DIV>.b) [8,8 50x17]
|
||||
TextPaintable (TextNode<#text>)
|
||||
PaintableWithLines (BlockContainer<DIV>.c) [58,8 50x17]
|
||||
TextPaintable (TextNode<#text>)
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,25 784x0]
|
Loading…
Add table
Add a link
Reference in a new issue