1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:37:45 +00:00

LibWeb: Allow SVG painting to escape out of a shadow tree

The spec for the `<use>` element requires a shadow tree for the
rendered content, so we need to be able to escape shadow trees when
rendering svg content.
This commit is contained in:
PrestonLTaylor 2023-05-28 18:27:35 +01:00 committed by Andreas Kling
parent fd360ba171
commit 31d536912c
5 changed files with 24 additions and 5 deletions

View file

@ -636,6 +636,15 @@ public:
return nullptr;
}
template<typename U>
U const* shadow_including_first_ancestor_of_type() const
{
return const_cast<Node*>(this)->template shadow_including_first_ancestor_of_type<U>();
}
template<typename U>
U* shadow_including_first_ancestor_of_type();
bool is_parent_of(Node const& other) const
{
for (auto* child = first_child(); child; child = child->next_sibling()) {