mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:27:45 +00:00
LibWeb: Add fast way to check if a DOM node is an SVG element
This commit is contained in:
parent
8177ecb17f
commit
dd19f61538
2 changed files with 11 additions and 0 deletions
|
@ -73,6 +73,7 @@ public:
|
||||||
|
|
||||||
virtual bool requires_svg_container() const { return false; }
|
virtual bool requires_svg_container() const { return false; }
|
||||||
virtual bool is_svg_container() const { return false; }
|
virtual bool is_svg_container() const { return false; }
|
||||||
|
virtual bool is_svg_element() const { return false; }
|
||||||
virtual bool is_svg_svg_element() const { return false; }
|
virtual bool is_svg_svg_element() const { return false; }
|
||||||
|
|
||||||
bool in_a_document_tree() const;
|
bool in_a_document_tree() const;
|
||||||
|
|
|
@ -26,6 +26,16 @@ protected:
|
||||||
virtual void visit_edges(Cell::Visitor&) override;
|
virtual void visit_edges(Cell::Visitor&) override;
|
||||||
|
|
||||||
JS::GCPtr<HTML::DOMStringMap> m_dataset;
|
JS::GCPtr<HTML::DOMStringMap> m_dataset;
|
||||||
|
|
||||||
|
private:
|
||||||
|
virtual bool is_svg_element() const final { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace Web::DOM {
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline bool Node::fast_is<SVG::SVGElement>() const { return is_svg_element(); }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue