1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 04:37:44 +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,14 +1,14 @@
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 784x24.000022 children: not-inline
Box <div.grid-container> at (8,8) content-size 784x24.000022 [GFC] children: not-inline
BlockContainer <body> at (8,8) content-size 784x24 children: not-inline
Box <div.grid-container> at (8,8) content-size 784x23.999999 [GFC] children: not-inline
BlockContainer <(anonymous)> at (8,8) content-size 0x0 [BFC] children: inline
TextNode <#text>
BlockContainer <div.wrapper> at (8,8) content-size 64.000061x24.000022 [BFC] children: inline
line 0 width: 64.000061, height: 24.000022, bottom: 24.000022, baseline: 24.000022
frag 0 from ImageBox start: 0, length: 0, rect: [8,8 64.000061x24.000022]
BlockContainer <div.wrapper> at (8,8) content-size 64x23.999999 [BFC] children: inline
line 0 width: 64, height: 23.999999, bottom: 23.999999, baseline: 23.999999
frag 0 from ImageBox start: 0, length: 0, rect: [8,8 64x23.999999]
TextNode <#text>
ImageBox <img> at (8,8) content-size 64.000061x24.000022 children: not-inline
ImageBox <img> at (8,8) content-size 64x23.999999 children: not-inline
TextNode <#text>
BlockContainer <(anonymous)> at (8,8) content-size 0x0 [BFC] children: inline
TextNode <#text>