Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 742452b1b1a52e39dc1fcf865685ee47e4db15c8
https://github.com/WebKit/WebKit/commit/742452b1b1a52e39dc1fcf865685ee47e4db15c8
Author: Jessica Lee <[email protected]>
Date: 2026-07-08 (Wed, 08 Jul 2026)
Changed paths:
M Source/WebCore/page/FocusController.cpp
M Source/WebCore/page/FocusController.h
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/FocusWebView.mm
Log Message:
-----------
Blur and Focus events should only be dispatched if the window is both active
and focused.
https://bugs.webkit.org/show_bug.cgi?id=305846
rdar://168467484
Reviewed by Abrar Rahman Protyasha.
If a window comes into focus, the focus controller may dispatch excess events
currently. We should only dispatch
events when a window either becomes both focused & active or when a window
transition out of being both focused
and active.
Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/FocusWebView.mm
* Source/WebCore/page/FocusController.cpp:
(WebCore::FocusController::setFocusedInternal):
(WebCore::FocusController::setActivityState):
(WebCore::FocusController::setActiveInternal):
* Source/WebCore/page/FocusController.h:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/FocusWebView.mm:
(TestWebKitAPI::NoFocusEventsForBackgroundWindow)):
(TestWebKitAPI::SingleBlurEventWhenNoLongerActiveAndFocused)):
Canonical link: https://commits.webkit.org/316735@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications