Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: deb08bf571fcc65fa3c3982fe59fff757ddd5043
      
https://github.com/WebKit/WebKit/commit/deb08bf571fcc65fa3c3982fe59fff757ddd5043
  Author: Jessica Lee <[email protected]>
  Date:   2026-07-15 (Wed, 15 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.

This commit relands 316735@main after fixing its consequent test flakiness in 
317177@main.

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/317263@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to