LibWeb: Add fast way to check if a DOM node is an SVG element

This commit is contained in:
Andreas Kling 2023-05-24 05:41:55 +02:00
commit dd19f61538
Notes: sideshowbarker 2024-07-17 01:13:25 +09:00
2 changed files with 11 additions and 0 deletions

View file

@ -26,6 +26,16 @@ protected:
virtual void visit_edges(Cell::Visitor&) override;
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(); }
}