mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
LibWeb: Bring tab-size closer to the spec
When the css tab-size property is a number, we need to add the associated letter-spacing and word-spacing to it's width.
This commit is contained in:
parent
c6f77f4818
commit
2dc788df00
Notes:
github-actions[bot]
2024-10-27 10:17:52 +00:00
Author: https://github.com/kostyafarber
Commit: 2dc788df00
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1929
5 changed files with 58 additions and 4 deletions
16
Tests/LibWeb/Layout/expected/tab-size-letter-spacing.txt
Normal file
16
Tests/LibWeb/Layout/expected/tab-size-letter-spacing.txt
Normal file
|
@ -0,0 +1,16 @@
|
|||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||
BlockContainer <html> at (0,0) content-size 800x33 [BFC] children: not-inline
|
||||
BlockContainer <body> at (8,8) content-size 784x17 children: not-inline
|
||||
BlockContainer <div> at (8,8) content-size 784x17 children: inline
|
||||
frag 0 from TextNode start: 1, length: 1, rect: [8,8 14.265625x17] baseline: 13.296875
|
||||
"A"
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> at (8,25) content-size 784x0 children: inline
|
||||
TextNode <#text>
|
||||
|
||||
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x33]
|
||||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x17]
|
||||
PaintableWithLines (BlockContainer<DIV>) [8,8 784x17]
|
||||
TextPaintable (TextNode<#text>)
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,25 784x0]
|
16
Tests/LibWeb/Layout/expected/tab-size-word-spacing.txt
Normal file
16
Tests/LibWeb/Layout/expected/tab-size-word-spacing.txt
Normal file
|
@ -0,0 +1,16 @@
|
|||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||
BlockContainer <html> at (0,0) content-size 800x33 [BFC] children: not-inline
|
||||
BlockContainer <body> at (8,8) content-size 784x17 children: not-inline
|
||||
BlockContainer <div> at (8,8) content-size 784x17 children: inline
|
||||
frag 0 from TextNode start: 1, length: 1, rect: [8,8 14.265625x17] baseline: 13.296875
|
||||
"A"
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> at (8,25) content-size 784x0 children: inline
|
||||
TextNode <#text>
|
||||
|
||||
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x33]
|
||||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x17]
|
||||
PaintableWithLines (BlockContainer<DIV>) [8,8 784x17]
|
||||
TextPaintable (TextNode<#text>)
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,25 784x0]
|
9
Tests/LibWeb/Layout/input/tab-size-letter-spacing.html
Normal file
9
Tests/LibWeb/Layout/input/tab-size-letter-spacing.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
div {
|
||||
tab-size: 8;
|
||||
letter-spacing: 2ch;
|
||||
font-family: monospace;
|
||||
}
|
||||
</style>
|
||||
<div>	A</div>
|
9
Tests/LibWeb/Layout/input/tab-size-word-spacing.html
Normal file
9
Tests/LibWeb/Layout/input/tab-size-word-spacing.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
div {
|
||||
tab-size: 8;
|
||||
word-spacing: 2ch;
|
||||
font-family: monospace;
|
||||
}
|
||||
</style>
|
||||
<div>	A</div>
|
Loading…
Add table
Add a link
Reference in a new issue