mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:57:46 +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,55 +1,55 @@
|
|||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||
BlockContainer <html> at (0,0) content-size 800x140.9375 [BFC] children: not-inline
|
||||
BlockContainer <html> at (0,0) content-size 800x140 [BFC] children: not-inline
|
||||
BlockContainer <(anonymous)> at (0,0) content-size 800x0 children: inline
|
||||
TextNode <#text>
|
||||
BlockContainer <body> at (8,8) content-size 784x124.9375 children: not-inline
|
||||
BlockContainer <body> at (8,8) content-size 784x124 children: not-inline
|
||||
BlockContainer <(anonymous)> at (8,8) content-size 784x0 children: inline
|
||||
TextNode <#text>
|
||||
TableWrapper <(anonymous)> at (8,8) content-size 115.828125x124.9375 [BFC] children: not-inline
|
||||
Box <table> at (13,13) content-size 105.828125x114.9375 table-box [TFC] children: not-inline
|
||||
TableWrapper <(anonymous)> at (8,8) content-size 115.828125x124 [BFC] children: not-inline
|
||||
Box <table> at (13,13) content-size 105.828125x114 table-box [TFC] children: not-inline
|
||||
BlockContainer <(anonymous)> (not painted) children: inline
|
||||
TextNode <#text>
|
||||
Box <tbody> at (13,13) content-size 99.828125x108.9375 table-row-group children: not-inline
|
||||
Box <tbody> at (13,13) content-size 99.828125x108 table-row-group children: not-inline
|
||||
BlockContainer <(anonymous)> (not painted) children: inline
|
||||
TextNode <#text>
|
||||
Box <tr> at (15,15) content-size 99.828125x54.46875 table-row children: not-inline
|
||||
Box <tr> at (15,15) content-size 99.828125x54 table-row children: not-inline
|
||||
BlockContainer <(anonymous)> (not painted) children: inline
|
||||
TextNode <#text>
|
||||
BlockContainer <td> at (25,33.5) content-size 11.5625x17.46875 table-cell [BFC] children: inline
|
||||
line 0 width: 11.5625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 1, rect: [25,33.5 11.5625x17.46875]
|
||||
BlockContainer <td> at (25,33.5) content-size 11.5625x17 table-cell [BFC] children: inline
|
||||
line 0 width: 11.5625, height: 17, bottom: 17, baseline: 13.296875
|
||||
frag 0 from TextNode start: 0, length: 1, rect: [25,33.5 11.5625x17]
|
||||
"X"
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> (not painted) children: inline
|
||||
TextNode <#text>
|
||||
BlockContainer <td> at (58.5625,25) content-size 48.265625x90.9375 table-cell [BFC] children: not-inline
|
||||
BlockContainer <td> at (58.5625,25) content-size 48.265625x90 table-cell [BFC] children: not-inline
|
||||
BlockContainer <(anonymous)> at (58.5625,25) content-size 48.265625x0 children: inline
|
||||
TextNode <#text>
|
||||
TableWrapper <(anonymous)> at (58.5625,25) content-size 48.265625x90.9375 [BFC] children: not-inline
|
||||
Box <table> at (63.5625,30) content-size 38.265625x80.9375 table-box [TFC] children: not-inline
|
||||
TableWrapper <(anonymous)> at (58.5625,25) content-size 48.265625x90 [BFC] children: not-inline
|
||||
Box <table> at (63.5625,30) content-size 38.265625x80 table-box [TFC] children: not-inline
|
||||
BlockContainer <(anonymous)> (not painted) children: inline
|
||||
TextNode <#text>
|
||||
Box <tbody> at (63.5625,30) content-size 34.265625x74.9375 table-row-group children: not-inline
|
||||
Box <tbody> at (63.5625,30) content-size 34.265625x74 table-row-group children: not-inline
|
||||
BlockContainer <(anonymous)> (not painted) children: inline
|
||||
TextNode <#text>
|
||||
Box <tr> at (65.5625,32) content-size 34.265625x37.46875 table-row children: not-inline
|
||||
Box <tr> at (65.5625,32) content-size 34.265625x37 table-row children: not-inline
|
||||
BlockContainer <(anonymous)> (not painted) children: inline
|
||||
TextNode <#text>
|
||||
BlockContainer <td> at (75.5625,42) content-size 14.265625x17.46875 table-cell [BFC] children: inline
|
||||
line 0 width: 14.265625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 1, rect: [75.5625,42 14.265625x17.46875]
|
||||
BlockContainer <td> at (75.5625,42) content-size 14.265625x17 table-cell [BFC] children: inline
|
||||
line 0 width: 14.265625, height: 17, bottom: 17, baseline: 13.296875
|
||||
frag 0 from TextNode start: 0, length: 1, rect: [75.5625,42 14.265625x17]
|
||||
"A"
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> (not painted) children: inline
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> (not painted) children: inline
|
||||
TextNode <#text>
|
||||
Box <tr> at (65.5625,71.46875) content-size 34.265625x37.46875 table-row children: not-inline
|
||||
Box <tr> at (65.5625,71) content-size 34.265625x37 table-row children: not-inline
|
||||
BlockContainer <(anonymous)> (not painted) children: inline
|
||||
TextNode <#text>
|
||||
BlockContainer <td> at (75.5625,81.46875) content-size 14.265625x17.46875 table-cell [BFC] children: inline
|
||||
line 0 width: 9.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 1, rect: [75.5625,81.46875 9.34375x17.46875]
|
||||
BlockContainer <td> at (75.5625,81) content-size 14.265625x17 table-cell [BFC] children: inline
|
||||
line 0 width: 9.34375, height: 17, bottom: 17, baseline: 13.296875
|
||||
frag 0 from TextNode start: 0, length: 1, rect: [75.5625,81 9.34375x17]
|
||||
"B"
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> at (58.5625,25) content-size 0x0 children: inline
|
||||
|
@ -58,18 +58,18 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
|||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> at (58.5625,25) content-size 0x0 children: inline
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> at (58.5625,115.9375) content-size 48.265625x0 children: inline
|
||||
BlockContainer <(anonymous)> at (58.5625,115) content-size 48.265625x0 children: inline
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> (not painted) children: inline
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> (not painted) children: inline
|
||||
TextNode <#text>
|
||||
Box <tr> at (15,71.46875) content-size 99.828125x54.46875 table-row children: not-inline
|
||||
Box <tr> at (15,71) content-size 99.828125x54 table-row children: not-inline
|
||||
BlockContainer <(anonymous)> (not painted) children: inline
|
||||
TextNode <#text>
|
||||
BlockContainer <td> at (25,89.96875) content-size 11.5625x17.46875 table-cell [BFC] children: inline
|
||||
line 0 width: 11.09375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 1, rect: [25,89.96875 11.09375x17.46875]
|
||||
BlockContainer <td> at (25,89.5) content-size 11.5625x17 table-cell [BFC] children: inline
|
||||
line 0 width: 11.09375, height: 17, bottom: 17, baseline: 13.296875
|
||||
frag 0 from TextNode start: 0, length: 1, rect: [25,89.5 11.09375x17]
|
||||
"Y"
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> (not painted) children: inline
|
||||
|
@ -78,36 +78,36 @@ 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,132.9375) content-size 784x0 children: inline
|
||||
BlockContainer <(anonymous)> at (8,132) content-size 784x0 children: inline
|
||||
TextNode <#text>
|
||||
|
||||
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x140.9375]
|
||||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x140]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [0,0 800x0]
|
||||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x124.9375]
|
||||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x124]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,8 784x0]
|
||||
PaintableWithLines (TableWrapper(anonymous)) [8,8 115.828125x124.9375]
|
||||
PaintableBox (Box<TABLE>) [8,8 115.828125x124.9375]
|
||||
PaintableBox (Box<TBODY>) [13,13 99.828125x108.9375] overflow: [13,13 103.828125x112.9375]
|
||||
PaintableBox (Box<TR>) [15,15 99.828125x54.46875] overflow: [15,15 101.828125x110.9375]
|
||||
PaintableWithLines (BlockContainer<TD>) [15,15 31.5625x54.46875]
|
||||
PaintableWithLines (TableWrapper(anonymous)) [8,8 115.828125x124]
|
||||
PaintableBox (Box<TABLE>) [8,8 115.828125x124]
|
||||
PaintableBox (Box<TBODY>) [13,13 99.828125x108] overflow: [13,13 103.828125x112]
|
||||
PaintableBox (Box<TR>) [15,15 99.828125x54] overflow: [15,15 101.828125x110]
|
||||
PaintableWithLines (BlockContainer<TD>) [15,15 31.5625x54]
|
||||
TextPaintable (TextNode<#text>)
|
||||
PaintableWithLines (BlockContainer<TD>) [48.5625,15 68.265625x110.9375]
|
||||
PaintableWithLines (BlockContainer<TD>) [48.5625,15 68.265625x110]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [58.5625,25 48.265625x0]
|
||||
PaintableWithLines (TableWrapper(anonymous)) [58.5625,25 48.265625x90.9375]
|
||||
PaintableBox (Box<TABLE>) [58.5625,25 48.265625x90.9375] overflow: [58.5625,25 43.265625x85.9375]
|
||||
PaintableBox (Box<TBODY>) [63.5625,30 34.265625x74.9375] overflow: [58.5625,25 41.265625x83.9375]
|
||||
PaintableBox (Box<TR>) [65.5625,32 34.265625x37.46875]
|
||||
PaintableWithLines (BlockContainer<TD>) [65.5625,32 34.265625x37.46875]
|
||||
PaintableWithLines (TableWrapper(anonymous)) [58.5625,25 48.265625x90]
|
||||
PaintableBox (Box<TABLE>) [58.5625,25 48.265625x90] overflow: [58.5625,25 43.265625x85]
|
||||
PaintableBox (Box<TBODY>) [63.5625,30 34.265625x74] overflow: [58.5625,25 41.265625x83]
|
||||
PaintableBox (Box<TR>) [65.5625,32 34.265625x37]
|
||||
PaintableWithLines (BlockContainer<TD>) [65.5625,32 34.265625x37]
|
||||
TextPaintable (TextNode<#text>)
|
||||
PaintableBox (Box<TR>) [65.5625,71.46875 34.265625x37.46875] overflow: [58.5625,25 41.265625x83.9375]
|
||||
PaintableWithLines (BlockContainer<TD>) [65.5625,71.46875 34.265625x37.46875]
|
||||
PaintableBox (Box<TR>) [65.5625,71 34.265625x37] overflow: [58.5625,25 41.265625x83]
|
||||
PaintableWithLines (BlockContainer<TD>) [65.5625,71 34.265625x37]
|
||||
TextPaintable (TextNode<#text>)
|
||||
PaintableWithLines (BlockContainer(anonymous)) [58.5625,25 0x0]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [58.5625,25 0x0]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [58.5625,25 0x0]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [58.5625,115.9375 48.265625x0]
|
||||
PaintableBox (Box<TR>) [15,71.46875 99.828125x54.46875]
|
||||
PaintableWithLines (BlockContainer<TD>) [15,71.46875 31.5625x54.46875]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [58.5625,115 48.265625x0]
|
||||
PaintableBox (Box<TR>) [15,71 99.828125x54]
|
||||
PaintableWithLines (BlockContainer<TD>) [15,71 31.5625x54]
|
||||
TextPaintable (TextNode<#text>)
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,132.9375 784x0]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,132 784x0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue