mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:07:35 +00:00
LibWeb: Add display: math
This is a `<display-inside>` keyword added by the MathML spec, and has the rough meaning of "display in the default way". It enables the standard layout rules for each MathML element (and is ignored for anything that isn't a MathML element). I believe we'll need an actual MathML formatting context to do the layout correctly, but we can at least support a couple of elements that behave the same as HTML ones.
This commit is contained in:
parent
125d161b3f
commit
f3124c492b
6 changed files with 38 additions and 1 deletions
|
@ -373,6 +373,14 @@ JS::GCPtr<Layout::Node> Element::create_layout_node_for_display_type(DOM::Docume
|
|||
return document.heap().allocate_without_realm<Layout::BlockContainer>(document, element, move(style));
|
||||
}
|
||||
|
||||
if (display.is_math_inside()) {
|
||||
// https://w3c.github.io/mathml-core/#new-display-math-value
|
||||
// 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));
|
||||
}
|
||||
|
||||
if (display.is_inline_outside()) {
|
||||
if (display.is_flow_root_inside())
|
||||
return document.heap().allocate_without_realm<Layout::BlockContainer>(document, element, move(style));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue