diff options
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r-- | components/script/dom/node.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index d4e404dc030..4a4c9f53462 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -1362,7 +1362,11 @@ impl Node { // NOTE: This method traverses all descendants of the node and is potentially very // expensive. If the node is not a shadow root then assigning slottables to it won't // have any effect, so we take a fast path out. - if !self.is::<ShadowRoot>() { + let Some(shadow_root) = self.downcast::<ShadowRoot>() else { + return; + }; + + if !shadow_root.has_slot_descendants() { return; } |