Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: de24f73abd975bc8500b7efcba2290a244143c9e
https://github.com/WebKit/WebKit/commit/de24f73abd975bc8500b7efcba2290a244143c9e
Author: Anuj Panta <[email protected]>
Date: 2026-07-22 (Wed, 22 Jul 2026)
Changed paths:
A
LayoutTests/http/tests/site-isolation/inspector/dom/cross-frame-undo-coordinator-expected.txt
A
LayoutTests/http/tests/site-isolation/inspector/dom/cross-frame-undo-coordinator.html
M
LayoutTests/http/tests/site-isolation/inspector/dom/undo-coordinator-frame-target-expected.txt
M
LayoutTests/http/tests/site-isolation/inspector/dom/undo-coordinator-frame-target.html
M Source/WebInspectorUI/UserInterface/Controllers/DOMUndoCoordinator.js
Log Message:
-----------
Web Inspector: [SI] coordinate Cmd+Z across per-frame undo stacks
https://bugs.webkit.org/show_bug.cgi?id=315597
rdar://177978474
Reviewed by Qianlang Chen.
Replace WI.DOMUndoCoordinator's single _lastEditTarget slot with a pair
of LIFO target stacks that record one entry per edit, in order. Each
edit's target — the main page or a cross-origin iframe — is pushed when
didEdit is called. undo pops the top, dispatches to that target's
DOMAgent, and pushes to the redo stack on completion; redo is the
symmetric inverse. Empty-stack undo and redo fall back to the main
target as a no-op without pushing onto either stack. TargetRemoved
filters both stacks so a torn-down frame can't be popped later.
End-user effect: edit a node in a cross-origin iframe, edit a node on
the main page, press Cmd+Z — the main edit reverses; press Cmd+Z again,
the iframe edit reverses.
The existing single-target dispatch test is updated to await the now-
async undo/redo entry points.
Test: http/tests/site-isolation/inspector/dom/cross-frame-undo-coordinator.html
*
LayoutTests/http/tests/site-isolation/inspector/dom/cross-frame-undo-coordinator-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/dom/cross-frame-undo-coordinator.html:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/dom/undo-coordinator-frame-target-expected.txt:
*
LayoutTests/http/tests/site-isolation/inspector/dom/undo-coordinator-frame-target.html:
* Source/WebInspectorUI/UserInterface/Controllers/DOMUndoCoordinator.js:
(WI.DOMUndoCoordinator):
(WI.DOMUndoCoordinator.prototype.didEdit):
(WI.DOMUndoCoordinator.prototype.markUndoableState):
(WI.DOMUndoCoordinator.prototype.undo):
(WI.DOMUndoCoordinator.prototype.redo):
(WI.DOMUndoCoordinator.prototype._performOperationSoon):
(WI.DOMUndoCoordinator.prototype.async _undo):
(WI.DOMUndoCoordinator.prototype.async _redo):
(WI.DOMUndoCoordinator.prototype._handleTargetRemoved):
Canonical link: https://commits.webkit.org/317698@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications