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

LibWeb: Use fixed-point saturated arithmetics for CSSPixels

Using fixed-point saturated arithmetics for CSSPixels allows to avoid
accumulating floating-point errors.

This implementation is not complete yet: currently saturated
arithmetics implemented only for addition. But it is enough to not
regress any of layout tests we have :)

See https://github.com/SerenityOS/serenity/issues/18566
This commit is contained in:
Aliaksandr Kalenik 2023-07-23 01:09:39 +02:00 committed by Andreas Kling
parent 5cdd03fc53
commit bec07d4af7
136 changed files with 1938 additions and 1844 deletions

View file

@ -4,32 +4,32 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
Box <div.container> at (9,9) content-size 250x102 flex-container(row) [FFC] children: not-inline
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
TextNode <#text>
BlockContainer <div.box> at (10,10) content-size 62.666666x100 flex-item [BFC] children: inline
BlockContainer <div.box> at (10,10) content-size 62.671875x100 flex-item [BFC] children: inline
line 0 width: 18.9375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 3, rect: [10,10 18.9375x17.46875]
"1 I"
line 1 width: 49.359375, height: 17.9375, bottom: 35.40625, baseline: 13.53125
frag 0 from TextNode start: 4, length: 6, rect: [10,27 49.359375x17.46875]
line 1 width: 49.359375, height: 17.46875, bottom: 34.9375, baseline: 13.53125
frag 0 from TextNode start: 4, length: 6, rect: [10,27.46875 49.359375x17.46875]
"shrink"
line 2 width: 24.875, height: 18.40625, bottom: 53.34375, baseline: 13.53125
frag 0 from TextNode start: 11, length: 3, rect: [10,44 24.875x17.46875]
line 2 width: 24.875, height: 17.46875, bottom: 52.40625, baseline: 13.53125
frag 0 from TextNode start: 11, length: 3, rect: [10,44.9375 24.875x17.46875]
"the"
line 3 width: 38.765625, height: 17.875, bottom: 70.28125, baseline: 13.53125
frag 0 from TextNode start: 15, length: 4, rect: [10,62 38.765625x17.46875]
line 3 width: 38.765625, height: 17.46875, bottom: 69.875, baseline: 13.53125
frag 0 from TextNode start: 15, length: 4, rect: [10,62.40625 38.765625x17.46875]
"most"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
TextNode <#text>
BlockContainer <div.box> at (74.666666,10) content-size 81.333333x100 flex-item [BFC] children: inline
BlockContainer <div.box> at (74.671875,10) content-size 81.34375x100 flex-item [BFC] children: inline
line 0 width: 78.765625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 10, rect: [74.666666,10 78.765625x17.46875]
frag 0 from TextNode start: 0, length: 10, rect: [74.671875,10 78.765625x17.46875]
"2 I shrink"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
TextNode <#text>
BlockContainer <div.box> at (158,10) content-size 100x100 flex-item [BFC] children: inline
BlockContainer <div.box> at (158.015625,10) content-size 100x100 flex-item [BFC] children: inline
line 0 width: 68, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 9, rect: [158,10 68x17.46875]
frag 0 from TextNode start: 0, length: 9, rect: [158.015625,10 68x17.46875]
"3 I don't"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) [BFC] children: inline