Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d98000f4188c83559b3f3f17667d705afa122a76
https://github.com/WebKit/WebKit/commit/d98000f4188c83559b3f3f17667d705afa122a76
Author: Ryosuke Niwa <[email protected]>
Date: 2025-12-08 (Mon, 08 Dec 2025)
Changed paths:
M Source/WebCore/dom/Element.cpp
M Source/WebCore/dom/EventNames.json
M Tools/TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm
Log Message:
-----------
Add focus and blur events that always bubble up all the way to window for
autofill implementation
https://bugs.webkit.org/show_bug.cgi?id=303675
Reviewed by Ben Nham.
This PR introduces webkitbeforefocus and webkitbeforeblur events which are
equivalent of focus and blur
events but without a related target. The lack of related target causes these
events to bubble up all
the way to document node, allowing autofill implementation to efficiently
listen to these events without
adding an event listener to each shadow root.
Test: TestWebKitAPI.WKUserContentController.BeforeFocusEvent
TestWebKitAPI.WKUserContentController.BeforeBlurEvent
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::dispatchFocusEvent):
(WebCore::Element::dispatchBlurEvent):
* Source/WebCore/dom/EventNames.json:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm:
(TEST(WKUserContentController, BeforeFocusEvent)):
(TEST(WKUserContentController, BeforeBlurEvent)):
Canonical link: https://commits.webkit.org/304112@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications