LibWeb: Make a Layout::BlockContainer for MathML boxes

Instead of creating a generic Layout::Box, make a BlockContainer. This
allows them to be laid out by BFC, which is better than nothing(?),
even if it's not going to be correct at all.
This commit is contained in:
Andreas Kling 2024-03-10 11:36:45 +01:00
parent 3591a82e8d
commit 1b8d8c7bbc
2 changed files with 6 additions and 6 deletions

View file

@ -5,14 +5,14 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
frag 0 from SVGSVGBox start: 0, length: 0, rect: [9,9 300x150] baseline: 152
frag 1 from TextNode start: 0, length: 1, rect: [310,146 8x17] baseline: 13.296875
" "
frag 2 from Box start: 0, length: 0, rect: [319,51 0x108] baseline: 110
frag 2 from BlockContainer start: 0, length: 0, rect: [319,51 0x108] baseline: 110
SVGSVGBox <svg> at (9,9) content-size 300x150 [SVG] children: inline
InlineNode <a>
SVGTextBox <text> at (29,25.015625) content-size 193.59375x67.578125 children: inline
TextNode <#text>
TextNode <#text>
Box <math> at (319,51) content-size 0x108 children: not-inline
Box <a> at (8,8) content-size 100x100 children: inline
BlockContainer <math> at (319,51) content-size 0x108 children: not-inline
BlockContainer <a> at (319,51) content-size 100x100 children: inline
TextNode <#text>
TextNode <#text>
BlockContainer <div> at (9,164) content-size 782x44 children: inline
@ -29,8 +29,8 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer(anonymous)) [8,8 784x155]
SVGSVGPaintable (SVGSVGBox<svg>) [8,8 302x152]
TextPaintable (TextNode<#text>)
PaintableBox (Box<math>) [318,50 2x110] overflow: [8,8 100x100]
PaintableBox (Box<a>) [8,8 100x100]
PaintableWithLines (BlockContainer<math>) [318,50 2x110] overflow: [319,51 100x100]
PaintableWithLines (BlockContainer<a>) [319,51 100x100]
PaintableWithLines (BlockContainer<DIV>) [8,163 784x46]
InlinePaintable (InlineNode<A>)
TextPaintable (TextNode<#text>)

View file

@ -417,7 +417,7 @@ JS::GCPtr<Layout::Node> Element::create_layout_node_for_display_type(DOM::Docume
// MathML elements with a computed display value equal to block math or inline math control box generation
// and layout according to their tag name, as described in the relevant sections.
// FIXME: Figure out what kind of node we should make for them. For now, we'll stick with a generic Box.
return document.heap().allocate_without_realm<Layout::Box>(document, element, move(style));
return document.heap().allocate_without_realm<Layout::BlockContainer>(document, element, move(style));
}
if (display.is_inline_outside()) {