Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 15fea1ee0fc8f23a5b065d4ce9b8e89e30d76be2
https://github.com/WebKit/WebKit/commit/15fea1ee0fc8f23a5b065d4ce9b8e89e30d76be2
Author: Anuj Panta <[email protected]>
Date: 2026-10-07 (Wed, 07 Oct 2026)
Changed paths:
A
LayoutTests/http/tests/site-isolation/inspector/dom/highlight-frame-target-expected.txt
A
LayoutTests/http/tests/site-isolation/inspector/dom/highlight-frame-target.html
A
LayoutTests/http/tests/site-isolation/inspector/dom/highlight-target-handoff-frame-target-expected.txt
A
LayoutTests/http/tests/site-isolation/inspector/dom/highlight-target-handoff-frame-target.html
A
LayoutTests/http/tests/site-isolation/inspector/dom/resources/highlight-frame.html
A
LayoutTests/http/tests/site-isolation/inspector/dom/resources/highlight-rtl-frame.html
A
LayoutTests/http/tests/site-isolation/inspector/dom/resources/highlight-vertical-frame.html
M Source/JavaScriptCore/inspector/protocol/DOM.json
M Source/WebCore/Sources.txt
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
M Source/WebCore/inspector/FrameInspectorController.cpp
M Source/WebCore/inspector/InspectorOverlay.cpp
A Source/WebCore/inspector/InspectorOverlayConfigParser.cpp
A Source/WebCore/inspector/InspectorOverlayConfigParser.h
M Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
M Source/WebCore/inspector/agents/InspectorDOMAgent.h
M Source/WebCore/inspector/agents/frame/FrameDOMAgent.cpp
M Source/WebCore/inspector/agents/frame/FrameDOMAgent.h
M Source/WebCore/inspector/agents/frame/FrameDOMAgentStubs.cpp
M Source/WebInspectorUI/UserInterface/Base/Main.js
M Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js
M Source/WebInspectorUI/UserInterface/Models/DOMNode.js
M Source/WebKit/WebProcess/Inspector/WebInspectorBackendClient.cpp
Log Message:
-----------
Implement DOM highlight commands for FrameDOMAgent
https://bugs.webkit.org/show_bug.cgi?id=316139
rdar://178562987
Reviewed by BJ Burg.
Implements highlightNode, highlightNodeList, highlightRect, highlightQuad and
hideHighlight for FrameDOMAgent, replacing the stubs that returned "Not
supported for frame targets", so nodes inside a cross-origin iframe can be
highlighted.
The three *FromInspectorObject config parsers and their color and quad helpers
move out of InspectorDOMAgent into a shared InspectorOverlayConfigParser so both
agents use one implementation. The command bodies themselves are still
duplicated.
highlightRect and highlightQuad drop their ["page"] targetTypes override so they
match the other highlight commands, and their descriptions no longer claim
coordinates are relative to the main frame viewport, since for a frame target
they are relative to that frame.
paint() has to undo contentsToView() for a frame overlay: the surface is
OverlayType::Document and so receives contents coordinates, while everything
paint() emits is in root-view coordinates. The translation skips scrollOrigin(),
which PageOverlay::drawRect() has already applied, and is a no-op when scrolling
is delegated, matching contentsToView() itself.
Two frontend behavior changes are worth calling out. hideDOMNodeHighlight() no
longer skips frame targets, so its ~20 callers now send DOM.hideHighlight to
each
frame target as well. highlighting clears every other target via
hideDOMNodeHighlight({exceptTargets}), and highlightDOMNodeList groups nodes by
owning target, because one command carries IDs for one target only.
highlightDOMNodeForTwoSeconds() briefly flashes a highlight on a node that was
just revealed in the inspector. It looked the node up by ID in the page target's
node map, so a node inside a frame target was never found and never flashed. It
now takes the node itself.
The new tests check that the commands reach the frame target and are accepted,
including frames that are scrolled, right-to-left, and vertical writing mode.
They do not check where the highlight actually lands on screen, because no test
hook can observe what the overlay paints. The coordinate math above is verified
by manual testing only.
highlightSelector, highlightFrame, focus and getMediaStats stay stubbed and
page-only
Tests: http/tests/site-isolation/inspector/dom/highlight-frame-target.html
http/tests/site-isolation/inspector/dom/highlight-target-handoff-frame-target.html
*
LayoutTests/http/tests/site-isolation/inspector/dom/highlight-frame-target-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/dom/highlight-frame-target.html:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/dom/highlight-target-handoff-frame-target-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/dom/highlight-target-handoff-frame-target.html:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/dom/resources/highlight-frame.html:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/dom/resources/highlight-rtl-frame.html:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/dom/resources/highlight-vertical-frame.html:
Added.
* Source/JavaScriptCore/inspector/protocol/DOM.json:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/inspector/FrameInspectorController.cpp:
(WebCore::FrameInspectorController::createLazyAgents):
* Source/WebCore/inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::paint):
(WebCore::InspectorOverlay::drawElementTitle):
* Source/WebCore/inspector/InspectorOverlayConfigParser.cpp: Added.
(WebCore::parseInspectorColor):
(WebCore::parseRequiredConfigColor):
(WebCore::parseOptionalConfigColor):
(WebCore::parseInspectorQuad):
(WebCore::highlightConfigFromInspectorObject):
(WebCore::gridOverlayConfigFromInspectorObject):
(WebCore::flexOverlayConfigFromInspectorObject):
* Source/WebCore/inspector/InspectorOverlayConfigParser.h: Added.
* Source/WebCore/inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::highlightQuad):
(WebCore::InspectorDOMAgent::innerHighlightQuad):
(WebCore::InspectorDOMAgent::highlightFrame):
(WebCore::parseColor): Deleted.
(WebCore::parseRequiredConfigColor): Deleted.
(WebCore::parseOptionalConfigColor): Deleted.
(WebCore::parseQuad): Deleted.
(WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject): Deleted.
(WebCore::InspectorDOMAgent::gridOverlayConfigFromInspectorObject): Deleted.
(WebCore::InspectorDOMAgent::flexOverlayConfigFromInspectorObject): Deleted.
* Source/WebCore/inspector/agents/InspectorDOMAgent.h:
* Source/WebCore/inspector/agents/frame/FrameDOMAgent.cpp:
(WebCore::FrameDOMAgent::FrameDOMAgent):
(WebCore::FrameDOMAgent::innerHighlightQuad):
(WebCore::FrameDOMAgent::highlightRect):
(WebCore::FrameDOMAgent::highlightQuad):
(WebCore::FrameDOMAgent::highlightNode):
(WebCore::FrameDOMAgent::innerHighlightNode):
(WebCore::FrameDOMAgent::highlightNodeList):
(WebCore::FrameDOMAgent::innerHighlightNodeList):
(WebCore::FrameDOMAgent::hideHighlight):
* Source/WebCore/inspector/agents/frame/FrameDOMAgent.h:
* Source/WebCore/inspector/agents/frame/FrameDOMAgentStubs.cpp:
(WebCore::FrameDOMAgent::highlightSelector):
(WebCore::FrameDOMAgent::highlightRect): Deleted.
(WebCore::FrameDOMAgent::highlightQuad): Deleted.
(WebCore::FrameDOMAgent::highlightNode): Deleted.
(WebCore::FrameDOMAgent::highlightNodeList): Deleted.
(WebCore::FrameDOMAgent::hideHighlight): Deleted.
* Source/WebInspectorUI/UserInterface/Base/Main.js:
* Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype.highlightDOMNodeList):
(WI.DOMManager.prototype.highlightSelector):
(WI.DOMManager.prototype.cancelPendingHighlightHide):
(WI.DOMManager.prototype.hideDOMNodeHighlight):
(WI.DOMManager.prototype.highlightDOMNodeForTwoSeconds):
* Source/WebInspectorUI/UserInterface/Models/DOMNode.js:
(WI.DOMNode.prototype.highlight):
* Source/WebKit/WebProcess/Inspector/WebInspectorBackendClient.cpp:
Canonical link: https://commits.webkit.org/323008@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications