1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 21:27:36 +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

@ -9,126 +9,126 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
Box <table> at (9,9) content-size 241.90625x257.34375 table-box [TFC] children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
Box <tbody> at (9,9) content-size 161.90625x197.34375 table-row-group children: not-inline
Box <tbody> at (9,9) content-size 161.90625x185 table-row-group children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
Box <tr> at (29,19) content-size 161.90625x39.46875 table-row children: not-inline
Box <tr> at (29,19) content-size 161.90625x37 table-row children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <td> at (50,30) content-size 14.265625x17.46875 table-cell [BFC] children: inline
BlockContainer <td> at (50,28.765625) content-size 14.265625x17.46875 table-cell [BFC] children: inline
line 0 width: 14.265625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 1, rect: [50,30 14.265625x17.46875]
frag 0 from TextNode start: 0, length: 1, rect: [50,28.765625 14.265625x17.46875]
"A"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <td> at (126.265625,30) content-size 12.546875x17.46875 table-cell [BFC] children: inline
BlockContainer <td> at (126.265625,28.765625) content-size 12.546875x17.46875 table-cell [BFC] children: inline
line 0 width: 9.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 1, rect: [128.265625,30 9.34375x17.46875]
frag 0 from TextNode start: 0, length: 1, rect: [127.859375,28.765625 9.34375x17.46875]
"B"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <td> at (200.8125,30) content-size 9.09375x17.46875 table-cell [BFC] children: inline
BlockContainer <td> at (200.8125,28.765625) content-size 9.09375x17.46875 table-cell [BFC] children: inline
line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 1, rect: [201.8125,30 6.34375x17.46875]
frag 0 from TextNode start: 0, length: 1, rect: [202.1875,28.765625 6.34375x17.46875]
"1"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
Box <tr> at (29,68.46875) content-size 161.90625x39.46875 table-row children: not-inline
Box <tr> at (29,66) content-size 161.90625x37 table-row children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <td> at (50,79.46875) content-size 88.8125x17.46875 table-cell [BFC] children: inline
BlockContainer <td> at (50,75.765625) content-size 88.8125x17.46875 table-cell [BFC] children: inline
line 0 width: 10.3125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 1, rect: [89,79.46875 10.3125x17.46875]
frag 0 from TextNode start: 0, length: 1, rect: [89.25,75.765625 10.3125x17.46875]
"C"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <td> at (200.8125,79.46875) content-size 9.09375x17.46875 table-cell [BFC] children: inline
BlockContainer <td> at (200.8125,75.765625) content-size 9.09375x17.46875 table-cell [BFC] children: inline
line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 1, rect: [200.8125,79.46875 8.8125x17.46875]
frag 0 from TextNode start: 0, length: 1, rect: [200.953125,75.765625 8.8125x17.46875]
"2"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
Box <tr> at (29,117.9375) content-size 161.90625x39.46875 table-row children: not-inline
Box <tr> at (29,113) content-size 161.90625x37 table-row children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <td> at (50,128.9375) content-size 14.265625x17.46875 table-cell [BFC] children: inline
BlockContainer <td> at (50,122.765625) content-size 14.265625x17.46875 table-cell [BFC] children: inline
line 0 width: 11.859375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 1, rect: [51,128.9375 11.859375x17.46875]
frag 0 from TextNode start: 0, length: 1, rect: [51.203125,122.765625 11.859375x17.46875]
"E"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <td> at (126.265625,128.9375) content-size 12.546875x17.46875 table-cell [BFC] children: inline
BlockContainer <td> at (126.265625,122.765625) content-size 12.546875x17.46875 table-cell [BFC] children: inline
line 0 width: 12.546875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 1, rect: [126.265625,128.9375 12.546875x17.46875]
frag 0 from TextNode start: 0, length: 1, rect: [126.265625,122.765625 12.546875x17.46875]
"F"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <td> at (200.8125,128.9375) content-size 9.09375x17.46875 table-cell [BFC] children: inline
BlockContainer <td> at (200.8125,122.765625) content-size 9.09375x17.46875 table-cell [BFC] children: inline
line 0 width: 9.09375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 1, rect: [200.8125,128.9375 9.09375x17.46875]
frag 0 from TextNode start: 0, length: 1, rect: [200.8125,122.765625 9.09375x17.46875]
"3"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
Box <tr> at (29,167.40625) content-size 161.90625x39.46875 table-row children: not-inline
Box <tr> at (29,160) content-size 161.90625x37 table-row children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <td> at (50,178.40625) content-size 14.265625x17.46875 table-cell [BFC] children: inline
BlockContainer <td> at (50,169.765625) content-size 14.265625x17.46875 table-cell [BFC] children: inline
line 0 width: 13.234375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 1, rect: [51,178.40625 13.234375x17.46875]
frag 0 from TextNode start: 0, length: 1, rect: [50.515625,169.765625 13.234375x17.46875]
"G"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <td> at (126.265625,178.40625) content-size 12.546875x17.46875 table-cell [BFC] children: inline
BlockContainer <td> at (126.265625,169.765625) content-size 12.546875x17.46875 table-cell [BFC] children: inline
line 0 width: 12.234375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 1, rect: [126.265625,178.40625 12.234375x17.46875]
frag 0 from TextNode start: 0, length: 1, rect: [126.421875,169.765625 12.234375x17.46875]
"H"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <td> at (200.8125,178.40625) content-size 9.09375x17.46875 table-cell [BFC] children: inline
BlockContainer <td> at (200.8125,169.765625) content-size 9.09375x17.46875 table-cell [BFC] children: inline
line 0 width: 7.75, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 1, rect: [201.8125,178.40625 7.75x17.46875]
frag 0 from TextNode start: 0, length: 1, rect: [201.484375,169.765625 7.75x17.46875]
"4"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
Box <tr> at (29,216.875) content-size 161.90625x39.46875 table-row children: not-inline
Box <tr> at (29,207) content-size 161.90625x37 table-row children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <td> at (50,227.875) content-size 14.265625x17.46875 table-cell [BFC] children: inline
BlockContainer <td> at (50,216.765625) content-size 14.265625x17.46875 table-cell [BFC] children: inline
line 0 width: 4.59375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 1, rect: [55,227.875 4.59375x17.46875]
frag 0 from TextNode start: 0, length: 1, rect: [54.828125,216.765625 4.59375x17.46875]
"I"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <td> at (126.265625,227.875) content-size 12.546875x17.46875 table-cell [BFC] children: inline
BlockContainer <td> at (126.265625,216.765625) content-size 12.546875x17.46875 table-cell [BFC] children: inline
line 0 width: 8.90625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 1, rect: [128.265625,227.875 8.90625x17.46875]
frag 0 from TextNode start: 0, length: 1, rect: [128.078125,216.765625 8.90625x17.46875]
"J"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <td> at (200.8125,227.875) content-size 9.09375x17.46875 table-cell [BFC] children: inline
BlockContainer <td> at (200.8125,216.765625) content-size 9.09375x17.46875 table-cell [BFC] children: inline
line 0 width: 8.453125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 1, rect: [200.8125,227.875 8.453125x17.46875]
frag 0 from TextNode start: 0, length: 1, rect: [201.125,216.765625 8.453125x17.46875]
"5"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline