Procházet zdrojové kódy

LibWeb: Check target's root instead of target itself in EventDispatcher

This was accidentally missing ".root()": "or parent is a node and
target’s _root_ is a shadow-including inclusive ancestor of parent"

https://dom.spec.whatwg.org/#concept-event-dispatch Step 5.9.6
Luke Wilde před 3 roky
rodič
revize
b275b8c87a

+ 1 - 1
Userland/Libraries/LibWeb/DOM/EventDispatcher.cpp

@@ -202,7 +202,7 @@ bool EventDispatcher::dispatch(NonnullRefPtr<EventTarget> target, NonnullRefPtr<
             }
 
             if (is<Window>(parent)
-                || (is<Node>(parent) && verify_cast<Node>(*target).is_shadow_including_inclusive_ancestor_of(verify_cast<Node>(*parent)))) {
+                || (is<Node>(parent) && verify_cast<Node>(*target).root().is_shadow_including_inclusive_ancestor_of(verify_cast<Node>(*parent)))) {
                 if (is_activation_event && event->bubbles() && !activation_target && parent->activation_behaviour)
                     activation_target = parent;