Web Inspector: REGRESSION(r238602): Elements: deleting multiple DOM nodes doesn't...
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Dec 2018 22:29:07 +0000 (22:29 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Dec 2018 22:29:07 +0000 (22:29 +0000)
commitcb0fe616e17c33213965480531f5fb8a6915ed24
tree2f548b75284109047751ffc05a7149e3d60462c7
parent147f924c5c390fb70e6d1b3fdf4d2ea498253342
Web Inspector: REGRESSION(r238602): Elements: deleting multiple DOM nodes doesn't select the nearest node after deletion
https://bugs.webkit.org/show_bug.cgi?id=192116
<rdar://problem/46344339>

Reviewed by Devin Rousso.

* UserInterface/Controllers/SelectionController.js:
(WI.SelectionController.prototype.removeSelectedItems):
Finding a new index to select should go through the delegate instead of
naively advancing the index.

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype._populateNodeContextMenu):
(WI.DOMTreeElement.prototype.ondelete): Deleted.
The menu item for removing the DOM node is now managed by the parent
DOMTreeOutline, since its UI and behavior now depend on whether there
are multiple elements selected.

* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.populateContextMenu):
(WI.DOMTreeOutline.prototype.ondelete.level):
(WI.DOMTreeOutline.prototype.ondelete):
Implement `ondelete` to remove selected DOM nodes using the delete and
backspace keys. Also used by the DOMTreeOutline's context menu handler.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239178 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/SelectionController.js
Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js
Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js