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

LibWeb: Make CSSPixels and Length use 64-bit (double) floating point

This fixes a plethora of rounding problems on many websites.
In the future, we may want to replace this with fixed-point arithmetic
(bug #18566) for performance (and consistency with other engines),
but in the meantime this makes the web look a bit better. :^)

There's a lot more things that could be converted to doubles, which
would reduce the amount of casting necessary in this patch.
We can do that incrementally, however.
This commit is contained in:
Andreas Kling 2023-05-24 10:50:57 +02:00
parent 30262d7023
commit 655d9d1462
80 changed files with 298 additions and 299 deletions

View file

@ -1,9 +1,9 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (1,1) content-size 798x62.506248 [BFC] children: not-inline
BlockContainer <body> at (2,2) content-size 796x60.506248 children: inline
BlockContainer <html> at (1,1) content-size 798x62.50625 [BFC] children: not-inline
BlockContainer <body> at (2,2) content-size 796x60.50625 children: inline
line 0 width: 34, height: 28.50625, bottom: 28.50625, baseline: 28.50625
frag 0 from BlockContainer start: 0, length: 0, rect: [4,3 30x30]
line 1 width: 32, height: 28.506248, bottom: 60.506248, baseline: 28.50625
line 1 width: 32, height: 28.50625, bottom: 60.50625, baseline: 28.50625
frag 0 from BlockContainer start: 0, length: 0, rect: [3,35 30x30]
BlockContainer <div.clump> at (4,3) content-size 30x30 inline-block [BFC] children: not-inline
BreakNode <br>

View file

@ -6,13 +6,13 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
"Lorem"
frag 1 from TextNode start: 6, length: 1, rect: [618,10 12.553385x21.835937]
" "
frag 2 from TextNode start: 7, length: 5, rect: [630.553344,10 56.621093x21.835937]
frag 2 from TextNode start: 7, length: 5, rect: [630.553385,10 56.621093x21.835937]
"ipsum"
frag 3 from TextNode start: 12, length: 1, rect: [686.553344,10 12.553385x21.835937]
frag 3 from TextNode start: 12, length: 1, rect: [686.553385,10 12.553385x21.835937]
" "
frag 4 from TextNode start: 13, length: 5, rect: [699.106811,10 52.050781x21.835937]
frag 4 from TextNode start: 13, length: 5, rect: [699.106770,10 52.050781x21.835937]
"dolor"
frag 5 from TextNode start: 18, length: 1, rect: [751.106811,10 12.553385x21.835937]
frag 5 from TextNode start: 18, length: 1, rect: [751.106770,10 12.553385x21.835937]
" "
frag 6 from TextNode start: 19, length: 3, rect: [763.660156,10 25.957031x21.835937]
"sit"
@ -90,13 +90,13 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
"rutrum"
frag 1 from TextNode start: 166, length: 1, rect: [624,184 21.010416x21.835937]
" "
frag 2 from TextNode start: 167, length: 4, rect: [645.010375,184 35.097656x21.835937]
frag 2 from TextNode start: 167, length: 4, rect: [645.010416,184 35.097656x21.835937]
"nisi"
frag 3 from TextNode start: 171, length: 1, rect: [680.010375,184 21.010416x21.835937]
frag 3 from TextNode start: 171, length: 1, rect: [680.010416,184 21.010416x21.835937]
" "
frag 4 from TextNode start: 172, length: 4, rect: [701.020874,184 39.824218x21.835937]
frag 4 from TextNode start: 172, length: 4, rect: [701.020833,184 39.824218x21.835937]
"eget"
frag 5 from TextNode start: 176, length: 1, rect: [741.020874,184 21.010416x21.835937]
frag 5 from TextNode start: 176, length: 1, rect: [741.020833,184 21.010416x21.835937]
" "
frag 6 from TextNode start: 177, length: 3, rect: [762.03125,184 27.734375x21.835937]
"dui"
@ -181,15 +181,15 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
line 17 width: 231.074218, height: 22.210937, bottom: 376.585937, baseline: 16.914062
frag 0 from TextNode start: 328, length: 5, rect: [252,364 48.59375x21.835937]
"ante."
frag 1 from TextNode start: 333, length: 1, rect: [301,364 11.641926x21.835937]
frag 1 from TextNode start: 333, length: 1, rect: [301,364 11.641927x21.835937]
" "
frag 2 from TextNode start: 334, length: 9, rect: [312.641937,364 94.765625x21.835937]
frag 2 from TextNode start: 334, length: 9, rect: [312.641927,364 94.765625x21.835937]
"Phasellus"
frag 3 from TextNode start: 343, length: 1, rect: [406.641906,364 11.641926x21.835937]
frag 3 from TextNode start: 343, length: 1, rect: [406.641927,364 11.641927x21.835937]
" "
frag 4 from TextNode start: 344, length: 1, rect: [418.283874,364 11.679687x21.835937]
frag 4 from TextNode start: 344, length: 1, rect: [418.283854,364 11.679687x21.835937]
"a"
frag 5 from TextNode start: 345, length: 1, rect: [430.283874,364 11.641926x21.835937]
frag 5 from TextNode start: 345, length: 1, rect: [430.283854,364 11.641927x21.835937]
" "
frag 6 from TextNode start: 346, length: 4, rect: [441.925781,364 46.035156x21.835937]
"arcu"