Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8da8436c7a4aa33549884da99ba026fc982064e7
      
https://github.com/WebKit/WebKit/commit/8da8436c7a4aa33549884da99ba026fc982064e7
  Author: Razvan Caliman <[email protected]>
  Date:   2025-10-14 (Tue, 14 Oct 2025)

  Changed paths:
    M Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js
    M 
Source/WebInspectorUI/UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js
    M Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js
    M Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js
    M Source/WebInspectorUI/UserInterface/Views/ThreadTreeElement.js

  Log Message:
  -----------
  Web Inspector: REGRESSION(300338@main) Sources: Breakpoints don't work
https://bugs.webkit.org/show_bug.cgi?id=300702
rdar://162603099

Reviewed by Devin Rousso and BJ Burg.

Web Inspector operates with the assumption that all target types support
the Debugger, Console, and Runtime domains.

The newly introduced frame target, added in 
https://commits.webkit.org/300338@main,
is part of a wider migration of logic and currently does not support the 
Debugger domain.
There are guards on the frontend to prevent it from being used in the meanwhile.

When a target is created, various parts of the frontend attempt to get or 
create a
`WI.DebuggerData` for it via `WI.debuggerManager.prototype.dataForTarget()`
without checking the capabilities of the target.

When a breakpoint hits in the page target, logic in 
`WI.DebuggerManager.debuggerDidPause()`
also pauses all other targets. Since the frame target does not have a Debugger 
domain
and associated agent, Web Inspector throws an exception trying to pause it.

This patch ensures the target supports the Debugger domain before returning an
instance of `WI.DebuggerData`. Call sites are updated to handle a `null` 
returnt.

* Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.dataForTarget):
* 
Source/WebInspectorUI/UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
* Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype._addResource):
(WI.OpenResourceDialog.prototype._addScriptsForTarget):
`WI.FrameTarget.mainResource` is currently `null` so there are no other 
resources hanging off of it.

* Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype._addThreadIndicatorForTarget):
* Source/WebInspectorUI/UserInterface/Views/ThreadTreeElement.js:
(WI.ThreadTreeElement.prototype.refresh):
(WI.ThreadTreeElement.prototype.populateContextMenu):
(WI.ThreadTreeElement.prototype._updateStatus):
(WI.ThreadTreeElement):
It's the `WI.ThreadTreeElement` which creates the `WI.DebuggerData` for the 
frame target
which then `WI.DebuggerManager.debuggerDidPause()` finds as an "otherTarget" to 
pause.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to