mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:27:45 +00:00
LibWeb: Add fast_is<T>() for SVGBox and SVGPathBox
This commit is contained in:
parent
04c0c103e0
commit
225a5f2fe6
3 changed files with 14 additions and 0 deletions
|
@ -101,6 +101,8 @@ public:
|
||||||
virtual bool is_block_container() const { return false; }
|
virtual bool is_block_container() const { return false; }
|
||||||
virtual bool is_text_node() const { return false; }
|
virtual bool is_text_node() const { return false; }
|
||||||
virtual bool is_initial_containing_block_box() const { return false; }
|
virtual bool is_initial_containing_block_box() const { return false; }
|
||||||
|
virtual bool is_svg_box() const { return false; }
|
||||||
|
virtual bool is_svg_path_box() const { return false; }
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool fast_is() const = delete;
|
bool fast_is() const = delete;
|
||||||
|
|
|
@ -21,6 +21,12 @@ public:
|
||||||
|
|
||||||
virtual void before_children_paint(PaintContext& context, PaintPhase phase) override;
|
virtual void before_children_paint(PaintContext& context, PaintPhase phase) override;
|
||||||
virtual void after_children_paint(PaintContext& context, PaintPhase phase) override;
|
virtual void after_children_paint(PaintContext& context, PaintPhase phase) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
virtual bool is_svg_box() const final { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline bool Node::fast_is<SVGBox>() const { return is_svg_box(); }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,12 @@ public:
|
||||||
SVG::SVGPathElement& dom_node() { return verify_cast<SVG::SVGPathElement>(SVGGraphicsBox::dom_node()); }
|
SVG::SVGPathElement& dom_node() { return verify_cast<SVG::SVGPathElement>(SVGGraphicsBox::dom_node()); }
|
||||||
|
|
||||||
virtual void paint(PaintContext& context, PaintPhase phase) override;
|
virtual void paint(PaintContext& context, PaintPhase phase) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
virtual bool is_svg_path_box() const final { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline bool Node::fast_is<SVGPathBox>() const { return is_svg_path_box(); }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue