1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 00:57:44 +00:00

LibWeb: Remove rounding division for CSSPixels

Reverts 98926b487c
that regressed: block-and-inline/small-percentage-margin.html
(thrashing layout while window resizing)

Fixes https://github.com/SerenityOS/serenity/issues/22610
This commit is contained in:
Aliaksandr Kalenik 2024-01-06 06:08:23 +01:00 committed by Andreas Kling
parent 7db8b206a8
commit e7eaf3b566
32 changed files with 257 additions and 245 deletions

View file

@ -25,9 +25,9 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
TextNode <#text>
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
TextNode <#text>
BlockContainer <div.left-margin-auto.right-margin-auto.fit-content-width> at (75.265625,70.40625) content-size 371.484375x17.46875 [BFC] children: inline
BlockContainer <div.left-margin-auto.right-margin-auto.fit-content-width> at (75.25,70.40625) content-size 371.484375x17.46875 [BFC] children: inline
line 0 width: 371.484375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 45, rect: [75.265625,70.40625 371.484375x17.46875]
frag 0 from TextNode start: 0, length: 45, rect: [75.25,70.40625 371.484375x17.46875]
"auto horizontal margins and fit-content width"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
@ -125,7 +125,7 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<DIV>.right-margin-auto) [11,49.9375 270.484375x19.46875]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<DIV>.left-margin-auto.right-margin-auto.fit-content-width) [74.265625,69.40625 373.484375x19.46875]
PaintableWithLines (BlockContainer<DIV>.left-margin-auto.right-margin-auto.fit-content-width) [74.25,69.40625 373.484375x19.46875]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<DIV>.left-margin-auto.fit-content-width) [202.453125,88.875 308.546875x19.46875]
TextPaintable (TextNode<#text>)

View file

@ -7,7 +7,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
frag 0 from TextNode start: 0, length: 5, rect: [8,8 42.140625x17.46875]
"First"
TextNode <#text>
BlockContainer <div.second> at (400,8) content-size 78.40625x17.46875 [BFC] children: inline
BlockContainer <div.second> at (400,8) content-size 78.390625x17.46875 [BFC] children: inline
line 0 width: 57.40625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 6, rect: [400,8 57.40625x17.46875]
"Second"
@ -19,5 +19,5 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableBox (Box<DIV>.grid-container) [8,8 784x17.46875]
PaintableWithLines (BlockContainer<DIV>.first) [8,8 313.59375x17.46875]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<DIV>.second) [400,8 78.40625x17.46875]
PaintableWithLines (BlockContainer<DIV>.second) [400,8 78.390625x17.46875]
TextPaintable (TextNode<#text>)

View file

@ -4,11 +4,11 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
Box <div.grid-container> at (8,8) content-size 784x24 [GFC] children: not-inline
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
TextNode <#text>
BlockContainer <div.wrapper> at (8,8) content-size 64.015625x24 [BFC] children: inline
line 0 width: 64.015625, height: 24, bottom: 24, baseline: 24
frag 0 from ImageBox start: 0, length: 0, rect: [8,8 64.015625x24]
BlockContainer <div.wrapper> at (8,8) content-size 64.03125x24 [BFC] children: inline
line 0 width: 64.03125, height: 24, bottom: 24, baseline: 24
frag 0 from ImageBox start: 0, length: 0, rect: [8,8 64.03125x24]
TextNode <#text>
ImageBox <img> at (8,8) content-size 64.015625x24 children: not-inline
ImageBox <img> at (8,8) content-size 64.03125x24 children: not-inline
TextNode <#text>
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
TextNode <#text>
@ -17,5 +17,5 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600]
PaintableWithLines (BlockContainer<BODY>) [8,8 784x24]
PaintableBox (Box<DIV>.grid-container) [8,8 784x24]
PaintableWithLines (BlockContainer<DIV>.wrapper) [8,8 64.015625x24]
ImagePaintable (ImageBox<IMG>) [8,8 64.015625x24]
PaintableWithLines (BlockContainer<DIV>.wrapper) [8,8 64.03125x24]
ImagePaintable (ImageBox<IMG>) [8,8 64.03125x24]

View file

@ -7,12 +7,12 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <div.item-left> at (8,8) content-size 100x35.40625 [BFC] children: not-inline
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
TextNode <#text>
BlockContainer <div.item-right> at (108.015625,8) content-size 683.984375x35.40625 [BFC] children: inline
BlockContainer <div.item-right> at (108.03125,8) content-size 683.96875x35.40625 [BFC] children: inline
line 0 width: 625.953125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 77, rect: [108.015625,8 625.953125x17.46875]
frag 0 from TextNode start: 0, length: 77, rect: [108.03125,8 625.953125x17.46875]
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut iaculis venenatis"
line 1 width: 304.0625, height: 17.9375, bottom: 35.40625, baseline: 13.53125
frag 0 from TextNode start: 78, length: 39, rect: [108.015625,25 304.0625x17.46875]
frag 0 from TextNode start: 78, length: 39, rect: [108.03125,25 304.0625x17.46875]
"purus, eget blandit velit venenatis at."
TextNode <#text>
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
@ -25,6 +25,6 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer<BODY>) [8,8 784x35.40625]
PaintableBox (Box<DIV>.container) [8,8 784x35.40625]
PaintableWithLines (BlockContainer<DIV>.item-left) [8,8 100x35.40625]
PaintableWithLines (BlockContainer<DIV>.item-right) [108.015625,8 683.984375x35.40625]
PaintableWithLines (BlockContainer<DIV>.item-right) [108.03125,8 683.96875x35.40625]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer(anonymous)) [8,43.40625 784x0]

View file

@ -12,9 +12,9 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <(anonymous)> at (10,31.46875) content-size 780x0 children: inline
TextNode <#text>
Box <div.grid.center> at (11,32.46875) content-size 778x19.46875 [GFC] children: not-inline
BlockContainer <div> at (373.484375,33.46875) content-size 53.046875x17.46875 [BFC] children: inline
BlockContainer <div> at (373.46875,33.46875) content-size 53.046875x17.46875 [BFC] children: inline
line 0 width: 53.046875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 6, rect: [373.484375,33.46875 53.046875x17.46875]
frag 0 from TextNode start: 0, length: 6, rect: [373.46875,33.46875 53.046875x17.46875]
"Center"
TextNode <#text>
BlockContainer <(anonymous)> at (10,52.9375) content-size 780x0 children: inline
@ -35,7 +35,7 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer(anonymous)) [10,31.46875 780x0]
PaintableBox (Box<DIV>.grid.center) [10,31.46875 780x21.46875]
PaintableWithLines (BlockContainer<DIV>) [372.484375,32.46875 55.046875x19.46875]
PaintableWithLines (BlockContainer<DIV>) [372.46875,32.46875 55.046875x19.46875]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer(anonymous)) [10,52.9375 780x0]
PaintableBox (Box<DIV>.grid.end) [10,52.9375 780x21.46875]

View file

@ -10,9 +10,9 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
TextNode <#text>
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
TextNode <#text>
BlockContainer <div> at (373.484375,30.46875) content-size 53.046875x17.46875 [BFC] children: inline
BlockContainer <div> at (373.46875,30.46875) content-size 53.046875x17.46875 [BFC] children: inline
line 0 width: 53.046875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 6, rect: [373.484375,30.46875 53.046875x17.46875]
frag 0 from TextNode start: 0, length: 6, rect: [373.46875,30.46875 53.046875x17.46875]
"Center"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
@ -30,7 +30,7 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableBox (Box<BODY>) [9,9 782x60.40625]
PaintableWithLines (BlockContainer<DIV>) [10,10 45.859375x19.46875]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<DIV>) [372.484375,29.46875 55.046875x19.46875]
PaintableWithLines (BlockContainer<DIV>) [372.46875,29.46875 55.046875x19.46875]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<DIV>) [758.671875,48.9375 31.328125x19.46875]
TextPaintable (TextNode<#text>)

View file

@ -15,9 +15,9 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <(anonymous)> at (10,91.46875) content-size 780x0 children: inline
TextNode <#text>
Box <div.grid> at (31,112.46875) content-size 738x39.46875 [GFC] children: not-inline
BlockContainer <div.center> at (185.8125,123.46875) content-size 59.390625x17.46875 [BFC] children: inline
BlockContainer <div.center> at (185.796875,123.46875) content-size 59.390625x17.46875 [BFC] children: inline
line 0 width: 59.390625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 7, rect: [185.8125,123.46875 59.390625x17.46875]
frag 0 from TextNode start: 0, length: 7, rect: [185.796875,123.46875 59.390625x17.46875]
"Center1"
TextNode <#text>
BlockContainer <div.item-padding> at (411,123.46875) content-size 347x17.46875 [BFC] children: inline
@ -49,7 +49,7 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer(anonymous)) [10,91.46875 780x0]
PaintableBox (Box<DIV>.grid) [10,91.46875 780x81.46875]
PaintableWithLines (BlockContainer<DIV>.center) [184.8125,122.46875 61.390625x19.46875]
PaintableWithLines (BlockContainer<DIV>.center) [184.796875,122.46875 61.390625x19.46875]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<DIV>.item-padding) [400,112.46875 369x39.46875]
TextPaintable (TextNode<#text>)