mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 06:47:34 +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,104 +1,104 @@
|
|||
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 784x315.40625 children: not-inline
|
||||
Box <div.grid-container> at (8,8) content-size 784x315.40625 [GFC] children: not-inline
|
||||
BlockContainer <body> at (8,8) content-size 784x306 children: not-inline
|
||||
Box <div.grid-container> at (8,8) content-size 784x306 [GFC] children: not-inline
|
||||
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
|
||||
TextNode <#text>
|
||||
BlockContainer <div.grid-item.item-span-one-one> at (401.46875,8) content-size 392x131.296875 [BFC] children: inline
|
||||
line 0 width: 319.171875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 1, length: 40, rect: [401.46875,8 319.171875x17.46875]
|
||||
BlockContainer <div.grid-item.item-span-one-one> at (401.46875,8) content-size 392x127.5 [BFC] children: inline
|
||||
line 0 width: 319.171875, height: 17, bottom: 17, baseline: 13.296875
|
||||
frag 0 from TextNode start: 1, length: 40, rect: [401.46875,8 319.171875x17]
|
||||
"In a sollicitudin augue. Sed ante augue,"
|
||||
line 1 width: 335.125, height: 17.9375, bottom: 35.40625, baseline: 13.53125
|
||||
frag 0 from TextNode start: 42, length: 42, rect: [401.46875,25 335.125x17.46875]
|
||||
line 1 width: 335.125, height: 17, bottom: 34, baseline: 13.296875
|
||||
frag 0 from TextNode start: 42, length: 42, rect: [401.46875,25 335.125x17]
|
||||
"rhoncus nec porttitor id, lacinia et nibh."
|
||||
line 2 width: 378.625, height: 18.40625, bottom: 53.34375, baseline: 13.53125
|
||||
frag 0 from TextNode start: 85, length: 48, rect: [401.46875,42 378.625x17.46875]
|
||||
line 2 width: 378.625, height: 17, bottom: 51, baseline: 13.296875
|
||||
frag 0 from TextNode start: 85, length: 48, rect: [401.46875,42 378.625x17]
|
||||
"Pellentesque diam libero, ultrices eget eleifend"
|
||||
line 3 width: 182.8125, height: 17.875, bottom: 70.28125, baseline: 13.53125
|
||||
frag 0 from TextNode start: 134, length: 22, rect: [401.46875,60 182.8125x17.46875]
|
||||
line 3 width: 182.8125, height: 17, bottom: 68, baseline: 13.296875
|
||||
frag 0 from TextNode start: 134, length: 22, rect: [401.46875,59 182.8125x17]
|
||||
"at, consequat ut orci."
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
|
||||
TextNode <#text>
|
||||
BlockContainer <div.grid-item.item-span-one-two> at (401.46875,139.296875) content-size 392x184.109375 [BFC] children: inline
|
||||
line 0 width: 359.15625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 1, length: 43, rect: [401.46875,139.296875 359.15625x17.46875]
|
||||
BlockContainer <div.grid-item.item-span-one-two> at (401.46875,135.5) content-size 392x178.5 [BFC] children: inline
|
||||
line 0 width: 359.15625, height: 17, bottom: 17, baseline: 13.296875
|
||||
frag 0 from TextNode start: 1, length: 43, rect: [401.46875,135.5 359.15625x17]
|
||||
"Suspendisse potenti. Pellentesque at varius"
|
||||
line 1 width: 318.5625, height: 17.9375, bottom: 35.40625, baseline: 13.53125
|
||||
frag 0 from TextNode start: 45, length: 41, rect: [401.46875,156.296875 318.5625x17.46875]
|
||||
line 1 width: 318.5625, height: 17, bottom: 34, baseline: 13.296875
|
||||
frag 0 from TextNode start: 45, length: 41, rect: [401.46875,152.5 318.5625x17]
|
||||
"lacus, sed sollicitudin leo. Pellentesque"
|
||||
line 2 width: 377.640625, height: 18.40625, bottom: 53.34375, baseline: 13.53125
|
||||
frag 0 from TextNode start: 87, length: 44, rect: [401.46875,173.296875 377.640625x17.46875]
|
||||
line 2 width: 377.640625, height: 17, bottom: 51, baseline: 13.296875
|
||||
frag 0 from TextNode start: 87, length: 44, rect: [401.46875,169.5 377.640625x17]
|
||||
"malesuada mi eget pellentesque tempor. Donec"
|
||||
line 3 width: 378.03125, height: 17.875, bottom: 70.28125, baseline: 13.53125
|
||||
frag 0 from TextNode start: 132, length: 47, rect: [401.46875,191.296875 378.03125x17.46875]
|
||||
line 3 width: 378.03125, height: 17, bottom: 68, baseline: 13.296875
|
||||
frag 0 from TextNode start: 132, length: 47, rect: [401.46875,186.5 378.03125x17]
|
||||
"egestas mauris est, ut lobortis nisi luctus at."
|
||||
line 4 width: 345.953125, height: 18.34375, bottom: 88.21875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 180, length: 41, rect: [401.46875,208.296875 345.953125x17.46875]
|
||||
line 4 width: 345.953125, height: 17, bottom: 85, baseline: 13.296875
|
||||
frag 0 from TextNode start: 180, length: 41, rect: [401.46875,203.5 345.953125x17]
|
||||
"Vivamus eleifend, lorem vulputate maximus"
|
||||
line 5 width: 312.765625, height: 17.8125, bottom: 105.15625, baseline: 13.53125
|
||||
frag 0 from TextNode start: 222, length: 37, rect: [401.46875,226.296875 312.765625x17.46875]
|
||||
line 5 width: 312.765625, height: 17, bottom: 102, baseline: 13.296875
|
||||
frag 0 from TextNode start: 222, length: 37, rect: [401.46875,220.5 312.765625x17]
|
||||
"porta, nunc metus porttitor nibh, nec"
|
||||
line 6 width: 242.921875, height: 18.28125, bottom: 123.09375, baseline: 13.53125
|
||||
frag 0 from TextNode start: 260, length: 31, rect: [401.46875,243.296875 242.921875x17.46875]
|
||||
line 6 width: 242.921875, height: 17, bottom: 119, baseline: 13.296875
|
||||
frag 0 from TextNode start: 260, length: 31, rect: [401.46875,237.5 242.921875x17]
|
||||
"bibendum nulla lectus ut felis."
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
|
||||
TextNode <#text>
|
||||
BlockContainer <div.grid-item.item-span-two> at (8,8) content-size 393.46875x315.40625 [BFC] children: inline
|
||||
line 0 width: 337.6875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 1, length: 39, rect: [8,8 337.6875x17.46875]
|
||||
BlockContainer <div.grid-item.item-span-two> at (8,8) content-size 393.46875x306 [BFC] children: inline
|
||||
line 0 width: 337.6875, height: 17, bottom: 17, baseline: 13.296875
|
||||
frag 0 from TextNode start: 1, length: 39, rect: [8,8 337.6875x17]
|
||||
"Lorem ipsum dolor sit amet, consectetur"
|
||||
line 1 width: 376.34375, height: 17.9375, bottom: 35.40625, baseline: 13.53125
|
||||
frag 0 from TextNode start: 41, length: 47, rect: [8,25 376.34375x17.46875]
|
||||
line 1 width: 376.34375, height: 17, bottom: 34, baseline: 13.296875
|
||||
frag 0 from TextNode start: 41, length: 47, rect: [8,25 376.34375x17]
|
||||
"adipiscing elit. Sed vitae condimentum erat, ac"
|
||||
line 2 width: 365.84375, height: 18.40625, bottom: 53.34375, baseline: 13.53125
|
||||
frag 0 from TextNode start: 89, length: 45, rect: [8,42 365.84375x17.46875]
|
||||
line 2 width: 365.84375, height: 17, bottom: 51, baseline: 13.296875
|
||||
frag 0 from TextNode start: 89, length: 45, rect: [8,42 365.84375x17]
|
||||
"posuere arcu. Aenean tincidunt mi ligula, vel"
|
||||
line 3 width: 381.96875, height: 17.875, bottom: 70.28125, baseline: 13.53125
|
||||
frag 0 from TextNode start: 135, length: 46, rect: [8,60 381.96875x17.46875]
|
||||
line 3 width: 381.96875, height: 17, bottom: 68, baseline: 13.296875
|
||||
frag 0 from TextNode start: 135, length: 46, rect: [8,59 381.96875x17]
|
||||
"semper dolor aliquet at. Phasellus scelerisque"
|
||||
line 4 width: 377.203125, height: 18.34375, bottom: 88.21875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 182, length: 45, rect: [8,77 377.203125x17.46875]
|
||||
line 4 width: 377.203125, height: 17, bottom: 85, baseline: 13.296875
|
||||
frag 0 from TextNode start: 182, length: 45, rect: [8,76 377.203125x17]
|
||||
"dapibus diam sed rhoncus. Proin sed orci leo."
|
||||
line 5 width: 375.390625, height: 17.8125, bottom: 105.15625, baseline: 13.53125
|
||||
frag 0 from TextNode start: 228, length: 45, rect: [8,95 375.390625x17.46875]
|
||||
line 5 width: 375.390625, height: 17, bottom: 102, baseline: 13.296875
|
||||
frag 0 from TextNode start: 228, length: 45, rect: [8,93 375.390625x17]
|
||||
"Praesent pellentesque mi eu nunc gravida, vel"
|
||||
line 6 width: 383.53125, height: 18.28125, bottom: 123.09375, baseline: 13.53125
|
||||
frag 0 from TextNode start: 274, length: 46, rect: [8,112 383.53125x17.46875]
|
||||
line 6 width: 383.53125, height: 17, bottom: 119, baseline: 13.296875
|
||||
frag 0 from TextNode start: 274, length: 46, rect: [8,110 383.53125x17]
|
||||
"consectetur nulla malesuada. Sed pellentesque,"
|
||||
line 7 width: 344.8125, height: 17.75, bottom: 140.03125, baseline: 13.53125
|
||||
frag 0 from TextNode start: 321, length: 47, rect: [8,130 344.8125x17.46875]
|
||||
line 7 width: 344.8125, height: 17, bottom: 136, baseline: 13.296875
|
||||
frag 0 from TextNode start: 321, length: 47, rect: [8,127 344.8125x17]
|
||||
"elit sit amet sollicitudin sollicitudin, lectus"
|
||||
line 8 width: 374.703125, height: 18.21875, bottom: 157.96875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 369, length: 46, rect: [8,147 374.703125x17.46875]
|
||||
line 8 width: 374.703125, height: 17, bottom: 153, baseline: 13.296875
|
||||
frag 0 from TextNode start: 369, length: 46, rect: [8,144 374.703125x17]
|
||||
"justo facilisis lacus, ac vehicula metus neque"
|
||||
line 9 width: 384.125, height: 17.6875, bottom: 174.90625, baseline: 13.53125
|
||||
frag 0 from TextNode start: 416, length: 45, rect: [8,165 384.125x17.46875]
|
||||
line 9 width: 384.125, height: 17, bottom: 170, baseline: 13.296875
|
||||
frag 0 from TextNode start: 416, length: 45, rect: [8,161 384.125x17]
|
||||
"ac mi. In in augue et massa maximus venenatis"
|
||||
line 10 width: 373.25, height: 18.15625, bottom: 192.84375, baseline: 13.53125
|
||||
frag 0 from TextNode start: 462, length: 44, rect: [8,182 373.25x17.46875]
|
||||
line 10 width: 373.25, height: 17, bottom: 187, baseline: 13.296875
|
||||
frag 0 from TextNode start: 462, length: 44, rect: [8,178 373.25x17]
|
||||
"auctor fermentum dui. Aliquam dictum finibus"
|
||||
line 11 width: 288.203125, height: 17.625, bottom: 209.78125, baseline: 13.53125
|
||||
frag 0 from TextNode start: 507, length: 35, rect: [8,200 288.203125x17.46875]
|
||||
line 11 width: 288.203125, height: 17, bottom: 204, baseline: 13.296875
|
||||
frag 0 from TextNode start: 507, length: 35, rect: [8,195 288.203125x17]
|
||||
"urna, quis lacinia massa laoreet a."
|
||||
line 12 width: 316.296875, height: 18.09375, bottom: 227.71875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 543, length: 36, rect: [8,217 316.296875x17.46875]
|
||||
line 12 width: 316.296875, height: 17, bottom: 221, baseline: 13.296875
|
||||
frag 0 from TextNode start: 543, length: 36, rect: [8,212 316.296875x17]
|
||||
"Suspendisse elementum non lectus nec"
|
||||
line 13 width: 388.78125, height: 17.5625, bottom: 244.65625, baseline: 13.53125
|
||||
frag 0 from TextNode start: 580, length: 48, rect: [8,235 388.78125x17.46875]
|
||||
line 13 width: 388.78125, height: 17, bottom: 238, baseline: 13.296875
|
||||
frag 0 from TextNode start: 580, length: 48, rect: [8,229 388.78125x17]
|
||||
"elementum. Quisque ultricies suscipit porttitor."
|
||||
line 14 width: 373.828125, height: 18.03125, bottom: 262.59375, baseline: 13.53125
|
||||
frag 0 from TextNode start: 629, length: 45, rect: [8,252 373.828125x17.46875]
|
||||
line 14 width: 373.828125, height: 17, bottom: 255, baseline: 13.296875
|
||||
frag 0 from TextNode start: 629, length: 45, rect: [8,246 373.828125x17]
|
||||
"Sed non urna rutrum, mattis nulla at, feugiat"
|
||||
line 15 width: 368.75, height: 17.5, bottom: 279.53125, baseline: 13.53125
|
||||
frag 0 from TextNode start: 675, length: 48, rect: [8,270 368.75x17.46875]
|
||||
line 15 width: 368.75, height: 17, bottom: 272, baseline: 13.296875
|
||||
frag 0 from TextNode start: 675, length: 48, rect: [8,263 368.75x17]
|
||||
"erat. Duis orci elit, vehicula sed blandit eget,"
|
||||
line 16 width: 390.625, height: 17.96875, bottom: 297.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 724, length: 46, rect: [8,287 390.625x17.46875]
|
||||
line 16 width: 390.625, height: 17, bottom: 289, baseline: 13.296875
|
||||
frag 0 from TextNode start: 724, length: 46, rect: [8,280 390.625x17]
|
||||
"auctor in arcu. Ut cursus magna sit amet nulla"
|
||||
line 17 width: 294.90625, height: 18.4375, bottom: 315.40625, baseline: 13.53125
|
||||
frag 0 from TextNode start: 771, length: 36, rect: [8,304 294.90625x17.46875]
|
||||
line 17 width: 294.90625, height: 17, bottom: 306, baseline: 13.296875
|
||||
frag 0 from TextNode start: 771, length: 36, rect: [8,297 294.90625x17]
|
||||
"cursus, vitae gravida mauris dictum."
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
|
||||
|
@ -106,11 +106,11 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
|||
|
||||
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x315.40625] overflow: [8,8 785.46875x315.40625]
|
||||
PaintableBox (Box<DIV>.grid-container) [8,8 784x315.40625] overflow: [8,8 785.46875x315.40625]
|
||||
PaintableWithLines (BlockContainer<DIV>.grid-item.item-span-one-one) [401.46875,8 392x131.296875]
|
||||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x306] overflow: [8,8 785.46875x306]
|
||||
PaintableBox (Box<DIV>.grid-container) [8,8 784x306] overflow: [8,8 785.46875x306]
|
||||
PaintableWithLines (BlockContainer<DIV>.grid-item.item-span-one-one) [401.46875,8 392x127.5]
|
||||
TextPaintable (TextNode<#text>)
|
||||
PaintableWithLines (BlockContainer<DIV>.grid-item.item-span-one-two) [401.46875,139.296875 392x184.109375]
|
||||
PaintableWithLines (BlockContainer<DIV>.grid-item.item-span-one-two) [401.46875,135.5 392x178.5]
|
||||
TextPaintable (TextNode<#text>)
|
||||
PaintableWithLines (BlockContainer<DIV>.grid-item.item-span-two) [8,8 393.46875x315.40625]
|
||||
PaintableWithLines (BlockContainer<DIV>.grid-item.item-span-two) [8,8 393.46875x306]
|
||||
TextPaintable (TextNode<#text>)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue