mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
LibWeb: Avoid dynamic_cast in DOM::Document::is_decoded_svg()
This commit is contained in:
parent
c5bbd5f4fa
commit
67a867d60d
3 changed files with 5 additions and 1 deletions
|
@ -6029,7 +6029,7 @@ void Document::for_each_shadow_root(Function<void(DOM::ShadowRoot&)>&& callback)
|
|||
|
||||
bool Document::is_decoded_svg() const
|
||||
{
|
||||
return is<Web::SVG::SVGDecodedImageData::SVGPageClient>(page().client());
|
||||
return page().client().is_svg_page_client();
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/css-position-4/#add-an-element-to-the-top-layer
|
||||
|
|
|
@ -408,6 +408,8 @@ public:
|
|||
|
||||
virtual bool is_headless() const = 0;
|
||||
|
||||
virtual bool is_svg_page_client() const { return false; }
|
||||
|
||||
protected:
|
||||
virtual ~PageClient() = default;
|
||||
};
|
||||
|
|
|
@ -92,6 +92,8 @@ private:
|
|||
{
|
||||
}
|
||||
|
||||
virtual bool is_svg_page_client() const override { return true; }
|
||||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue