mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-21 08:48:57 +00:00
LibWeb: Move SVG mask/clip layout node creation under DOM::Element
This is a non-functional change, but makes it clearer other element properties (like `display=none`) apply to these too.
This commit is contained in:
parent
033877f628
commit
561beb5e95
Notes:
sideshowbarker
2024-07-16 23:13:25 +09:00
Author: https://github.com/MacDue
Commit: 561beb5e95
Pull-request: https://github.com/SerenityOS/serenity/pull/24208
1 changed files with 12 additions and 12 deletions
|
@ -340,16 +340,6 @@ void TreeBuilder::create_layout_tree(DOM::Node& dom_node, TreeBuilder::Context&
|
||||||
display = style->display();
|
display = style->display();
|
||||||
if (display.is_none())
|
if (display.is_none())
|
||||||
return;
|
return;
|
||||||
layout_node = element.create_layout_node(*style);
|
|
||||||
} else if (is<DOM::Document>(dom_node)) {
|
|
||||||
style = style_computer.create_document_style();
|
|
||||||
display = style->display();
|
|
||||||
layout_node = document.heap().allocate_without_realm<Layout::Viewport>(static_cast<DOM::Document&>(dom_node), *style);
|
|
||||||
} else if (is<DOM::Text>(dom_node)) {
|
|
||||||
layout_node = document.heap().allocate_without_realm<Layout::TextNode>(document, static_cast<DOM::Text&>(dom_node));
|
|
||||||
display = CSS::Display(CSS::DisplayOutside::Inline, CSS::DisplayInside::Flow);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (context.layout_svg_mask_or_clip_path) {
|
if (context.layout_svg_mask_or_clip_path) {
|
||||||
if (is<SVG::SVGMaskElement>(dom_node))
|
if (is<SVG::SVGMaskElement>(dom_node))
|
||||||
layout_node = document.heap().allocate_without_realm<Layout::SVGMaskBox>(document, static_cast<SVG::SVGMaskElement&>(dom_node), *style);
|
layout_node = document.heap().allocate_without_realm<Layout::SVGMaskBox>(document, static_cast<SVG::SVGMaskElement&>(dom_node), *style);
|
||||||
|
@ -359,6 +349,16 @@ void TreeBuilder::create_layout_tree(DOM::Node& dom_node, TreeBuilder::Context&
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
// Only layout direct uses of SVG masks/clipPaths.
|
// Only layout direct uses of SVG masks/clipPaths.
|
||||||
context.layout_svg_mask_or_clip_path = false;
|
context.layout_svg_mask_or_clip_path = false;
|
||||||
|
} else {
|
||||||
|
layout_node = element.create_layout_node(*style);
|
||||||
|
}
|
||||||
|
} else if (is<DOM::Document>(dom_node)) {
|
||||||
|
style = style_computer.create_document_style();
|
||||||
|
display = style->display();
|
||||||
|
layout_node = document.heap().allocate_without_realm<Layout::Viewport>(static_cast<DOM::Document&>(dom_node), *style);
|
||||||
|
} else if (is<DOM::Text>(dom_node)) {
|
||||||
|
layout_node = document.heap().allocate_without_realm<Layout::TextNode>(document, static_cast<DOM::Text&>(dom_node));
|
||||||
|
display = CSS::Display(CSS::DisplayOutside::Inline, CSS::DisplayInside::Flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!layout_node)
|
if (!layout_node)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue