pub fn containing_shadow_ignoring_svg_use<E: TElement>(
    element: E
) -> Option<<E::ConcreteNode as TNode>::ConcreteShadowRoot>
Expand description

This is a bit of a hack so svg:use matches the rules of the enclosing tree.

This function returns the containing shadow host ignoring svg:use shadow trees, since those match the enclosing tree’s rules.

Only a handful of places need to really care about this. This is not a problem for invalidation and that kind of stuff because they still don’t match rules based on elements outside of the shadow tree, and because the svg:use subtrees are immutable and recreated each time the source tree changes.

We historically allow cross-document svg:use to have these rules applied, but I think that’s not great. Gecko is the only engine supporting that.

See https://github.com/w3c/svgwg/issues/504 for the relevant spec discussion.