1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 13:07:46 +00:00

LibWeb: Add Length::resolved() overload for CSSPixels

Since we always pass the px value as an argument to resolved(), we can
pass it directly as CSSPixels instead of wrapping it in Length. This
approach allows us to avoid converting to a double, resulting in fewer
precision issues.
This commit is contained in:
Aliaksandr Kalenik 2023-08-29 18:57:09 +02:00 committed by Alexander Kalenik
parent 5eb0f65cc0
commit 0fb571c1c2
14 changed files with 154 additions and 75 deletions

View file

@ -0,0 +1,35 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (0,0) content-size 800x208 [BFC] children: not-inline
BlockContainer <body> at (8,8) content-size 784x0 children: not-inline
BlockContainer <div> at (15.828125,8) content-size 376.3125x100 floating [BFC] children: inline
line 0 width: 27.703125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 3, rect: [15.828125,8 27.703125x17.46875]
"abc"
TextNode <#text>
BlockContainer <div> at (407.796875,8) content-size 376.3125x100 floating [BFC] children: inline
line 0 width: 23.015625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 3, rect: [407.796875,8 23.015625x17.46875]
"def"
TextNode <#text>
BlockContainer <div> at (15.828125,108) content-size 376.3125x100 floating [BFC] children: inline
line 0 width: 21.421875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 3, rect: [15.828125,108 21.421875x17.46875]
"ghi"
TextNode <#text>
BlockContainer <div> at (407.796875,108) content-size 376.3125x100 floating [BFC] children: inline
line 0 width: 18.40625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 3, rect: [407.796875,108 18.40625x17.46875]
"jkl"
TextNode <#text>
ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer<HTML>) [0,0 800x208]
PaintableWithLines (BlockContainer<BODY>) [8,8 784x0] overflow: [15.828125,8 768.28125x200]
PaintableWithLines (BlockContainer<DIV>) [15.828125,8 376.3125x100]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<DIV>) [407.796875,8 376.3125x100]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<DIV>) [15.828125,108 376.3125x100]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<DIV>) [407.796875,108 376.3125x100]
TextPaintable (TextNode<#text>)