mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:27:34 +00:00
LibWeb: Add support for align-items
and align-self
in CSS grid
This commit is contained in:
parent
dfbc2839b4
commit
11b844ce20
6 changed files with 167 additions and 0 deletions
42
Tests/LibWeb/Layout/expected/grid/align-items.txt
Normal file
42
Tests/LibWeb/Layout/expected/grid/align-items.txt
Normal file
|
@ -0,0 +1,42 @@
|
|||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||
BlockContainer <html> at (1,1) content-size 798x262.40625 [BFC] children: not-inline
|
||||
BlockContainer <body> at (10,10) content-size 780x244.40625 children: not-inline
|
||||
BlockContainer <(anonymous)> at (10,10) content-size 780x0 children: inline
|
||||
TextNode <#text>
|
||||
Box <div.grid.start> at (31,31) content-size 738x39.46875 [GFC] children: not-inline
|
||||
BlockContainer <div> at (32,32) content-size 367x17.46875 [BFC] children: inline
|
||||
line 0 width: 50.203125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 6, rect: [32,32 50.203125x17.46875]
|
||||
"Start1"
|
||||
TextNode <#text>
|
||||
BlockContainer <div.item-padding> at (411,42) content-size 347x17.46875 [BFC] children: inline
|
||||
line 0 width: 52.671875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 6, rect: [411,42 52.671875x17.46875]
|
||||
"Start2"
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> at (10,91.46875) content-size 780x0 children: inline
|
||||
TextNode <#text>
|
||||
Box <div.grid.center> at (31,112.46875) content-size 738x39.46875 [GFC] children: not-inline
|
||||
BlockContainer <div> at (32,123.46875) content-size 367x17.46875 [BFC] children: inline
|
||||
line 0 width: 59.390625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 7, rect: [32,123.46875 59.390625x17.46875]
|
||||
"Center1"
|
||||
TextNode <#text>
|
||||
BlockContainer <div.item-padding> at (411,123.46875) content-size 347x17.46875 [BFC] children: inline
|
||||
line 0 width: 61.859375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 7, rect: [411,123.46875 61.859375x17.46875]
|
||||
"Center2"
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> at (10,172.9375) content-size 780x0 children: inline
|
||||
TextNode <#text>
|
||||
Box <div.grid.end> at (31,193.9375) content-size 738x39.46875 [GFC] children: not-inline
|
||||
BlockContainer <div> at (32,214.9375) content-size 367x17.46875 [BFC] children: inline
|
||||
line 0 width: 35.671875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 4, rect: [32,214.9375 35.671875x17.46875]
|
||||
"End1"
|
||||
TextNode <#text>
|
||||
BlockContainer <div.item-padding> at (411,204.9375) content-size 347x17.46875 [BFC] children: inline
|
||||
line 0 width: 38.140625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 4, rect: [411,204.9375 38.140625x17.46875]
|
||||
"End2"
|
||||
TextNode <#text>
|
42
Tests/LibWeb/Layout/expected/grid/align-self.txt
Normal file
42
Tests/LibWeb/Layout/expected/grid/align-self.txt
Normal file
|
@ -0,0 +1,42 @@
|
|||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||
BlockContainer <html> at (1,1) content-size 798x262.40625 [BFC] children: not-inline
|
||||
BlockContainer <body> at (10,10) content-size 780x244.40625 children: not-inline
|
||||
BlockContainer <(anonymous)> at (10,10) content-size 780x0 children: inline
|
||||
TextNode <#text>
|
||||
Box <div.grid> at (31,31) content-size 738x39.46875 [GFC] children: not-inline
|
||||
BlockContainer <div.start> at (32,32) content-size 367x17.46875 [BFC] children: inline
|
||||
line 0 width: 50.203125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 6, rect: [32,32 50.203125x17.46875]
|
||||
"Start1"
|
||||
TextNode <#text>
|
||||
BlockContainer <div.item-padding> at (411,42) content-size 347x17.46875 [BFC] children: inline
|
||||
line 0 width: 52.671875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 6, rect: [411,42 52.671875x17.46875]
|
||||
"Start2"
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> at (10,91.46875) content-size 780x0 children: inline
|
||||
TextNode <#text>
|
||||
Box <div.grid> at (31,112.46875) content-size 738x39.46875 [GFC] children: not-inline
|
||||
BlockContainer <div.center> at (32,123.46875) content-size 367x17.46875 [BFC] children: inline
|
||||
line 0 width: 59.390625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 7, rect: [32,123.46875 59.390625x17.46875]
|
||||
"Center1"
|
||||
TextNode <#text>
|
||||
BlockContainer <div.item-padding> at (411,123.46875) content-size 347x17.46875 [BFC] children: inline
|
||||
line 0 width: 61.859375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 7, rect: [411,123.46875 61.859375x17.46875]
|
||||
"Center2"
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> at (10,172.9375) content-size 780x0 children: inline
|
||||
TextNode <#text>
|
||||
Box <div.grid> at (31,193.9375) content-size 738x39.46875 [GFC] children: not-inline
|
||||
BlockContainer <div.end> at (32,214.9375) content-size 367x17.46875 [BFC] children: inline
|
||||
line 0 width: 35.671875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 4, rect: [32,214.9375 35.671875x17.46875]
|
||||
"End1"
|
||||
TextNode <#text>
|
||||
BlockContainer <div.item-padding> at (411,204.9375) content-size 347x17.46875 [BFC] children: inline
|
||||
line 0 width: 38.140625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 4, rect: [411,204.9375 38.140625x17.46875]
|
||||
"End2"
|
||||
TextNode <#text>
|
12
Tests/LibWeb/Layout/input/grid/align-items.html
Normal file
12
Tests/LibWeb/Layout/input/grid/align-items.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html><style>
|
||||
* { border: 1px solid black; }
|
||||
.grid { display: grid; grid-template-columns: auto auto; padding: 20px; }
|
||||
.start { align-items: start; }
|
||||
.center { align-items: center; }
|
||||
.end { align-items: end; }
|
||||
.item-padding { padding: 10px;}
|
||||
</style>
|
||||
<body>
|
||||
<div class="grid start"><div>Start1</div><div class="item-padding">Start2</div></div>
|
||||
<div class="grid center"><div>Center1</div><div class="item-padding">Center2</div></div>
|
||||
<div class="grid end"><div>End1</div><div class="item-padding">End2</div></div>
|
12
Tests/LibWeb/Layout/input/grid/align-self.html
Normal file
12
Tests/LibWeb/Layout/input/grid/align-self.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html><style>
|
||||
* { border: 1px solid black; }
|
||||
.grid { display: grid; grid-template-columns: auto auto; padding: 20px; }
|
||||
.start { align-self: start; }
|
||||
.center { align-self: center; }
|
||||
.end { align-self: end; }
|
||||
.item-padding { padding: 10px;}
|
||||
</style>
|
||||
<body>
|
||||
<div class="grid"><div class="start">Start1</div><div class="item-padding">Start2</div></div>
|
||||
<div class="grid"><div class="center">Center1</div><div class="item-padding">Center2</div></div>
|
||||
<div class="grid"><div class="end">End1</div><div class="item-padding">End2</div></div>
|
Loading…
Add table
Add a link
Reference in a new issue