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
This commit is contained in:
Luke Wilde 2021-09-02 19:33:01 +01:00 committed by Andreas Kling
commit b275b8c87a
Notes: sideshowbarker 2024-07-18 04:51:21 +09:00

View file

@ -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;