[webkit-changes] [WebKit/WebKit] 80b26f: composedPath returns empty array for blur/focus/pa...
Ryosuke Niwa
noreply at github.com
Thu Mar 9 13:43:12 PST 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 80b26f0e3d9ab9f091390232abbdfae07ff82476
https://github.com/WebKit/WebKit/commit/80b26f0e3d9ab9f091390232abbdfae07ff82476
Author: Ryosuke Niwa <rniwa at webkit.org>
Date: 2023-03-09 (Thu, 09 Mar 2023)
Changed paths:
A LayoutTests/fast/events/focus-blur-event-path-expected.txt
A LayoutTests/fast/events/focus-blur-event-path.html
A LayoutTests/fast/events/pageshow-pagehide-event-path-expected.txt
A LayoutTests/fast/events/pageshow-pagehide-event-path.html
M Source/WebCore/dom/EventContext.cpp
M Source/WebCore/dom/EventContext.h
M Source/WebCore/dom/EventPath.cpp
M Source/WebCore/dom/EventPath.h
M Source/WebCore/page/DOMWindow.cpp
Log Message:
-----------
composedPath returns empty array for blur/focus/pagehide/pageshow events on window
https://bugs.webkit.org/show_bug.cgi?id=253443
Reviewed by Chris Dumez.
The bug was caused by DOMWindow::dispatchEvent not setting the EventPath.
* LayoutTests/fast/events/focus-blur-event-path-expected.txt: Added.
* LayoutTests/fast/events/focus-blur-event-path.html: Added.
* LayoutTests/fast/events/pageshow-pagehide-event-path-expected.txt: Added.
* LayoutTests/fast/events/pageshow-pagehide-event-path.html: Added.
* Source/WebCore/dom/EventContext.cpp:
(WebCore::EventContext::isUnreachableNode const): Added a nullptr check.
* Source/WebCore/dom/EventContext.h:
(WebCore::EventContext::EventContext): Removed the assertion since this assertion
will be wrong after this patch (we sometimes pass Document as currentTarget here).
* Source/WebCore/dom/EventPath.cpp:
(WebCore::EventPath::EventPath): Added a variant which takes a single EventTarget.
* Source/WebCore/dom/EventPath.h:
* Source/WebCore/page/DOMWindow.cpp:
(WebCore::DOMWindow::dispatchEvent): Fixed the bug by setting the event path.
Canonical link: https://commits.webkit.org/261463@main
More information about the webkit-changes
mailing list