1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 23:07:35 +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:
Timothy Flynn 2023-09-05 15:24:20 -04:00 committed by Andreas Kling
parent bdf2323b3f
commit b1632c58bf
6 changed files with 166 additions and 0 deletions

View 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]

View 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]