mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 20:07:34 +00:00
LibWeb: Create a shadow tree for details elements with manual slots
The spec requires that details elements be assigned a shadow tree with two slots. The first slot is assigned the first summary child element of the details element. The second slot is assigned all other children.
This commit is contained in:
parent
bdf2323b3f
commit
b1632c58bf
6 changed files with 166 additions and 0 deletions
23
Tests/LibWeb/Layout/expected/details-closed.txt
Normal file
23
Tests/LibWeb/Layout/expected/details-closed.txt
Normal file
|
@ -0,0 +1,23 @@
|
|||
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 784x17.46875 children: not-inline
|
||||
BlockContainer <(anonymous)> at (8,8) content-size 784x0 children: inline
|
||||
InlineNode <details>
|
||||
ListItemBox <summary> at (37,8) content-size 755x17.46875 children: inline
|
||||
line 0 width: 114.625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 13, rect: [37,8 114.625x17.46875]
|
||||
"I'm a summary"
|
||||
TextNode <#text>
|
||||
ListItemMarkerBox <(anonymous)> at (8,8.234375) content-size 17x17 children: not-inline
|
||||
BlockContainer <(anonymous)> at (8,25.46875) content-size 784x0 children: inline
|
||||
TextNode <#text>
|
||||
|
||||
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x17.46875]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,8 784x0]
|
||||
InlinePaintable (InlineNode<DETAILS>)
|
||||
PaintableWithLines (ListItemBox<SUMMARY>) [37,8 755x17.46875]
|
||||
TextPaintable (TextNode<#text>)
|
||||
MarkerPaintable (ListItemMarkerBox(anonymous)) [8,8.234375 17x17]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,25.46875 784x0]
|
35
Tests/LibWeb/Layout/expected/details-open.txt
Normal file
35
Tests/LibWeb/Layout/expected/details-open.txt
Normal file
|
@ -0,0 +1,35 @@
|
|||
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 784x34.9375 children: not-inline
|
||||
BlockContainer <(anonymous)> at (8,8) content-size 784x0 children: inline
|
||||
InlineNode <details>
|
||||
ListItemBox <summary> at (37,8) content-size 755x17.46875 children: inline
|
||||
line 0 width: 114.625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 13, rect: [37,8 114.625x17.46875]
|
||||
"I'm a summary"
|
||||
TextNode <#text>
|
||||
ListItemMarkerBox <(anonymous)> at (8,8.234375) content-size 17x17 children: not-inline
|
||||
BlockContainer <slot> at (8,25.46875) content-size 784x17.46875 children: inline
|
||||
line 0 width: 82.3125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 10, rect: [8,25.46875 82.3125x17.46875]
|
||||
"I'm a node"
|
||||
TextNode <#text>
|
||||
TextNode <#text>
|
||||
InlineNode <span>
|
||||
TextNode <#text>
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> at (8,42.9375) content-size 784x0 children: inline
|
||||
TextNode <#text>
|
||||
|
||||
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x34.9375]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,8 784x0]
|
||||
InlinePaintable (InlineNode<DETAILS>)
|
||||
PaintableWithLines (ListItemBox<SUMMARY>) [37,8 755x17.46875]
|
||||
TextPaintable (TextNode<#text>)
|
||||
MarkerPaintable (ListItemMarkerBox(anonymous)) [8,8.234375 17x17]
|
||||
PaintableWithLines (BlockContainer<SLOT>) [8,25.46875 784x17.46875]
|
||||
InlinePaintable (InlineNode<SPAN>)
|
||||
TextPaintable (TextNode<#text>)
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,42.9375 784x0]
|
4
Tests/LibWeb/Layout/input/details-closed.html
Normal file
4
Tests/LibWeb/Layout/input/details-closed.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
<details>
|
||||
<summary>I'm a summary</summary>
|
||||
<span>I'm a node</span>
|
||||
</details>
|
4
Tests/LibWeb/Layout/input/details-open.html
Normal file
4
Tests/LibWeb/Layout/input/details-open.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
<details open>
|
||||
<summary>I'm a summary</summary>
|
||||
<span>I'm a node</span>
|
||||
</details>
|
Loading…
Add table
Add a link
Reference in a new issue