mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:47:35 +00:00
LibWeb: Bring CSS line-height
closer to other engines
This patch makes a few changes to the way we calculate line-height: - `line-height: normal` is now resolved using metrics from the used font (specifically, round(A + D + lineGap)). - `line-height: calc(...)` is now resolved at style compute time. - `line-height` values are now absolutized at style compute time. As a consequence of the above, we no longer need to walk the DOM ancestor chain looking for line-heights during style computation. Instead, values are inherited, resolved and absolutized locally. This is not only much faster, but also makes our line-height metrics match those of other engines like Gecko and Blink.
This commit is contained in:
parent
f0722671c3
commit
e7de5cb4d2
385 changed files with 6889 additions and 6893 deletions
|
@ -1,23 +1,23 @@
|
|||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||
BlockContainer <html> at (0,0) content-size 800x470.28125 [BFC] children: not-inline
|
||||
BlockContainer <body> at (8,8) content-size 784x454.28125 children: not-inline
|
||||
BlockContainer <(anonymous)> at (8,8) content-size 784x21.84375 children: inline
|
||||
line 0 width: 391.65625, height: 21.84375, bottom: 21.84375, baseline: 16.921875
|
||||
frag 0 from TextNode start: 0, length: 40, rect: [8,8 391.65625x21.84375]
|
||||
BlockContainer <html> at (0,0) content-size 800x470 [BFC] children: not-inline
|
||||
BlockContainer <body> at (8,8) content-size 784x454 children: not-inline
|
||||
BlockContainer <(anonymous)> at (8,8) content-size 784x22 children: inline
|
||||
line 0 width: 391.65625, height: 22, bottom: 22, baseline: 17
|
||||
frag 0 from TextNode start: 0, length: 40, rect: [8,8 391.65625x22]
|
||||
"Variable set by inline style of element:"
|
||||
TextNode <#text>
|
||||
BreakNode <br>
|
||||
TextNode <#text>
|
||||
BlockContainer <div.a> at (8,29.84375) content-size 784x100 children: inline
|
||||
BlockContainer <div.a> at (8,30) content-size 784x100 children: inline
|
||||
line 0 width: 200, height: 100, bottom: 100, baseline: 100
|
||||
frag 0 from BlockContainer start: 0, length: 0, rect: [8,29.84375 200x100]
|
||||
BlockContainer <(anonymous)> at (8,29.84375) content-size 200x100 inline-block [BFC] children: inline
|
||||
frag 0 from BlockContainer start: 0, length: 0, rect: [8,30 200x100]
|
||||
BlockContainer <(anonymous)> at (8,30) content-size 200x100 inline-block [BFC] children: inline
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> at (8,129.84375) content-size 784x66.21875 children: inline
|
||||
line 0 width: 0, height: 21.84375, bottom: 21.84375, baseline: 16.921875
|
||||
line 1 width: 0, height: 21.84375, bottom: 43.6875, baseline: 16.921875
|
||||
line 2 width: 441.28125, height: 22.53125, bottom: 66.21875, baseline: 16.921875
|
||||
frag 0 from TextNode start: 1, length: 42, rect: [8,172.84375 441.28125x21.84375]
|
||||
BlockContainer <(anonymous)> at (8,130) content-size 784x66 children: inline
|
||||
line 0 width: 0, height: 22, bottom: 22, baseline: 17
|
||||
line 1 width: 0, height: 22, bottom: 44, baseline: 17
|
||||
line 2 width: 441.28125, height: 22, bottom: 66, baseline: 17
|
||||
frag 0 from TextNode start: 1, length: 42, rect: [8,174 441.28125x22]
|
||||
"Variable set by CSS rule matching element:"
|
||||
TextNode <#text>
|
||||
BreakNode <br>
|
||||
|
@ -25,16 +25,16 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
|||
TextNode <#text>
|
||||
BreakNode <br>
|
||||
TextNode <#text>
|
||||
BlockContainer <div.b> at (8,196.0625) content-size 784x100 children: inline
|
||||
BlockContainer <div.b> at (8,196) content-size 784x100 children: inline
|
||||
line 0 width: 200, height: 100, bottom: 100, baseline: 100
|
||||
frag 0 from BlockContainer start: 0, length: 0, rect: [8,196.0625 200x100]
|
||||
BlockContainer <(anonymous)> at (8,196.0625) content-size 200x100 inline-block [BFC] children: inline
|
||||
frag 0 from BlockContainer start: 0, length: 0, rect: [8,196 200x100]
|
||||
BlockContainer <(anonymous)> at (8,196) content-size 200x100 inline-block [BFC] children: inline
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> at (8,296.0625) content-size 784x66.21875 children: inline
|
||||
line 0 width: 0, height: 21.84375, bottom: 21.84375, baseline: 16.921875
|
||||
line 1 width: 0, height: 21.84375, bottom: 43.6875, baseline: 16.921875
|
||||
line 2 width: 520.625, height: 22.53125, bottom: 66.21875, baseline: 16.921875
|
||||
frag 0 from TextNode start: 1, length: 49, rect: [8,339.0625 520.625x21.84375]
|
||||
BlockContainer <(anonymous)> at (8,296) content-size 784x66 children: inline
|
||||
line 0 width: 0, height: 22, bottom: 22, baseline: 17
|
||||
line 1 width: 0, height: 22, bottom: 44, baseline: 17
|
||||
line 2 width: 520.625, height: 22, bottom: 66, baseline: 17
|
||||
frag 0 from TextNode start: 1, length: 49, rect: [8,340 520.625x22]
|
||||
"Variable set by CSS rule matching pseudo element:"
|
||||
TextNode <#text>
|
||||
BreakNode <br>
|
||||
|
@ -42,27 +42,27 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
|||
TextNode <#text>
|
||||
BreakNode <br>
|
||||
TextNode <#text>
|
||||
BlockContainer <div.c> at (8,362.28125) content-size 784x100 children: inline
|
||||
BlockContainer <div.c> at (8,362) content-size 784x100 children: inline
|
||||
line 0 width: 200, height: 100, bottom: 100, baseline: 100
|
||||
frag 0 from BlockContainer start: 0, length: 0, rect: [8,362.28125 200x100]
|
||||
BlockContainer <(anonymous)> at (8,362.28125) content-size 200x100 inline-block [BFC] children: inline
|
||||
frag 0 from BlockContainer start: 0, length: 0, rect: [8,362 200x100]
|
||||
BlockContainer <(anonymous)> at (8,362) content-size 200x100 inline-block [BFC] children: inline
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> at (8,462.28125) content-size 784x0 children: inline
|
||||
BlockContainer <(anonymous)> at (8,462) content-size 784x0 children: inline
|
||||
TextNode <#text>
|
||||
|
||||
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x470.28125]
|
||||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x454.28125]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,8 784x21.84375]
|
||||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x470]
|
||||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x454]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,8 784x22]
|
||||
TextPaintable (TextNode<#text>)
|
||||
PaintableWithLines (BlockContainer<DIV>.a) [8,29.84375 784x100]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,29.84375 200x100]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,129.84375 784x66.21875]
|
||||
PaintableWithLines (BlockContainer<DIV>.a) [8,30 784x100]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,30 200x100]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,130 784x66]
|
||||
TextPaintable (TextNode<#text>)
|
||||
PaintableWithLines (BlockContainer<DIV>.b) [8,196.0625 784x100]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,196.0625 200x100]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,296.0625 784x66.21875]
|
||||
PaintableWithLines (BlockContainer<DIV>.b) [8,196 784x100]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,196 200x100]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,296 784x66]
|
||||
TextPaintable (TextNode<#text>)
|
||||
PaintableWithLines (BlockContainer<DIV>.c) [8,362.28125 784x100]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,362.28125 200x100]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,462.28125 784x0]
|
||||
PaintableWithLines (BlockContainer<DIV>.c) [8,362 784x100]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,362 200x100]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,462 784x0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue