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

LibWeb: Resolve percentages in calc() for font-size

Fixes crashing on https://react.dev/
This commit is contained in:
Aliaksandr Kalenik 2023-10-04 16:24:24 +02:00 committed by Andreas Kling
parent b64ed060d8
commit 28c9015bd8
5 changed files with 39 additions and 18 deletions

View file

@ -0,0 +1,17 @@
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 784x105.21875 children: not-inline
BlockContainer <div.test> at (8,8) content-size 784x105.21875 children: inline
line 0 width: 500.8125, height: 52.40625, bottom: 52.40625, baseline: 40.59375
frag 0 from TextNode start: 0, length: 20, rect: [8,8 500.8125x52.40625]
"i resolved enough of"
line 1 width: 406.40625, height: 52.8125, bottom: 105.21875, baseline: 40.59375
frag 0 from TextNode start: 21, length: 16, rect: [8,60 406.40625x52.40625]
"percentages, no?"
TextNode <#text>
ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600]
PaintableWithLines (BlockContainer<BODY>) [8,8 784x105.21875]
PaintableWithLines (BlockContainer<DIV>.test) [8,8 784x105.21875]
TextPaintable (TextNode<#text>)

View file

@ -0,0 +1,5 @@
<style>
.test {
font-size: calc(1em + 200%);
}
</style><div class="test">i resolved enough of percentages, no?</div>