diff --git a/Userland/Libraries/LibWeb/DOM/ShadowRoot.h b/Userland/Libraries/LibWeb/DOM/ShadowRoot.h index 3eedffbd51..1456fbb9f0 100644 --- a/Userland/Libraries/LibWeb/DOM/ShadowRoot.h +++ b/Userland/Libraries/LibWeb/DOM/ShadowRoot.h @@ -48,7 +48,7 @@ private: }; template<> -inline bool Node::fast_is() const { return is_shadow_root(); } +inline bool Node::fast_is() const { return node_type() == to_underlying(NodeType::DOCUMENT_FRAGMENT_NODE) && is_shadow_root(); } template inline IterationDecision Node::for_each_shadow_including_inclusive_descendant(Callback callback)