Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6e34cd704372251d3a6c8ca2e9e866ddbdd55dd9
https://github.com/WebKit/WebKit/commit/6e34cd704372251d3a6c8ca2e9e866ddbdd55dd9
Author: Qianlang Chen <[email protected]>
Date: 2026-05-13 (Wed, 13 May 2026)
Changed paths:
A
LayoutTests/http/tests/site-isolation/inspector/debugger/provisional-frame-target-pausing-expected.txt
A
LayoutTests/http/tests/site-isolation/inspector/debugger/provisional-frame-target-pausing.html
M
LayoutTests/http/tests/site-isolation/inspector/target/target-cross-origin-page-navigation-expected.txt
M
LayoutTests/http/tests/site-isolation/inspector/target/target-cross-origin-page-navigation.html
M Source/WebInspectorUI/UserInterface/Controllers/TargetManager.js
M Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp
M Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h
M Source/WebKit/UIProcess/ProvisionalPageProxy.cpp
M Source/WebKit/UIProcess/ProvisionalPageProxy.h
M Source/WebKit/UIProcess/WebFrameProxy.cpp
M Source/WebKit/UIProcess/WebPageProxy.cpp
Log Message:
-----------
[Site Isolation] Web Inspector: Implement pausing for provisional frame
targets
https://bugs.webkit.org/show_bug.cgi?id=313263
Reviewed by BJ Burg.
When a cross-origin navigation creates a provisional target, the opened
inspector frontend needs time to initialize domains (Debugger, Runtime,
etc.) on the new target before scripts run in the new process. Without
pausing, the loading continuation fires immediately, and scripts may
execute before the frontend has sent Debugger.enable, meaning early
breakpoints and debugger statements could be missed.
This patch adds pausing support for provisional frame targets, mirroring
the existing provisional page target pausing mechanism. When the
frontend receives a provisional frame target with isPaused=true, it
initializes the target's domains, then sends Target.resume to
start loading.
All three provisional frame target creation paths are covered:
1. Cross-origin sub-frame navigation
(WebFrameProxy::prepareForProvisionalLoadInProcess)
2. Cross-origin page navigation with a new main frame WebFrameProxy
(ProvisionalPageProxy constructor, m_shouldReuseMainFrame=false)
3. Cross-origin page navigation with a reused main frame WebFrameProxy
(ProvisionalPageProxy constructor, m_shouldReuseMainFrame=true)
Case 1 mimics the provisional page target pausing implementation in
WebPageProxy, optionally deferring the loading logic with
setContinueLoadingCallback.
For cases 2 and 3, the page-level shouldPauseLoading/setContinueLoadingCallback
now delegates to the provisional main frame target instead of the page
target. (Under SI, WebPageInspectorController now uses the provisional
main frame target to communicate isPaused and the continuation callback.)
This keeps the frame target as the authority on pausing, independent of
the page target, as a step to preparing for the eventual deprecation of
(provisional) page targets.
Test:
http/tests/site-isolation/inspector/debugger/provisional-frame-target-pausing.html
*
LayoutTests/http/tests/site-isolation/inspector/debugger/provisional-frame-target-pausing-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/debugger/provisional-frame-target-pausing.html:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/target/target-cross-origin-page-navigation-expected.txt:
*
LayoutTests/http/tests/site-isolation/inspector/target/target-cross-origin-page-navigation.html:
- Add layout test coverage.
- Update target-cross-origin-page-navigation to make use of the
pausing support when cancelling a provisional load. Before, we had
to hardcode a timeout to fake a slow loading to allow cancelling in
time, which was not ideal.
* Source/WebInspectorUI/UserInterface/Controllers/TargetManager.js:
(WI.TargetManager.prototype._createTarget):
* Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp:
(WebKit::getMainFrameTargetID):
(WebKit::WebPageInspectorController::shouldPauseLoadingForPage const):
(WebKit::WebPageInspectorController::setContinueLoadingCallbackForPage):
(WebKit::WebPageInspectorController::shouldPauseLoadingForFrame const):
(WebKit::WebPageInspectorController::setContinueLoadingCallbackForFrame):
(WebKit::WebPageInspectorController::willDestroyProvisionalFrame):
(WebKit::WebPageInspectorController::shouldPauseLoading const):
(WebKit::WebPageInspectorController::setContinueLoadingCallback):
* Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h:
- Add frontend API for pausing support.
- Rename existing page target API to avoid function overloading.
* Source/WebKit/UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::process const):
(WebKit::ProvisionalPageProxy::process): Deleted.
* Source/WebKit/UIProcess/ProvisionalPageProxy.h:
Add const qualifier to let shouldPauseLoading access the process on a
const ProvisionalPageProxy and benefit similar future callers.
* Source/WebKit/UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::prepareForProvisionalLoadInProcess):
To implement actual pausing, extract loading continuation, gating it on
shouldPauseLoading for the provisional frame target.
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::continueNavigationInNewProcess):
Canonical link: https://commits.webkit.org/313169@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications