mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09: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,7 +340,18 @@ void TreeBuilder::create_layout_tree(DOM::Node& dom_node, TreeBuilder::Context&
|
|||
display = style->display();
|
||||
if (display.is_none())
|
||||
return;
|
||||
layout_node = element.create_layout_node(*style);
|
||||
if (context.layout_svg_mask_or_clip_path) {
|
||||
if (is<SVG::SVGMaskElement>(dom_node))
|
||||
layout_node = document.heap().allocate_without_realm<Layout::SVGMaskBox>(document, static_cast<SVG::SVGMaskElement&>(dom_node), *style);
|
||||
else if (is<SVG::SVGClipPathElement>(dom_node))
|
||||
layout_node = document.heap().allocate_without_realm<Layout::SVGClipBox>(document, static_cast<SVG::SVGClipPathElement&>(dom_node), *style);
|
||||
else
|
||||
VERIFY_NOT_REACHED();
|
||||
// Only layout direct uses of SVG masks/clipPaths.
|
||||
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();
|
||||
|
@ -350,17 +361,6 @@ void TreeBuilder::create_layout_tree(DOM::Node& dom_node, TreeBuilder::Context&
|
|||
display = CSS::Display(CSS::DisplayOutside::Inline, CSS::DisplayInside::Flow);
|
||||
}
|
||||
|
||||
if (context.layout_svg_mask_or_clip_path) {
|
||||
if (is<SVG::SVGMaskElement>(dom_node))
|
||||
layout_node = document.heap().allocate_without_realm<Layout::SVGMaskBox>(document, static_cast<SVG::SVGMaskElement&>(dom_node), *style);
|
||||
else if (is<SVG::SVGClipPathElement>(dom_node))
|
||||
layout_node = document.heap().allocate_without_realm<Layout::SVGClipBox>(document, static_cast<SVG::SVGClipPathElement&>(dom_node), *style);
|
||||
else
|
||||
VERIFY_NOT_REACHED();
|
||||
// Only layout direct uses of SVG masks/clipPaths.
|
||||
context.layout_svg_mask_or_clip_path = false;
|
||||
}
|
||||
|
||||
if (!layout_node)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue