Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 5f614bee7105d19f74d3322b9d15ff62e218a442
https://github.com/WebKit/WebKit/commit/5f614bee7105d19f74d3322b9d15ff62e218a442
Author: Qianlang Chen <[email protected]>
Date: 2025-12-15 (Mon, 15 Dec 2025)
Changed paths:
M LayoutTests/platform/mac-wk1/TestExpectations
M Source/JavaScriptCore/inspector/remote/RemoteControllableTarget.h
M Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm
M Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.cpp
M Source/WebCore/inspector/InspectorBackendClient.h
M Source/WebCore/inspector/InspectorFrontendClientLocal.h
M Source/WebCore/page/Page.cpp
M Source/WebCore/page/PageDebuggable.h
A Source/WebKitLegacy/WebCoreSupport/LegacyWebPageDebuggable.cpp
A Source/WebKitLegacy/WebCoreSupport/LegacyWebPageDebuggable.h
A Source/WebKitLegacy/WebCoreSupport/LegacyWebPageInspectorController.cpp
A Source/WebKitLegacy/WebCoreSupport/LegacyWebPageInspectorController.h
M Source/WebKitLegacy/WebKitLegacy.xcodeproj/project.pbxproj
M Source/WebKitLegacy/cf/WebCoreSupport/WebInspectorClientCF.cpp
M Source/WebKitLegacy/ios/WebCoreSupport/WebInspectorClientIOS.mm
M Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.h
M Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm
M Source/WebKitLegacy/mac/WebView/WebFrame.mm
M Source/WebKitLegacy/mac/WebView/WebFrameInternal.h
M Source/WebKitLegacy/mac/WebView/WebView.mm
M Source/WebKitLegacy/mac/WebView/WebViewData.h
M Source/WebKitLegacy/mac/WebView/WebViewInternal.h
Log Message:
-----------
Web Inspector: Make frame targets compatible with WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=302125
rdar://problem/164203459
Reviewed by BJ Burg.
With our plan to slowly move inspector agent implementations from the
page target + InspectorController to the frame target + FrameInspectorController
for site isolation, we run into the issue that inspecting WK1 uses a
WI.DirectBackendTarget
to directly contact the InspectorController, so any domains moving out
of the page will become opaque to that DirectBackendTarget.
To solve this compatibility issue and hopefully prevent having to leave
copies of any old agent code in the page that we must still maintain,
introduce a multi-target support to WK1 so that inspector frontend can
use WI.MultiplexingBackendTarget to inspect either WK1 or WK2. This is
done by adding LegacyWebPage{Debuggable,InspectorController} acting as
destinations of "web-page"-typed debuggable and target in WK1, which
will route commands and events to the appropriate targets just like in
WK2, except without using IPC.
Test: re-enabled target-manager.html for WK1. No new tests otherwise;
inspection of WebKitLegacy should have no observable difference.
* LayoutTests/platform/mac-wk1/TestExpectations:
* Source/JavaScriptCore/inspector/remote/RemoteControllableTarget.h:
* Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm:
(Inspector::RemoteInspector::listingForInspectionTarget const):
* Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.cpp:
(Inspector::RemoteInspector::listingForInspectionTarget const):
* Source/WebCore/inspector/InspectorBackendClient.h:
(WebCore::InspectorBackendClient::allowRemoteInspectionToPageDirectly const):
Deleted.
* Source/WebCore/inspector/InspectorFrontendClientLocal.h:
* Source/WebCore/page/Page.cpp:
(WebCore::m_mediaSessionManagerFactory):
* Source/WebKitLegacy/WebCoreSupport/LegacyWebPageDebuggable.cpp: Added.
(LegacyWebPageDebuggable::LegacyWebPageDebuggable):
(LegacyWebPageDebuggable::create):
(LegacyWebPageDebuggable::name const):
(LegacyWebPageDebuggable::url const):
(LegacyWebPageDebuggable::hasLocalDebugger const):
(LegacyWebPageDebuggable::connect):
(LegacyWebPageDebuggable::disconnect):
(LegacyWebPageDebuggable::dispatchMessageFromRemote):
(LegacyWebPageDebuggable::setIndicating):
(LegacyWebPageDebuggable::setNameOverride):
(LegacyWebPageDebuggable::detachFromPage):
* Source/WebKitLegacy/WebCoreSupport/LegacyWebPageDebuggable.h: Added.
* Source/WebKitLegacy/WebCoreSupport/LegacyWebPageInspectorController.cpp:
Added.
(PageTarget::identifier):
(PageTarget::PageTarget):
(FrameTarget::identifier):
(FrameTarget::FrameTarget):
(LegacyWebPageInspectorController::create):
(LegacyWebPageInspectorController::LegacyWebPageInspectorController):
(LegacyWebPageInspectorController::frameCreated):
(LegacyWebPageInspectorController::frameDestroying):
(LegacyWebPageInspectorController::pageDestroying):
(LegacyWebPageInspectorController::addTarget):
(LegacyWebPageInspectorController::removeTarget):
(LegacyWebPageInspectorController::connectFrontend):
(LegacyWebPageInspectorController::disconnectFrontend):
(LegacyWebPageInspectorController::hasLocalFrontend const):
(LegacyWebPageInspectorController::disconnectAllFrontends):
(LegacyWebPageInspectorController::dispatchMessageFromFrontend):
(LegacyWebPageInspectorController::sendMessageToInspectorFrontend):
* Source/WebKitLegacy/WebCoreSupport/LegacyWebPageInspectorController.h: Added.
* Source/WebKitLegacy/WebKitLegacy.xcodeproj/project.pbxproj:
* Source/WebKitLegacy/cf/WebCoreSupport/WebInspectorClientCF.cpp:
(WebInspectorClient::sendMessageToFrontend):
* Source/WebKitLegacy/ios/WebCoreSupport/WebInspectorClientIOS.mm:
(WebInspectorFrontendClient::WebInspectorFrontendClient):
* Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.h:
* Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm:
(WebInspectorClient::openLocalFrontend):
(WebInspectorFrontendClient::WebInspectorFrontendClient):
(WebInspectorFrontendClient::sendMessageToBackend):
(-[WebInspectorWindowController destroyInspectorView]):
* Source/WebKitLegacy/mac/WebView/WebFrame.mm:
(+[WebFrame _createFrameWithPage:frameName:frameView:ownerElement:]):
(+[WebFrame _createMainFrameWithPage:frameName:frameView:]):
(-[WebFrame _clearCoreFrame]):
* Source/WebKitLegacy/mac/WebView/WebFrameInternal.h:
* Source/WebKitLegacy/mac/WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):
(-[WebView _close]):
(-[WebView allowsRemoteInspection]):
(-[WebView setAllowsRemoteInspection:]):
(-[WebView inspectorController]):
* Source/WebKitLegacy/mac/WebView/WebViewData.h:
* Source/WebKitLegacy/mac/WebView/WebViewInternal.h:
Canonical link: https://commits.webkit.org/304467@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications