mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:27:45 +00:00
LibWeb: Ignore svg elements outside of <svg> when building layout tree
An svg layout element without a `SVGSVGElement` ancestor caused a failed assertion before, because the svg context does not exist when `paint()` is called
This commit is contained in:
parent
758d816b23
commit
e8d10fb429
5 changed files with 28 additions and 5 deletions
|
@ -19,7 +19,11 @@ public:
|
|||
RefPtr<Layout::Node> build(DOM::Node&);
|
||||
|
||||
private:
|
||||
void create_layout_tree(DOM::Node&);
|
||||
struct Context {
|
||||
bool has_svg_root = false;
|
||||
};
|
||||
|
||||
void create_layout_tree(DOM::Node&, Context&);
|
||||
|
||||
void push_parent(Layout::NodeWithStyle& node) { m_parent_stack.append(&node); }
|
||||
void pop_parent() { m_parent_stack.take_last(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue