mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:37:35 +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:
parent
fd360ba171
commit
31d536912c
5 changed files with 24 additions and 5 deletions
|
@ -55,6 +55,16 @@ private:
|
|||
template<>
|
||||
inline bool Node::fast_is<ParentNode>() const { return is_parent_node(); }
|
||||
|
||||
template<typename U>
|
||||
inline U* Node::shadow_including_first_ancestor_of_type()
|
||||
{
|
||||
for (auto* ancestor = parent_or_shadow_host(); ancestor; ancestor = ancestor->parent_or_shadow_host()) {
|
||||
if (is<U>(*ancestor))
|
||||
return &verify_cast<U>(*ancestor);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template<typename Callback>
|
||||
inline void ParentNode::for_each_child(Callback callback) const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue