Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d0900ac81f03516b00ccbc355cf9e5fe276c9bec
https://github.com/WebKit/WebKit/commit/d0900ac81f03516b00ccbc355cf9e5fe276c9bec
Author: Qianlang Chen <[email protected]>
Date: 2026-02-16 (Mon, 16 Feb 2026)
Changed paths:
R LayoutTests/http/tests/inspector/console/message-from-iframe-expected.txt
R LayoutTests/http/tests/inspector/console/message-from-iframe.html
R LayoutTests/http/tests/inspector/console/message-from-worker-expected.txt
R LayoutTests/http/tests/inspector/console/message-from-worker.html
R LayoutTests/http/tests/inspector/console/resources/console-messages.html
R
LayoutTests/http/tests/inspector/console/resources/embedded-cross-origin.html
R
LayoutTests/http/tests/inspector/console/resources/embedded-same-origin.html
R LayoutTests/http/tests/inspector/console/resources/worker-in-iframe.html
R LayoutTests/http/tests/inspector/console/resources/worker.js
A
LayoutTests/http/tests/site-isolation/inspector/console/message-from-iframe-expected.txt
A
LayoutTests/http/tests/site-isolation/inspector/console/message-from-iframe.html
A
LayoutTests/http/tests/site-isolation/inspector/console/message-from-worker-expected.txt
A
LayoutTests/http/tests/site-isolation/inspector/console/message-from-worker.html
A
LayoutTests/http/tests/site-isolation/inspector/console/resources/console-messages.html
A
LayoutTests/http/tests/site-isolation/inspector/console/resources/embedded-cross-origin.html
A
LayoutTests/http/tests/site-isolation/inspector/console/resources/embedded-same-origin.html
A
LayoutTests/http/tests/site-isolation/inspector/console/resources/worker-in-iframe.html
A
LayoutTests/http/tests/site-isolation/inspector/console/resources/worker.js
M LayoutTests/platform/mac-wk2/TestExpectations
M Source/JavaScriptCore/inspector/protocol/Console.json
M Source/WebCore/CMakeLists.txt
M Source/WebCore/Sources.txt
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
M Source/WebCore/inspector/FrameInspectorController.cpp
M Source/WebCore/inspector/FrameInspectorController.h
A Source/WebCore/inspector/agents/frame/FrameConsoleAgent.cpp
A Source/WebCore/inspector/agents/frame/FrameConsoleAgent.h
M Source/WebCore/page/LocalFrame.cpp
M Source/WebInspectorUI/UserInterface/Controllers/ConsoleManager.js
M Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js
M Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js
M Source/WebInspectorUI/UserInterface/Protocol/Target.js
M Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js
M Source/WebKit/WebProcess/WebPage/WebPage.cpp
Log Message:
-----------
[Site Isolation] Web Inspector: Re-land implement Console domain for frame
targets
https://bugs.webkit.org/show_bug.cgi?id=307736
Reviewed by BJ Burg.
Re-introduce the console agent implementation for the frame target type
to support site isolation. Re-land the work in 304493@main that was
reverted by 306530@main.
Make FrameInspectorController, the message handler of the frame target,
only create a console agent under site isolation. That way, without
the FrameConsoleAgent, we make use of the instrumentingAgents' fallback
mechanism to continue delegating console events to the parent page.
This idea can be generalized for other agents that we'll implement for
frame targets down the road: any old backend behavior can be restored
simply by not creating the corresponding agent in FrameIC.
The site isolation setting in WebCore comes from the WebCore::Page's
m_settings. However, for the main frame, that object is not populated
as part of the page's constructor but only later by WebPage. This means
the SI setting may be available only after FrameIC's constructor, and we
handle that specifically to still create console agent in time.
We assume that the SI setting is set when any page and frame is created
and is never changed afterwards while the page is running. Thus, we
don't otherwise create or destroy the console agent during the FrameIC's
lifetime.
Move the message-from-iframe and message-from-worker tests from
tests/inspector into tests/site-isolation-inspector because they should
always be run with SI enabled, which their new directory will achieve
that since 307386@main.
For these two tests, there are sub-tests not passing that involve
creating a cross-origin iframe with JS. We will address in a follow-up
patch; the problem appears to be around frame target creation's timing
rather than about the console. (Filed https://webkit.org/b/307733)
Test: http/tests/site-isolation/inspector/console/message-from-iframe.html
* LayoutTests/http/tests/inspector/console/message-from-iframe-expected.txt:
Removed.
* LayoutTests/http/tests/inspector/console/message-from-worker-expected.txt:
Removed.
*
LayoutTests/http/tests/site-isolation/inspector/console/message-from-iframe-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/console/message-from-iframe.html:
Renamed from LayoutTests/http/tests/inspector/console/message-from-iframe.html.
*
LayoutTests/http/tests/site-isolation/inspector/console/message-from-worker-expected.txt:
Renamed from
LayoutTests/http/tests/inspector/console/message-from-worker-expected.txt.
*
LayoutTests/http/tests/site-isolation/inspector/console/message-from-worker.html:
Renamed from LayoutTests/http/tests/inspector/console/message-from-worker.html.
*
LayoutTests/http/tests/site-isolation/inspector/console/resources/console-messages.html:
Renamed from
LayoutTests/http/tests/inspector/console/resources/console-messages.html.
*
LayoutTests/http/tests/site-isolation/inspector/console/resources/embedded-cross-origin.html:
Renamed from
LayoutTests/http/tests/inspector/console/resources/embedded-cross-origin.html.
*
LayoutTests/http/tests/site-isolation/inspector/console/resources/embedded-same-origin.html:
Renamed from
LayoutTests/http/tests/inspector/console/resources/embedded-same-origin.html.
*
LayoutTests/http/tests/site-isolation/inspector/console/resources/worker-in-iframe.html:
Renamed from
LayoutTests/http/tests/inspector/console/resources/worker-in-iframe.html.
* LayoutTests/http/tests/site-isolation/inspector/console/resources/worker.js:
Renamed from LayoutTests/http/tests/inspector/console/resources/worker.js.
* LayoutTests/platform/mac-wk2/TestExpectations:
* Source/JavaScriptCore/inspector/protocol/Console.json:
* Source/WebCore/CMakeLists.txt:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/inspector/FrameInspectorController.cpp:
(WebCore::FrameInspectorController::FrameInspectorController):
(WebCore::FrameInspectorController::siteIsolationFirstEnabled):
(WebCore::FrameInspectorController::createConsoleAgentForSiteIsolation):
* Source/WebCore/inspector/FrameInspectorController.h:
* Source/WebCore/inspector/agents/frame/FrameConsoleAgent.cpp: Added.
(WebCore::FrameConsoleAgent::FrameConsoleAgent):
(WebCore::FrameConsoleAgent::getLoggingChannels):
(WebCore::FrameConsoleAgent::setLoggingChannelLevel):
* Source/WebCore/inspector/agents/frame/FrameConsoleAgent.h: Added.
* Source/WebCore/page/LocalFrame.cpp:
(WebCore::LocalFrame::LocalFrame):
* Source/WebInspectorUI/UserInterface/Controllers/ConsoleManager.js:
(WI.ConsoleManager.prototype.initializeTarget):
(WI.ConsoleManager.prototype.messageWasAdded):
(WI.ConsoleManager.prototype.requestClearMessages):
* Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.dataForTarget):
* Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject):
* Source/WebInspectorUI/UserInterface/Protocol/Target.js:
(WI.Target.prototype.initialize):
* Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createConsoleSettingsView):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::m_isPopup):
Canonical link: https://commits.webkit.org/307665@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications