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

@ -1,38 +1,38 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (0,0) content-size 800x127.8125 [BFC] children: not-inline
BlockContainer <html> at (0,0) content-size 800x127.34375 [BFC] children: not-inline
BlockContainer <(anonymous)> at (0,0) content-size 800x0 children: inline
TextNode <#text>
BlockContainer <body> at (8,8) content-size 784x111.8125 children: not-inline
TableWrapper <(anonymous)> at (8,8) content-size 63.046875x111.8125 [BFC] children: not-inline
Box <table#full-table> at (10,43.40625) content-size 59.046875x72.40625 table-box [TFC] children: not-inline
BlockContainer <body> at (8,8) content-size 784x111.34375 children: not-inline
TableWrapper <(anonymous)> at (8,8) content-size 63.046875x111.34375 [BFC] children: not-inline
Box <table#full-table> at (10,42.9375) content-size 59.046875x72.40625 table-box [TFC] children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <caption> at (8,8) content-size 59.046875x35.40625 [BFC] children: inline
BlockContainer <caption> at (8,8) content-size 59.046875x34.9375 [BFC] children: inline
line 0 width: 54.03125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 1, length: 6, rect: [11,8 54.03125x17.46875]
frag 0 from TextNode start: 1, length: 6, rect: [10.5,8 54.03125x17.46875]
"A long"
line 1 width: 59.046875, height: 17.9375, bottom: 35.40625, baseline: 13.53125
frag 0 from TextNode start: 8, length: 7, rect: [8,25 59.046875x17.46875]
line 1 width: 59.046875, height: 17.46875, bottom: 34.9375, baseline: 13.53125
frag 0 from TextNode start: 8, length: 7, rect: [8,25.46875 59.046875x17.46875]
"caption"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
Box <thead> at (10,10) content-size 53.046875x21.46875 table-header-group children: not-inline
Box <thead> at (10,10) content-size 53.03125x21.125 table-header-group children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
Box <tr> at (12,45.40625) content-size 53.046875x21.46875 table-row children: not-inline
Box <tr> at (12,44.9375) content-size 53.03125x21.125 table-row children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <td> at (14,47.40625) content-size 21.256598x17.46875 table-cell [BFC] children: inline
BlockContainer <td> at (14,46.765625) content-size 21.25x17.46875 table-cell [BFC] children: inline
line 0 width: 20.609375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 2, rect: [14,47.40625 20.609375x17.46875]
frag 0 from TextNode start: 0, length: 2, rect: [14,46.765625 20.609375x17.46875]
"A1"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <td> at (41.256598,47.40625) content-size 23.790276x17.46875 table-cell [BFC] children: inline
BlockContainer <td> at (41.25,46.765625) content-size 23.78125x17.46875 table-cell [BFC] children: inline
line 0 width: 23.078125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 2, rect: [41.256598,47.40625 23.078125x17.46875]
frag 0 from TextNode start: 0, length: 2, rect: [41.25,46.765625 23.078125x17.46875]
"A2"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
@ -41,22 +41,22 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
Box <tbody> at (10,31.46875) content-size 53.046875x21.46875 table-row-group children: not-inline
Box <tbody> at (10,31.125) content-size 53.03125x21.125 table-row-group children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
Box <tr> at (12,68.875) content-size 53.046875x21.46875 table-row children: not-inline
Box <tr> at (12,68.0625) content-size 53.03125x21.125 table-row children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <td> at (14,70.875) content-size 21.256598x17.46875 table-cell [BFC] children: inline
BlockContainer <td> at (14,69.890625) content-size 21.25x17.46875 table-cell [BFC] children: inline
line 0 width: 15.6875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 2, rect: [14,70.875 15.6875x17.46875]
frag 0 from TextNode start: 0, length: 2, rect: [14,69.890625 15.6875x17.46875]
"B1"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <td> at (41.256598,70.875) content-size 23.790276x17.46875 table-cell [BFC] children: inline
BlockContainer <td> at (41.25,69.890625) content-size 23.78125x17.46875 table-cell [BFC] children: inline
line 0 width: 18.15625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 2, rect: [41.256598,70.875 18.15625x17.46875]
frag 0 from TextNode start: 0, length: 2, rect: [41.25,69.890625 18.15625x17.46875]
"B2"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
@ -65,22 +65,22 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
Box <tfoot> at (10,52.9375) content-size 53.046875x21.46875 table-footer-group children: not-inline
Box <tfoot> at (10,52.25) content-size 53.03125x21.125 table-footer-group children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
Box <tr> at (12,92.34375) content-size 53.046875x21.46875 table-row children: not-inline
Box <tr> at (12,91.1875) content-size 53.03125x21.125 table-row children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <td> at (14,94.34375) content-size 21.256598x17.46875 table-cell [BFC] children: inline
BlockContainer <td> at (14,93.015625) content-size 21.25x17.46875 table-cell [BFC] children: inline
line 0 width: 18.890625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 2, rect: [14,94.34375 18.890625x17.46875]
frag 0 from TextNode start: 0, length: 2, rect: [14,93.015625 18.890625x17.46875]
"F1"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <td> at (41.256598,94.34375) content-size 23.790276x17.46875 table-cell [BFC] children: inline
BlockContainer <td> at (41.25,93.015625) content-size 23.78125x17.46875 table-cell [BFC] children: inline
line 0 width: 21.359375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 2, rect: [41.256598,94.34375 21.359375x17.46875]
frag 0 from TextNode start: 0, length: 2, rect: [41.25,93.015625 21.359375x17.46875]
"F2"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
@ -89,5 +89,5 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <(anonymous)> at (8,119.8125) content-size 784x0 children: inline
BlockContainer <(anonymous)> at (8,119.34375) content-size 784x0 children: inline
TextNode <#text>