mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:47:45 +00:00
LibWeb: Create Layout::Box for display: inline-grid
This makes us actually run a GridFormattingContext instead of rendering inline-grid elements as nothing. :^)
This commit is contained in:
parent
5615ea5386
commit
9174ffd7e6
3 changed files with 17 additions and 0 deletions
10
Tests/LibWeb/Layout/expected/grid/inline-grid-simple.txt
Normal file
10
Tests/LibWeb/Layout/expected/grid/inline-grid-simple.txt
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||||
|
BlockContainer <html> at (0,0) content-size 800x33.46875 [BFC] children: inline
|
||||||
|
line 0 width: 42.953125, height: 33.46875, bottom: 33.46875, baseline: 13.53125
|
||||||
|
frag 0 from Box start: 0, length: 0, rect: [8,8 26.953125x17.46875]
|
||||||
|
Box <body> at (8,8) content-size 26.953125x17.46875 [GFC] children: not-inline
|
||||||
|
BlockContainer <(anonymous)> at (8,8) content-size 26.953125x17.46875 [BFC] children: inline
|
||||||
|
line 0 width: 26.953125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||||
|
frag 0 from TextNode start: 0, length: 3, rect: [8,8 26.953125x17.46875]
|
||||||
|
"whf"
|
||||||
|
TextNode <#text>
|
5
Tests/LibWeb/Layout/input/grid/inline-grid-simple.html
Normal file
5
Tests/LibWeb/Layout/input/grid/inline-grid-simple.html
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<!doctype html><style>
|
||||||
|
body {
|
||||||
|
display: inline-grid;
|
||||||
|
}
|
||||||
|
</style><body>whf
|
|
@ -338,6 +338,8 @@ JS::GCPtr<Layout::Node> Element::create_layout_node_for_display_type(DOM::Docume
|
||||||
return document.heap().allocate_without_realm<Layout::InlineNode>(document, element, move(style));
|
return document.heap().allocate_without_realm<Layout::InlineNode>(document, element, move(style));
|
||||||
if (display.is_flex_inside())
|
if (display.is_flex_inside())
|
||||||
return document.heap().allocate_without_realm<Layout::Box>(document, element, move(style));
|
return document.heap().allocate_without_realm<Layout::Box>(document, element, move(style));
|
||||||
|
if (display.is_grid_inside())
|
||||||
|
return document.heap().allocate_without_realm<Layout::Box>(document, element, move(style));
|
||||||
dbgln_if(LIBWEB_CSS_DEBUG, "FIXME: Support display: {}", MUST(display.to_string()));
|
dbgln_if(LIBWEB_CSS_DEBUG, "FIXME: Support display: {}", MUST(display.to_string()));
|
||||||
return document.heap().allocate_without_realm<Layout::InlineNode>(document, element, move(style));
|
return document.heap().allocate_without_realm<Layout::InlineNode>(document, element, move(style));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue