Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b9eb9b71e0ec6e18d0d6877b9e80706f2446b41f
https://github.com/WebKit/WebKit/commit/b9eb9b71e0ec6e18d0d6877b9e80706f2446b41f
Author: Qianlang Chen <[email protected]>
Date: 2026-04-03 (Fri, 03 Apr 2026)
Changed paths:
M LayoutTests/http/tests/site-isolation/inspector/target/target-expected.txt
M LayoutTests/http/tests/site-isolation/inspector/target/target.html
M
LayoutTests/inspector/runtime/execution-context-in-scriptless-page-expected.txt
M LayoutTests/inspector/runtime/execution-context-in-scriptless-page.html
M LayoutTests/platform/mac-site-isolation/TestExpectations
M Source/WebCore/inspector/agents/frame/FrameRuntimeAgent.cpp
Log Message:
-----------
[Site Isolation] Web Inspector: Fix execution-context-in-scriptless-page.html
layout test under site isolation
https://bugs.webkit.org/show_bug.cgi?id=311306
rdar://173898659
Reviewed by BJ Burg.
Progress the test by converting it into an inspector-test which supports
working with frame targets to optionally handle site isolation
behaviors.
Update the test description since we're listening to events from Web
Inspector objects (like Frame or FrameTarget) rather than protocol
events.
Modify the last assertion in the test: querying for the body's text
content didn't work because the execution context was reported at a time
when document parsing was not yet complete, so the text was not yet
loaded. Rather than adding code to wait for the parsing, evaluate
something else identifiable to still keep the testing power.
This test ended up exposing a bug in the frame Runtime agent. When a
cross-origin iframe is added, it first loads about:blank (call the
"initial empty document") and then later loads the true destination URL.
This results in two ExecutionContextAdded events. We originally
correctly guarded that dual-reporting in
FrameRuntimeAgent::reportExecutionContextCreation
with the early-return on isAboutBlank, but it's uncovered in the
FrameRuntimeAgent::didClearWindowObjectInWorld code path. Fix it by
adding the guard to that code path as well, and made the guard more
precise by using isDisplayingInitialEmptyDocument over isAboutBlank
in case about:blank was indeed the intended destination.
As a drive-by, add a frame target lifetime test case for the
"data: URL"-typed iframe since it's still a different kind than
same-origin or cross-origin iframes.
Verified test progression with
run-webkit-tests --site-isolation execution-context-in-scriptless-page.html
*
LayoutTests/inspector/runtime/execution-context-in-scriptless-page-expected.txt:
* LayoutTests/inspector/runtime/execution-context-in-scriptless-page.html:
* LayoutTests/platform/mac-site-isolation/TestExpectations:
Fix the test by converting the protocol-test into an inspector-test.
* Source/WebCore/inspector/agents/frame/FrameRuntimeAgent.cpp:
(WebCore::FrameRuntimeAgent::reportExecutionContextCreation):
(WebCore::FrameRuntimeAgent::didClearWindowObjectInWorld):
Fix an issue in Runtime agent exposed by the test that we were
reporting creating an execution context unexpectedly through the
didClearWindowObjectInWorld code path.
* LayoutTests/http/tests/site-isolation/inspector/target/target-expected.txt:
* LayoutTests/http/tests/site-isolation/inspector/target/target.html:
Add a test scenario for loading a data: URL iframe.
Canonical link: https://commits.webkit.org/310540@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications