Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 41da44fea54c6e458355f05e30710c44df74df64
https://github.com/WebKit/WebKit/commit/41da44fea54c6e458355f05e30710c44df74df64
Author: Wenson Hsieh <[email protected]>
Date: 2026-01-28 (Wed, 28 Jan 2026)
Changed paths:
M Source/WebKit/Shared/WebPageCreationParameters.h
M Source/WebKit/Shared/WebPageCreationParameters.serialization.in
M Source/WebKit/UIProcess/API/APIPageConfiguration.h
M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
M Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm
M Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
M Source/WebKit/WebProcess/WebPage/WebPage.cpp
M Source/WebKit/WebProcess/WebPage/WebPage.h
M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/TextExtractionTests.mm
Log Message:
-----------
[AutoFill Debugging] Add a configuration flag to prevent the layer tree from
freezing during text extraction
https://bugs.webkit.org/show_bug.cgi?id=306395
rdar://168625433
Reviewed by Abrar Rahman Protyasha.
Add support for a new web view configuration flag, which:
1. Prevents the layer tree from getting frozen if the host app getting
backgrounded
2. Prevents rAF and other timers from getting suspended or throttled in the
background
Note that this capability is limited only to full web browsers (and is enforced
by raising an
exception in the app process if a non-browser attempts to enable this, along
with a release
assertion in the web process upon creating the webpage).
Test: TextExtractionTests.ClickInteractionWhileInBackground
* Source/WebKit/Shared/WebPageCreationParameters.h:
* Source/WebKit/Shared/WebPageCreationParameters.serialization.in:
* Source/WebKit/UIProcess/API/APIPageConfiguration.h:
(API::PageConfiguration::setBackgroundTextExtractionEnabled):
(API::PageConfiguration::backgroundTextExtractionEnabled const):
Add the new flag.
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _performInteraction:completionHandler:]):
Drive-by fix: also grab the text extraction background assertion when
performing interactions (we
currently only do this when retrieving context).
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration _setBackgroundTextExtractionEnabled:]):
Crash with a descriptive message if the embedding app is NOT a web browser (or
testing), but the
client attempts to enable this flag.
(-[WKWebViewConfiguration _backgroundTextExtractionEnabled]):
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* Source/WebKit/UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::isActiveViewVisible):
Treat the web view as visible as long as it's in a window, even if the app is
in the background.
This (among other things) prevents rAF callbacks from being indefinitely
pending.
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::m_backgroundTextExtractionEnabled):
(WebKit::m_toolbarsAreVisible): Deleted.
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::applicationDidEnterBackground):
(WebKit::WebPage::applicationWillEnterForeground):
Avoid freezing / unfreezing the layer tree if the flag is set, when entering /
exiting the
background.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/TextExtractionTests.mm:
(TestWebKitAPI::TEST(TextExtractionTests, ClickInteractionWhileInBackground)):
Add an API test that times out when simulating a click, unless this new
property is set.
Canonical link: https://commits.webkit.org/306368@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications