Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7face0d04d81d87f81283963bcf1664f7de6dd80
      
https://github.com/WebKit/WebKit/commit/7face0d04d81d87f81283963bcf1664f7de6dd80
  Author: Qianlang Chen <[email protected]>
  Date:   2025-12-15 (Mon, 15 Dec 2025)

  Changed paths:
    M LayoutTests/http/tests/inspector/console/message-from-iframe-expected.txt
    M LayoutTests/http/tests/inspector/console/message-from-iframe.html
    M LayoutTests/inspector/console/clearMessages.html
    M LayoutTests/inspector/console/messagesCleared.html
    M LayoutTests/inspector/console/setConsoleClearAPIEnabled.html
    M LayoutTests/inspector/console/webcore-logging.html
    M LayoutTests/inspector/console/x-frame-options-message-expected.txt
    M LayoutTests/inspector/console/x-frame-options-message.html
    M LayoutTests/inspector/debugger/async-stack-trace-truncate-expected.txt
    M LayoutTests/inspector/debugger/async-stack-trace-truncate.html
    M LayoutTests/inspector/runtime/saveResult.html
    M LayoutTests/inspector/shadow-realm-console-expected.txt
    M LayoutTests/inspector/shadow-realm-console.html
    M Source/JavaScriptCore/inspector/protocol/Console.json
    M Source/WebCore/CMakeLists.txt
    M Source/WebCore/SaferCPPExpectations/UncountedCallArgsCheckerExpectations
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/inspector/FrameInspectorController.cpp
    M Source/WebCore/inspector/FrameInspectorController.h
    M Source/WebCore/inspector/PageInspectorController.cpp
    A Source/WebCore/inspector/agents/frame/FrameConsoleAgent.cpp
    A Source/WebCore/inspector/agents/frame/FrameConsoleAgent.h
    R Source/WebCore/inspector/agents/page/PageConsoleAgent.cpp
    R Source/WebCore/inspector/agents/page/PageConsoleAgent.h
    M Source/WebCore/page/LocalFrame.cpp
    M Source/WebInspectorUI/UserInterface/Controllers/ConsoleManager.js
    M Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js
    M Source/WebInspectorUI/UserInterface/Protocol/Target.js
    M Source/WebInspectorUI/UserInterface/Test/Test.js
    M Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js

  Log Message:
  -----------
  Web Inspector: Implement the Console domain and agent for the frame target 
type
https://webkit.org/b/298911
rdar://161133171

Reviewed by BJ Burg.

Implement the commands and events in the console inspector domain for,
the frame target type, replacing the existing console agent of the page
target. After this patch, commands and events of the console domain
delegate to the frame+FrameInspectorController instead of 
page+InspectorController.

Fix inspector tests involving window.ConsoleAgent to instead listen to
the main frame's console agent for messages instead, to reflect this
movement.

No new tests. Recently added test sets from [1] and [2] should cover
cases involving iframes and the console. Two tests were modified to
account for the slight, non-user-facing changes of console's behavior.
The user-facing behavior should stay the same as the current
single-process model.

- [1]: https://github.com/WebKit/WebKit/pull/52264
- [2]: https://github.com/WebKit/WebKit/pull/52398

* LayoutTests/http/tests/inspector/console/message-from-iframe-expected.txt:
* LayoutTests/http/tests/inspector/console/message-from-iframe.html:
   Log a distinct identifier for each frame to prevent the console
   messages coming from the page to be identified as a repeat and
   reported as a PreviousMessageRepeatCountUpdated event rather than
   MessageAdded. (This is the expected behavior now as far as how
   multi-target console works, since in the backend it's not easy to
   detect a message isn't a repeat because of an earlier message from
   a different target. For more info, see the fix to 
https://webkit.org/b/300728.)

* LayoutTests/inspector/console/clearMessages.html:
* LayoutTests/inspector/console/messagesCleared.html:
* LayoutTests/inspector/console/setConsoleClearAPIEnabled.html:
* LayoutTests/inspector/console/webcore-logging.html:
* LayoutTests/inspector/console/x-frame-options-message-expected.txt:
* LayoutTests/inspector/console/x-frame-options-message.html:
   Rewrite the protocol test with an inspector test as the message comes
   from a frame other than the main frame; protocol tests only target
   the main frame now, as of https://webkit.org/b/301304.

* LayoutTests/inspector/runtime/saveResult.html:
* LayoutTests/inspector/shadow-realm-console-expected.txt:
* LayoutTests/inspector/shadow-realm-console.html:
   Console messages come from the main frame instead of the page now.

* LayoutTests/inspector/debugger/async-stack-trace-truncate.html:
* LayoutTests/inspector/debugger/async-stack-trace-truncate-expected.txt:
   The test CheckDeeplyNestedDoesNotCrash may timeout with one million
   iterations on debug builds. Change to 100k iterations which still
   verifies the point.

* Source/JavaScriptCore/inspector/protocol/Console.json:
* Source/WebCore/CMakeLists.txt:
* Source/WebCore/SaferCPPExpectations/UncountedCallArgsCheckerExpectations:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/inspector/FrameInspectorController.cpp:
(WebCore::FrameInspectorController::FrameInspectorController):
* Source/WebCore/inspector/FrameInspectorController.h:
* Source/WebCore/inspector/PageInspectorController.cpp:
(WebCore::PageInspectorController::PageInspectorController):
* Source/WebCore/inspector/agents/frame/FrameConsoleAgent.cpp: Renamed from 
Source/WebCore/inspector/agents/page/PageConsoleAgent.cpp.
(WebCore::FrameConsoleAgent::FrameConsoleAgent):
(WebCore::FrameConsoleAgent::getLoggingChannels):
(WebCore::FrameConsoleAgent::setLoggingChannelLevel):
* Source/WebCore/inspector/agents/frame/FrameConsoleAgent.h: Renamed from 
Source/WebCore/inspector/agents/page/PageConsoleAgent.h.
* 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/Protocol/RemoteObject.js:
(WI.RemoteObject):
* Source/WebInspectorUI/UserInterface/Protocol/Target.js:
(WI.Target.prototype.initialize):
* Source/WebInspectorUI/UserInterface/Test/Test.js:
* Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createConsoleSettingsView):

Canonical link: https://commits.webkit.org/304493@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to