Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cd558dee60c1f73e2aebdd7d2b038fb697862e78
      
https://github.com/WebKit/WebKit/commit/cd558dee60c1f73e2aebdd7d2b038fb697862e78
  Author: Anuj Panta <[email protected]>
  Date:   2026-06-17 (Wed, 17 Jun 2026)

  Changed paths:
    A 
LayoutTests/http/tests/site-isolation/inspector/dom/undo-coordinator-frame-target-expected.txt
    A 
LayoutTests/http/tests/site-isolation/inspector/dom/undo-coordinator-frame-target.html
    M Source/WebInspectorUI/UserInterface/Base/Main.js
    A Source/WebInspectorUI/UserInterface/Controllers/DOMUndoCoordinator.js
    M Source/WebInspectorUI/UserInterface/Main.html
    M Source/WebInspectorUI/UserInterface/Models/CSSGrouping.js
    M Source/WebInspectorUI/UserInterface/Models/CSSStyleSheet.js
    M Source/WebInspectorUI/UserInterface/Models/DOMNode.js
    M Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js
    M Source/WebInspectorUI/UserInterface/Test.html
    M Source/WebInspectorUI/UserInterface/Test/Test.js
    M Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js

  Log Message:
  -----------
  Web Inspector: [SI] route Cmd+Z through the per-frame undo stack of the 
edited iframe
https://bugs.webkit.org/show_bug.cgi?id=315199
rdar://177529260

Reviewed by Qianlang Chen.

Add WI.DOMUndoCoordinator, a single-slot frontend coordinator that
remembers the most recently edited target. Every successful DOM edit
funnels through DOMNode._markUndoableState, which now records
node.owningTarget as the last-edit target via the coordinator. CSS edit
completions (CSSGrouping, CSSStyleSheet, DOMNodeStyles, and
SpreadsheetStyleProperty) route through the coordinator with the main
target, since FrameCSSAgent does not yet exist. WI.undo() and WI.redo()
dispatch through the coordinator, falling back to main when nothing has
been edited. A TargetRemoved listener clears the slot when a frame
target is torn down.

Follow up work will fix cross frame ordering ("edit A, edit B, undo twice").

Test: http/tests/site-isolation/inspector/dom/undo-coordinator-frame-target.html

* 
LayoutTests/http/tests/site-isolation/inspector/dom/undo-coordinator-frame-target-expected.txt:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/dom/undo-coordinator-frame-target.html:
 Added.
* Source/WebInspectorUI/UserInterface/Base/Main.js:
(WI.loaded):
* Source/WebInspectorUI/UserInterface/Controllers/DOMUndoCoordinator.js: Added.
(WI.DOMUndoCoordinator):
(WI.DOMUndoCoordinator.prototype.didEdit):
(WI.DOMUndoCoordinator.prototype.markUndoableState):
(WI.DOMUndoCoordinator.prototype.undo):
(WI.DOMUndoCoordinator.prototype.redo):
(WI.DOMUndoCoordinator.prototype._handleTargetRemoved):
* Source/WebInspectorUI/UserInterface/Main.html:
* Source/WebInspectorUI/UserInterface/Models/CSSGrouping.js:
(WI.CSSGrouping.prototype.async setText):
* Source/WebInspectorUI/UserInterface/Models/CSSStyleSheet.js:
(WI.CSSStyleSheet.prototype.handleCurrentRevisionContentChange.contentDidChange):
(WI.CSSStyleSheet.prototype.handleCurrentRevisionContentChange):
* Source/WebInspectorUI/UserInterface/Models/DOMNode.js:
(WI.DOMNode.prototype._markUndoableState):
* Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles.prototype.addRule.completed):
(WI.DOMNodeStyles.prototype.changeRuleSelector.ruleSelectorChanged):
(WI.DOMNodeStyles.prototype.changeRuleSelector):
* Source/WebInspectorUI/UserInterface/Test.html:
* Source/WebInspectorUI/UserInterface/Test/Test.js:
(WI.loaded):
* Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidBlur):

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



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

Reply via email to