Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 36c8ec5fdabfade0a60bd8adb3623ee023ae5eff
      
https://github.com/WebKit/WebKit/commit/36c8ec5fdabfade0a60bd8adb3623ee023ae5eff
  Author: Anuj Panta <[email protected]>
  Date:   2026-10-06 (Tue, 06 Oct 2026)

  Changed paths:
    M Source/WebCore/inspector/FrameInspectorController.cpp
    M Source/WebCore/inspector/FrameInspectorController.h
    M Source/WebCore/inspector/InspectorBackendClient.h
    M Source/WebCore/inspector/InspectorOverlay.cpp
    M Source/WebCore/inspector/InspectorOverlay.h
    M Source/WebCore/inspector/PageInspectorController.cpp
    M Source/WebCore/inspector/PageInspectorController.h
    M Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
    M Source/WebCore/inspector/agents/InspectorDOMAgent.h
    M Source/WebKit/WebProcess/Inspector/WebInspectorBackendClient.cpp
    M Source/WebKit/WebProcess/Inspector/WebInspectorBackendClient.h

  Log Message:
  -----------
  Make InspectorOverlay frame-relative so it can draw in a subframe process
https://bugs.webkit.org/show_bug.cgi?id=322726
rdar://185999163

Reviewed by BJ Burg.

InspectorOverlay resolved every geometry calculation through the page's main
frame. In a subframe process that frame is remote and has no view, so the
overlay bailed and drew nothing.

An InspectorOverlayOwner interface replaces the overlay's direct dependency on
PageInspectorController, so a LocalFrame's FrameInspectorController can own one
too, and frameForGeometry() replaces every main-frame lookup: a frame overlay
uses its own frame, the page overlay falls back to localMainFrame() as before.
WebInspectorBackendClient gains a per-frame highlight surface keyed by local
root, the same shape the paint-rect overlays already use.

The FrameView dereferences along those paths are now null-checked; two were
reachable on the page path already. Rulers stay page-wide, and one
shouldDrawRulers() now decides that, so the ruler lines, bounds guides, and the
tooltip insets reserving space for them can't disagree.

Two pre-existing bugs surface once a process holds more than one overlay:
willMoveToPage() nulled the shared page-highlight pointer regardless of which
overlay was moving, so any per-frame paint-rect teardown destroyed it, and
drawRect() ignored the PageOverlay& it was handed and always painted the page
overlay. Both fixed here.

Nothing drives a frame overlay yet since FrameDOMAgent's highlight commands are
still stubs, so these paths are plumbing for the highlighting work that follows
and aren't layout-testable in this state; the existing inspector/dom overlay
tests cover the page path against regression. The frame surface is also still
OverlayType::Document while the overlay draws in root-view coordinates; see the
FIXME.

* Source/WebCore/inspector/FrameInspectorController.cpp:
(WebCore::FrameInspectorController::FrameInspectorController):
(WebCore::FrameInspectorController::overlayOwnerPage const):
(WebCore::FrameInspectorController::overlayOwnerFrame const):
(WebCore::FrameInspectorController::overlayOwnerBackendClient const):
(WebCore::FrameInspectorController::drawHighlight const):
(WebCore::FrameInspectorController::hasOverlayContentToDraw const):
* Source/WebCore/inspector/FrameInspectorController.h:
* Source/WebCore/inspector/InspectorBackendClient.h:
(WebCore::InspectorBackendClient::highlightFrame):
(WebCore::InspectorBackendClient::hideHighlightForFrame):
* Source/WebCore/inspector/InspectorOverlay.cpp:
(WebCore::contentsQuadToCoordinateSystem):
(WebCore::buildRendererHighlight):
(WebCore::drawShapeHighlight):
(WebCore::InspectorOverlay::InspectorOverlay):
(WebCore::InspectorOverlay::ref const):
(WebCore::InspectorOverlay::deref const):
(WebCore::InspectorOverlay::page const):
(WebCore::InspectorOverlay::frameForGeometry const):
(WebCore::InspectorOverlay::paint):
(WebCore::InspectorOverlay::highlightQuad):
(WebCore::InspectorOverlay::didSetSearchingForNode):
(WebCore::InspectorOverlay::shouldDrawRulers const):
(WebCore::InspectorOverlay::shouldShowOverlay const):
(WebCore::InspectorOverlay::update):
(WebCore::InspectorOverlay::showPaintRect):
(WebCore::InspectorOverlay::drawNodeHighlight):
(WebCore::InspectorOverlay::drawQuadHighlight):
(WebCore::InspectorOverlay::drawBounds):
(WebCore::InspectorOverlay::drawRulers):
(WebCore::InspectorOverlay::drawElementTitle):
(WebCore::InspectorOverlay::buildGridOverlay):
(WebCore::InspectorOverlay::buildFlexOverlay):
(WebCore::localPointToRootPoint): Deleted.
* Source/WebCore/inspector/InspectorOverlay.h:
(WebCore::InspectorOverlayOwner::overlayOwnerFrame const):
(WebCore::InspectorOverlayOwner::overlayOwnerFlexLineStarts const):
(WebCore::InspectorOverlay::isFrameScoped const):
* Source/WebCore/inspector/PageInspectorController.cpp:
(WebCore::PageInspectorController::PageInspectorController):
(WebCore::PageInspectorController::overlayOwnerPage const):
(WebCore::PageInspectorController::overlayOwnerFlexLineStarts const):
* Source/WebCore/inspector/PageInspectorController.h:
* Source/WebCore/inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::flexibleBoxRendererCachedItemsAtStartOfLine const):
(WebCore::InspectorDOMAgent::flexibleBoxRendererCachedItemsAtStartOfLine): 
Deleted.
* Source/WebCore/inspector/agents/InspectorDOMAgent.h:
* Source/WebKit/WebProcess/Inspector/WebInspectorBackendClient.cpp:
(WebKit::WebInspectorBackendClient::~WebInspectorBackendClient):
(WebKit::WebInspectorBackendClient::ensureHighlightOverlayForFrame):
(WebKit::WebInspectorBackendClient::highlightFrame):
(WebKit::WebInspectorBackendClient::hideHighlightForFrame):
(WebKit::WebInspectorBackendClient::willDestroyFrameOverlays):
(WebKit::WebInspectorBackendClient::willMoveToPage):
(WebKit::WebInspectorBackendClient::drawRect):
* Source/WebKit/WebProcess/Inspector/WebInspectorBackendClient.h:

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



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

Reply via email to