Skip to content

Commit

Permalink
LibWeb: Remove rounding division for CSSPixels
Browse files Browse the repository at this point in the history
Reverts 98926b4
that regressed (thrashing layout while window resizing):
Tests/LibWeb/Layout/input/block-and-inline/small-percentage-margin.html

Unfortunately, we currently can't capture such problems with layout
tests, so this bug went unnoticed for quite a long time.

Fixes SerenityOS#22610
  • Loading branch information
kalenikaliaksandr committed Jan 6, 2024
1 parent 107bfbe commit c05a006
Show file tree
Hide file tree
Showing 29 changed files with 228 additions and 236 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (1,1) content-size 798x0 [BFC] children: not-inline
BlockContainer <body> at (10,10) content-size 500x100 positioned [BFC] children: not-inline
BlockContainer <div.image-container> at (261,11) content-size 248x28.484375 positioned [BFC] children: inline
line 0 width: 250, height: 28.484375, bottom: 28.484375, baseline: 28.484375
frag 0 from ImageBox start: 0, length: 0, rect: [262,12 248x26.484375]
ImageBox <img> at (262,12) content-size 248x26.484375 children: not-inline
BlockContainer <div.image-container> at (261,11) content-size 248x28.46875 positioned [BFC] children: inline
line 0 width: 250, height: 28.46875, bottom: 28.46875, baseline: 28.46875
frag 0 from ImageBox start: 0, length: 0, rect: [262,12 248x26.46875]
ImageBox <img> at (262,12) content-size 248x26.46875 children: not-inline

ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer<HTML>) [0,0 800x2] overflow: [9,9 502x102]
PaintableWithLines (BlockContainer<BODY>) [9,9 502x102]
PaintableWithLines (BlockContainer<DIV>.image-container) [260,10 250x30.484375] overflow: [261,11 249x28.484375]
ImagePaintable (ImageBox<IMG>) [261,11 250x28.484375]
PaintableWithLines (BlockContainer<DIV>.image-container) [260,10 250x30.46875] overflow: [261,11 249x28.46875]
ImagePaintable (ImageBox<IMG>) [261,11 250x28.46875]
40 changes: 20 additions & 20 deletions Tests/LibWeb/Layout/expected/acid1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
TextNode <#text>
BlockContainer <dl> at (25,25) content-size 470x0 children: inline
TextNode <#text>
BlockContainer <dt> at (40,40) content-size 50x280 floating [BFC] children: inline
BlockContainer <dt> at (40,40) content-size 49.984375x280 floating [BFC] children: inline
line 0 width: 28.3125, height: 10, bottom: 10, baseline: 8
frag 0 from TextNode start: 0, length: 6, rect: [40,40 28.3125x10]
"toggle"
Expand All @@ -24,45 +24,45 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
"the way"
TextNode <#text>
TextNode <#text>
BlockContainer <li#bar> at (235,55) content-size 139.984375x90 floating [BFC] children: not-inline
BlockContainer <(anonymous)> at (235,55) content-size 139.984375x0 children: inline
BlockContainer <li#bar> at (235,55) content-size 139.96875x90 floating [BFC] children: not-inline
BlockContainer <(anonymous)> at (235,55) content-size 139.96875x0 children: inline
TextNode <#text>
BlockContainer <p> at (235,55) content-size 139.984375x10 children: inline
BlockContainer <p> at (235,55) content-size 139.96875x10 children: inline
line 0 width: 74.3125, height: 10, bottom: 10, baseline: 8
frag 0 from TextNode start: 0, length: 14, rect: [235,55 74.3125x10]
"the world ends"
TextNode <#text>
BlockContainer <(anonymous)> at (235,65) content-size 139.984375x0 children: inline
BlockContainer <(anonymous)> at (235,65) content-size 139.96875x0 children: inline
TextNode <#text>
InlineNode <form>
TextNode <#text>
TextNode <#text>
TextNode <#text>
BlockContainer <p> at (235,65) content-size 139.984375x19 children: inline
BlockContainer <p> at (235,65) content-size 139.96875x19 children: inline
line 0 width: 39.484375, height: 19, bottom: 19, baseline: 12.5
frag 0 from TextNode start: 1, length: 5, rect: [235,65 27.484375x19]
"bang "
frag 1 from RadioButton start: 0, length: 0, rect: [262,65 12x12]
TextNode <#text>
RadioButton <input> at (262,65) content-size 12x12 inline-block children: not-inline
TextNode <#text>
BlockContainer <p> at (235,84) content-size 139.984375x19 children: inline
BlockContainer <p> at (235,84) content-size 139.96875x19 children: inline
line 0 width: 57.15625, height: 19, bottom: 19, baseline: 12.5
frag 0 from TextNode start: 1, length: 8, rect: [235,84 45.15625x19]
"whimper "
frag 1 from RadioButton start: 0, length: 0, rect: [280,84 12x12]
TextNode <#text>
RadioButton <input> at (280,84) content-size 12x12 inline-block children: not-inline
TextNode <#text>
BlockContainer <(anonymous)> at (235,103) content-size 139.984375x0 children: inline
BlockContainer <(anonymous)> at (235,103) content-size 139.96875x0 children: inline
TextNode <#text>
TextNode <#text>
BlockContainer <li> at (409.984375,60) content-size 50x90 floating [BFC] children: inline
BlockContainer <li> at (409.96875,60) content-size 50x90 floating [BFC] children: inline
line 0 width: 31.578125, height: 10, bottom: 10, baseline: 8
frag 0 from TextNode start: 0, length: 6, rect: [409.984375,60 31.578125x10]
frag 0 from TextNode start: 0, length: 6, rect: [409.96875,60 31.578125x10]
"i grow"
line 1 width: 14.03125, height: 10, bottom: 20, baseline: 8
frag 0 from TextNode start: 7, length: 3, rect: [409.984375,70 14.03125x10]
frag 0 from TextNode start: 7, length: 3, rect: [409.96875,70 14.03125x10]
"old"
TextNode <#text>
TextNode <#text>
Expand Down Expand Up @@ -140,27 +140,27 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer<BODY>) [15,15 490x390]
PaintableWithLines (BlockContainer(anonymous)) [20,20 480x0]
PaintableWithLines (BlockContainer<DL>) [20,20 480x10]
PaintableWithLines (BlockContainer<DT>) [25,25 80x310]
PaintableWithLines (BlockContainer<DT>) [25,25 79.984375x310]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<DD>) [115,25 380x310]
PaintableWithLines (BlockContainer(anonymous)) [135,45 340x0]
PaintableWithLines (BlockContainer<UL>) [135,45 340x0]
PaintableWithLines (BlockContainer<LI>) [135,45 80x120]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<LI>#bar) [225,45 159.984375x110]
PaintableWithLines (BlockContainer(anonymous)) [235,55 139.984375x0]
PaintableWithLines (BlockContainer<P>) [235,55 139.984375x10]
PaintableWithLines (BlockContainer<LI>#bar) [225,45 159.96875x110]
PaintableWithLines (BlockContainer(anonymous)) [235,55 139.96875x0]
PaintableWithLines (BlockContainer<P>) [235,55 139.96875x10]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer(anonymous)) [235,65 139.984375x0]
PaintableWithLines (BlockContainer(anonymous)) [235,65 139.96875x0]
InlinePaintable (InlineNode<FORM>)
PaintableWithLines (BlockContainer<P>) [235,65 139.984375x19]
PaintableWithLines (BlockContainer<P>) [235,65 139.96875x19]
TextPaintable (TextNode<#text>)
RadioButtonPaintable (RadioButton<INPUT>) [262,65 12x12]
PaintableWithLines (BlockContainer<P>) [235,84 139.984375x19]
PaintableWithLines (BlockContainer<P>) [235,84 139.96875x19]
TextPaintable (TextNode<#text>)
RadioButtonPaintable (RadioButton<INPUT>) [280,84 12x12]
PaintableWithLines (BlockContainer(anonymous)) [235,103 139.984375x0]
PaintableWithLines (BlockContainer<LI>) [394.984375,45 80x120]
PaintableWithLines (BlockContainer(anonymous)) [235,103 139.96875x0]
PaintableWithLines (BlockContainer<LI>) [394.96875,45 80x120]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<LI>#baz) [135,175 120x120]
TextPaintable (TextNode<#text>)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (0,0) content-size 800x600 [BFC] children: not-inline
BlockContainer <body> at (8,8) content-size 784x47.6875 children: inline
line 0 width: 61.1875, height: 47.6875, bottom: 47.6875, baseline: 33.84375
frag 0 from BlockContainer start: 0, length: 0, rect: [8,8 61.1875x47.6875]
BlockContainer <div.ib> at (8,8) content-size 61.1875x47.6875 inline-block [BFC] children: inline
line 0 width: 61.1875, height: 47.6875, bottom: 47.6875, baseline: 33.84375
BlockContainer <body> at (8,8) content-size 784x47.671875 children: inline
line 0 width: 61.1875, height: 47.671875, bottom: 47.671875, baseline: 33.828125
frag 0 from BlockContainer start: 0, length: 0, rect: [8,8 61.1875x47.671875]
BlockContainer <div.ib> at (8,8) content-size 61.1875x47.671875 inline-block [BFC] children: inline
line 0 width: 61.1875, height: 47.671875, bottom: 47.671875, baseline: 33.828125
frag 0 from BlockContainer start: 0, length: 0, rect: [9,24 17.828125x21.84375]
frag 1 from TextNode start: 0, length: 1, rect: [28,28 8x17.46875]
" "
frag 2 from BlockContainer start: 0, length: 0, rect: [41,10 23.359375x43.6875]
frag 2 from BlockContainer start: 0, length: 0, rect: [41,10 23.359375x43.671875]
TextNode <#text>
BlockContainer <div.label> at (9,24) content-size 17.828125x21.84375 inline-block [BFC] children: inline
line 0 width: 17.828125, height: 21.84375, bottom: 21.84375, baseline: 16.921875
frag 0 from TextNode start: 0, length: 1, rect: [9,24 17.828125x21.84375]
"A"
TextNode <#text>
TextNode <#text>
BlockContainer <button> at (41,10) content-size 23.359375x43.6875 inline-block [BFC] children: not-inline
BlockContainer <(anonymous)> at (41,10) content-size 23.359375x43.6875 flex-container(column) [FFC] children: not-inline
BlockContainer <(anonymous)> at (41,10) content-size 23.359375x43.6875 flex-item [BFC] children: inline
line 0 width: 23.359375, height: 43.6875, bottom: 43.6875, baseline: 33.84375
BlockContainer <button> at (41,10) content-size 23.359375x43.671875 inline-block [BFC] children: not-inline
BlockContainer <(anonymous)> at (41,10) content-size 23.359375x43.671875 flex-container(column) [FFC] children: not-inline
BlockContainer <(anonymous)> at (41,10) content-size 23.359375x43.671875 flex-item [BFC] children: inline
line 0 width: 23.359375, height: 43.671875, bottom: 43.671875, baseline: 33.828125
frag 0 from TextNode start: 0, length: 1, rect: [41,10 23.359375x43.671875]
"B"
TextNode <#text>
TextNode <#text>

ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600]
PaintableWithLines (BlockContainer<BODY>) [8,8 784x47.6875]
PaintableWithLines (BlockContainer<DIV>.ib) [8,8 61.1875x47.6875]
PaintableWithLines (BlockContainer<BODY>) [8,8 784x47.671875]
PaintableWithLines (BlockContainer<DIV>.ib) [8,8 61.1875x47.671875]
PaintableWithLines (BlockContainer<DIV>.label) [8,23 19.828125x23.84375]
TextPaintable (TextNode<#text>)
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<BUTTON>) [36,8 33.359375x47.6875]
PaintableWithLines (BlockContainer(anonymous)) [41,10 23.359375x43.6875]
PaintableWithLines (BlockContainer(anonymous)) [41,10 23.359375x43.6875]
PaintableWithLines (BlockContainer<BUTTON>) [36,8 33.359375x47.671875]
PaintableWithLines (BlockContainer(anonymous)) [41,10 23.359375x43.671875]
PaintableWithLines (BlockContainer(anonymous)) [41,10 23.359375x43.671875]
TextPaintable (TextNode<#text>)
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (0,0) content-size 800x600 [BFC] children: not-inline
BlockContainer <body> at (8,8) content-size 784x47.6875 children: inline
line 0 width: 61.1875, height: 47.6875, bottom: 47.6875, baseline: 33.84375
frag 0 from BlockContainer start: 0, length: 0, rect: [8,8 61.1875x47.6875]
BlockContainer <div.ib> at (8,8) content-size 61.1875x47.6875 inline-block [BFC] children: inline
line 0 width: 61.1875, height: 47.6875, bottom: 47.6875, baseline: 33.84375
BlockContainer <body> at (8,8) content-size 784x47.671875 children: inline
line 0 width: 61.1875, height: 47.671875, bottom: 47.671875, baseline: 33.828125
frag 0 from BlockContainer start: 0, length: 0, rect: [8,8 61.1875x47.671875]
BlockContainer <div.ib> at (8,8) content-size 61.1875x47.671875 inline-block [BFC] children: inline
line 0 width: 61.1875, height: 47.671875, bottom: 47.671875, baseline: 33.828125
frag 0 from BlockContainer start: 0, length: 0, rect: [9,24 17.828125x21.84375]
frag 1 from TextNode start: 0, length: 1, rect: [28,28 8x17.46875]
" "
frag 2 from BlockContainer start: 0, length: 0, rect: [41,10 23.359375x43.6875]
frag 2 from BlockContainer start: 0, length: 0, rect: [41,10 23.359375x43.671875]
TextNode <#text>
BlockContainer <div.label> at (9,24) content-size 17.828125x21.84375 inline-block [BFC] children: inline
line 0 width: 17.828125, height: 21.84375, bottom: 21.84375, baseline: 16.921875
frag 0 from TextNode start: 0, length: 1, rect: [9,24 17.828125x21.84375]
"A"
TextNode <#text>
TextNode <#text>
BlockContainer <button> at (41,10) content-size 23.359375x43.6875 inline-block [BFC] children: not-inline
BlockContainer <(anonymous)> at (41,10) content-size 23.359375x43.6875 flex-container(column) [FFC] children: not-inline
BlockContainer <(anonymous)> at (41,10) content-size 23.359375x43.6875 flex-item [BFC] children: not-inline
BlockContainer <button> at (41,10) content-size 23.359375x43.671875 inline-block [BFC] children: not-inline
BlockContainer <(anonymous)> at (41,10) content-size 23.359375x43.671875 flex-container(column) [FFC] children: not-inline
BlockContainer <(anonymous)> at (41,10) content-size 23.359375x43.671875 flex-item [BFC] children: not-inline
BlockContainer <(anonymous)> at (41,10) content-size 23.359375x0 children: inline
TextNode <#text>
BlockContainer <div> at (41,10) content-size 23.359375x43.6875 children: inline
line 0 width: 23.359375, height: 43.6875, bottom: 43.6875, baseline: 33.84375
BlockContainer <div> at (41,10) content-size 23.359375x43.671875 children: inline
line 0 width: 23.359375, height: 43.671875, bottom: 43.671875, baseline: 33.828125
frag 0 from TextNode start: 0, length: 1, rect: [41,10 23.359375x43.671875]
"B"
TextNode <#text>
BlockContainer <(anonymous)> at (41,53.6875) content-size 23.359375x0 children: inline
BlockContainer <(anonymous)> at (41,53.671875) content-size 23.359375x0 children: inline
TextNode <#text>
TextNode <#text>

ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600]
PaintableWithLines (BlockContainer<BODY>) [8,8 784x47.6875]
PaintableWithLines (BlockContainer<DIV>.ib) [8,8 61.1875x47.6875]
PaintableWithLines (BlockContainer<BODY>) [8,8 784x47.671875]
PaintableWithLines (BlockContainer<DIV>.ib) [8,8 61.1875x47.671875]
PaintableWithLines (BlockContainer<DIV>.label) [8,23 19.828125x23.84375]
TextPaintable (TextNode<#text>)
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<BUTTON>) [36,8 33.359375x47.6875]
PaintableWithLines (BlockContainer(anonymous)) [41,10 23.359375x43.6875]
PaintableWithLines (BlockContainer(anonymous)) [41,10 23.359375x43.6875]
PaintableWithLines (BlockContainer<BUTTON>) [36,8 33.359375x47.671875]
PaintableWithLines (BlockContainer(anonymous)) [41,10 23.359375x43.671875]
PaintableWithLines (BlockContainer(anonymous)) [41,10 23.359375x43.671875]
PaintableWithLines (BlockContainer(anonymous)) [41,10 23.359375x0]
PaintableWithLines (BlockContainer<DIV>) [41,10 23.359375x43.6875]
PaintableWithLines (BlockContainer<DIV>) [41,10 23.359375x43.671875]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer(anonymous)) [41,53.6875 23.359375x0]
PaintableWithLines (BlockContainer(anonymous)) [41,53.671875 23.359375x0]
Loading

0 comments on commit c05a006

Please sign in to comment.