Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 483d0e85a7aa800e14446d342ff69fe485e0be22
      
https://github.com/WebKit/WebKit/commit/483d0e85a7aa800e14446d342ff69fe485e0be22
  Author: Andy Estes <[email protected]>
  Date:   2026-06-01 (Mon, 01 Jun 2026)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm
    M Source/WebKit/UIProcess/ApplicationStateTracker.h
    M Source/WebKit/UIProcess/ApplicationStateTracker.mm
    M Source/WebKit/UIProcess/EndowmentStateTracker.h
    M Source/WebKit/UIProcess/EndowmentStateTracker.mm
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ios/ApplicationStateTracking.mm

  Log Message:
  -----------
  [iOS] Consider visibility endowments when determining if the application is 
in the background
https://bugs.webkit.org/show_bug.cgi?id=316028
rdar://178458157

Reviewed by Jer Noble.

ApplicationStateTracker currently tracks a web view's UIWindowScene 
activationState for determining
whether the web view is in the background or foreground. However, there are 
cases where the window
scene is in the background but the web view is still responsible for presenting 
content in another
foreground scene (e.g., via layer hosting). To cover those cases, teach 
ApplicationStateTracker to
consider itself in the foreground if the application has a visibility endowment.

Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ios/ApplicationStateTracking.mm

* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm:
(+[WKWebView _setVisibilityEndowmentForTesting:]):
* Source/WebKit/UIProcess/ApplicationStateTracker.h:
* Source/WebKit/UIProcess/ApplicationStateTracker.mm:
(WebKit::m_isInBackground):
(WebKit::ApplicationStateTracker::~ApplicationStateTracker):
(WebKit::ApplicationStateTracker::setScene):
(WebKit::ApplicationStateTracker::isWindowAndSceneInBackground const):
(WebKit::ApplicationStateTracker::updateIsInBackground):
(WebKit::ApplicationStateTracker::shouldBeInBackground const):
(WebKit::ApplicationStateTracker::applicationDidEnterBackground):
(WebKit::ApplicationStateTracker::applicationWillEnterForeground):
(WebKit::ApplicationStateTracker::isVisibleChanged):
* Source/WebKit/UIProcess/EndowmentStateTracker.h:
* Source/WebKit/UIProcess/EndowmentStateTracker.mm:
(WebKit::EndowmentStateTracker::setStateForTesting):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ios/ApplicationStateTracking.mm:
(TestWebKitAPI::EndowmentStateTrackingTestHarness::EndowmentStateTrackingTestHarness):
(TestWebKitAPI::EndowmentStateTrackingTestHarness::~EndowmentStateTrackingTestHarness):
(TestWebKitAPI::EndowmentStateTrackingTestHarness::postWithScene):
(TestWebKitAPI::EndowmentStateTrackingTestHarness::waitForActivityStateUpdate):
(TestWebKitAPI::EndowmentStateTrackingTestHarness::isPageActive):
(TestWebKitAPI::TEST(ApplicationStateTracking, 
EndowmentKeepsPageActiveAfterSceneBackgrounds)):
(TestWebKitAPI::TEST(ApplicationStateTracking, 
RevokingEndowmentDeactivatesBackgroundedScene)):
(TestWebKitAPI::TEST(ApplicationStateTracking, 
SceneForegroundReactivatesEvenWithoutEndowment)):

Canonical link: https://commits.webkit.org/314329@main



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

Reply via email to