Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0b875949630e5c22a883a9873d1c7bf0c0aecd18
      
https://github.com/WebKit/WebKit/commit/0b875949630e5c22a883a9873d1c7bf0c0aecd18
  Author: Anuj Panta <[email protected]>
  Date:   2026-09-16 (Wed, 16 Sep 2026)

  Changed paths:
    M LayoutTests/inspector/dom-debugger/command-line-api-event.html
    M LayoutTests/inspector/dom-debugger/dom-breakpoint-attribute-modified.html
    M 
LayoutTests/inspector/dom-debugger/dom-breakpoint-node-removed-ancestor.html
    M LayoutTests/inspector/dom-debugger/dom-breakpoint-node-removed-direct.html
    M 
LayoutTests/inspector/dom-debugger/dom-breakpoint-subtree-modified-add.html
    M 
LayoutTests/inspector/dom-debugger/dom-breakpoint-subtree-modified-remove.html
    M LayoutTests/inspector/dom-debugger/event-listener-breakpoints.html
    M LayoutTests/platform/mac-site-isolation/TestExpectations
    M Source/WebCore/inspector/FrameInspectorController.h
    M Source/WebCore/inspector/InspectorInstrumentation.cpp
    M Source/WebCore/inspector/agents/InspectorDOMDebuggerAgent.cpp
    M Source/WebCore/inspector/agents/InspectorDOMDebuggerAgent.h
    M Source/WebCore/inspector/agents/page/PageDOMDebuggerAgent.cpp

  Log Message:
  -----------
  Web Inspector: DOMDebugger breakpoints never fire under site isolation
https://bugs.webkit.org/show_bug.cgi?id=323367
rdar://186605764

Reviewed by Qianlang Chen.

Under site isolation PageDebugger never attaches to any global object:
attachDebugger returns before Page::setDebugger, leaving per-frame debugging to
FrameDebugger. The page's DOMDebugger agent didn't notice, and kept matching
breakpoints and scheduling pauses on a debugger that no JavaScript points back
at, so the schedule call succeeds, stepping mode matches nothing, and the pause
quietly disappears with no error.

The fix leaves all breakpoint matching and state on the page agent and redirects
only the pause itself to whichever debugger agent is actually attached. For the
timer, animation frame, and URL hooks that resolution is already done by the
instrumentation layer: instrumentingAgents(ScriptExecutionContext&) returns the
frame's InstrumentingAgents, whose enabledWebDebuggerAgent() is the frame's
FrameDebuggerAgent when the frame's Debugger domain is enabled and falls back to
the page's PageDebuggerAgent otherwise. So those hooks now take the resolved
agent instead of a context or a frame, and InspectorInstrumentation.h needs no
changes at all. The agent can be null when no Debugger domain is enabled, so
each hook null-checks before using it.

DOM mutation breakpoints cannot use that resolution and keep resolving through
pausingDebuggerAgentForFrame: they gate on the frame that owns the breakpoint
rather than the one that mutated, since innerParentNode walks across iframe
boundaries and the two frames' debuggers can disagree about whether breakpoints
are active.

Console $event moves along with the pause, because evaluateOnCallFrame reads it
from the paused target's injected script manager, and FrameInspectorController
owns one separate from the page's. didHandleEvent cancels on both candidate
agents, since the frame's Debugger domain can be enabled partway through a
dispatch and an arm left uncancelled occupies the debugger's only
special-breakpoint slot.

Seven layout tests also move off the bare DebuggerAgent global, which the
harness resolves to the page target while the pause now lands on the frame.
url-breakpoints-dom-text-and-regex.html was skipped because the dropped pause
hung its awaitEvent(Paused), and attribute-modified-style.html failed for the
same reason; both now pass and come off the site-isolation expectations.

* LayoutTests/inspector/dom-debugger/command-line-api-event.html:
* LayoutTests/inspector/dom-debugger/dom-breakpoint-attribute-modified.html:
* LayoutTests/inspector/dom-debugger/dom-breakpoint-node-removed-ancestor.html:
* LayoutTests/inspector/dom-debugger/dom-breakpoint-node-removed-direct.html:
* LayoutTests/inspector/dom-debugger/dom-breakpoint-subtree-modified-add.html:
* 
LayoutTests/inspector/dom-debugger/dom-breakpoint-subtree-modified-remove.html:
* LayoutTests/inspector/dom-debugger/event-listener-breakpoints.html:
* LayoutTests/platform/mac-site-isolation/TestExpectations:
* Source/WebCore/inspector/FrameInspectorController.h:
(WebCore::FrameInspectorController::injectedScriptManager const):
* Source/WebCore/inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willSendXMLHttpRequestImpl):
(WebCore::InspectorInstrumentation::willFetchImpl):
(WebCore::InspectorInstrumentation::willFireTimerImpl):
(WebCore::InspectorInstrumentation::didFireTimerImpl):
(WebCore::InspectorInstrumentation::willSendRequestImpl):
(WebCore::InspectorInstrumentation::willSendRequestOfTypeImpl):
(WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
(WebCore::InspectorInstrumentation::didFireAnimationFrameImpl):
* Source/WebCore/inspector/agents/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::pausingDebuggerAgentForFrame const):
(WebCore::InspectorDOMDebuggerAgent::pausingDebuggerAgent const):
(WebCore::InspectorDOMDebuggerAgent::injectedScriptManagerForContext const):
(WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
(WebCore::InspectorDOMDebuggerAgent::didHandleEvent):
(WebCore::InspectorDOMDebuggerAgent::willFireTimer):
(WebCore::InspectorDOMDebuggerAgent::didFireTimer):
(WebCore::InspectorDOMDebuggerAgent::willFireAnimationFrame):
(WebCore::InspectorDOMDebuggerAgent::didFireAnimationFrame):
(WebCore::InspectorDOMDebuggerAgent::willSendRequest):
(WebCore::InspectorDOMDebuggerAgent::willSendRequestOfType):
(WebCore::InspectorDOMDebuggerAgent::breakOnURLIfNeeded):
(WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
(WebCore::InspectorDOMDebuggerAgent::willFetch):
* Source/WebCore/inspector/agents/InspectorDOMDebuggerAgent.h:
* Source/WebCore/inspector/agents/page/PageDOMDebuggerAgent.cpp:
(WebCore::PageDOMDebuggerAgent::willInsertDOMNode):
(WebCore::PageDOMDebuggerAgent::willRemoveDOMNode):
(WebCore::PageDOMDebuggerAgent::willModifyDOMAttr):
(WebCore::PageDOMDebuggerAgent::willInvalidateStyleAttr):
(WebCore::PageDOMDebuggerAgent::buildPauseDataForDOMBreakpoint):

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



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

Reply via email to