mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-10 19:46:03 +00:00
LibWeb: Add fast_is<SVGGraphicsElement>()
This dynamic_cast was ~6% of runtime when mousing around on Discord.
This commit is contained in:
parent
37a618b7ad
commit
bb39ca9b4a
Notes:
sideshowbarker
2024-07-17 03:19:14 +09:00
Author: https://github.com/awesomekling
Commit: bb39ca9b4a
Pull-request: https://github.com/SerenityOS/serenity/pull/20344
Reviewed-by: https://github.com/AtkinsSJ
2 changed files with 11 additions and 0 deletions
|
@ -74,6 +74,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_element() const { return false; }
|
||||||
|
virtual bool is_svg_graphics_element() const { return false; }
|
||||||
virtual bool is_svg_svg_element() const { return false; }
|
virtual bool is_svg_svg_element() const { return false; }
|
||||||
virtual bool is_svg_use_element() const { return false; }
|
virtual bool is_svg_use_element() const { return false; }
|
||||||
|
|
||||||
|
|
|
@ -56,8 +56,18 @@ protected:
|
||||||
Optional<Gfx::PaintStyle const&> svg_paint_computed_value_to_gfx_paint_style(SVGPaintContext const& paint_context, Optional<CSS::SVGPaint> const& paint_value) const;
|
Optional<Gfx::PaintStyle const&> svg_paint_computed_value_to_gfx_paint_style(SVGPaintContext const& paint_context, Optional<CSS::SVGPaint> const& paint_value) const;
|
||||||
|
|
||||||
Gfx::AffineTransform m_transform = {};
|
Gfx::AffineTransform m_transform = {};
|
||||||
|
|
||||||
|
private:
|
||||||
|
virtual bool is_svg_graphics_element() const final { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
Gfx::AffineTransform transform_from_transform_list(ReadonlySpan<Transform> transform_list);
|
Gfx::AffineTransform transform_from_transform_list(ReadonlySpan<Transform> transform_list);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace Web::DOM {
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline bool Node::fast_is<SVG::SVGGraphicsElement>() const { return is_svg_graphics_element(); }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue