mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 06:27:45 +00:00
LibWeb: Add support for implicit grid lines formed by grid areas in GFC
According to spec each grid area implicitly defines 4 additional named lines that could be used to specify items position.
This commit is contained in:
parent
92bf7d3ba7
commit
6480ed20b8
3 changed files with 92 additions and 2 deletions
30
Tests/LibWeb/Layout/expected/grid/implicit-lines.txt
Normal file
30
Tests/LibWeb/Layout/expected/grid/implicit-lines.txt
Normal file
|
@ -0,0 +1,30 @@
|
|||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||
BlockContainer <html> at (0,0) content-size 800x236 [BFC] children: not-inline
|
||||
BlockContainer <body> at (8,8) content-size 784x220 children: not-inline
|
||||
Box <div.grid-container> at (8,8) content-size 784x220 [GFC] children: not-inline
|
||||
BlockContainer <div.item2> at (405,8) content-size 387x100 [BFC] children: inline
|
||||
line 0 width: 49.1875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 6, rect: [405,8 49.1875x17.46875]
|
||||
"Item 2"
|
||||
TextNode <#text>
|
||||
BlockContainer <div.item1> at (8,8) content-size 387x210 [BFC] children: inline
|
||||
line 0 width: 46.71875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 6, rect: [8,8 46.71875x17.46875]
|
||||
"Item 1"
|
||||
TextNode <#text>
|
||||
BlockContainer <div.item3> at (405,118) content-size 387x100 [BFC] children: inline
|
||||
line 0 width: 49.1875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 6, rect: [405,118 49.1875x17.46875]
|
||||
"Item 2"
|
||||
TextNode <#text>
|
||||
|
||||
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x236]
|
||||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x220]
|
||||
PaintableBox (Box<DIV>.grid-container) [8,8 784x220]
|
||||
PaintableWithLines (BlockContainer<DIV>.item2) [405,8 387x100]
|
||||
TextPaintable (TextNode<#text>)
|
||||
PaintableWithLines (BlockContainer<DIV>.item1) [8,8 387x210]
|
||||
TextPaintable (TextNode<#text>)
|
||||
PaintableWithLines (BlockContainer<DIV>.item3) [405,118 387x100]
|
||||
TextPaintable (TextNode<#text>)
|
34
Tests/LibWeb/Layout/input/grid/implicit-lines.html
Normal file
34
Tests/LibWeb/Layout/input/grid/implicit-lines.html
Normal file
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html><html lang="en"><style>
|
||||
.grid-container {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-template-rows: 100px 100px;
|
||||
gap: 10px;
|
||||
height: 220px;
|
||||
grid-template-areas:
|
||||
"one two"
|
||||
"one three";
|
||||
}
|
||||
|
||||
.item1 {
|
||||
background-color: lightblue;
|
||||
grid-row-start: one-start;
|
||||
grid-row-end: one-end;
|
||||
grid-column-start: one-start;
|
||||
grid-column-end: one-end;
|
||||
}
|
||||
|
||||
.item2 {
|
||||
background-color: lightcoral;
|
||||
grid-area: two;
|
||||
}
|
||||
|
||||
.item3 {
|
||||
background-color: lightgreen;
|
||||
grid-row-start: three-start;
|
||||
grid-row-end: three-end;
|
||||
grid-column-start: three-start;
|
||||
grid-column-end: three-end;
|
||||
}
|
||||
</style>
|
||||
<div class="grid-container"><div class="item2">Item 2</div><div class="item1">Item 1</div><div class="item3">Item 2</div></div>
|
Loading…
Add table
Add a link
Reference in a new issue