Web Inspector: Table selection becomes corrupted when deleting selected cookies
https://bugs.webkit.org/show_bug.cgi?id=192388
<rdar://problem/
46472364>
Reviewed by Devin Rousso.
Source/WebInspectorUI:
* UserInterface/Controllers/SelectionController.js:
(WI.SelectionController):
(WI.SelectionController.prototype.didRemoveItems):
(WI.SelectionController.prototype._updateSelectedItems):
(WI.SelectionController.prototype.didRemoveItem): Deleted.
Replace `didRemoveItem` with a method taking an IndexSet. Calling the
single-index version while iterating over multiple rows in ascending
order is unsafe, a detail best left to the SelectionController.
* UserInterface/Views/Table.js:
(WI.Table.prototype.removeRow):
(WI.Table.prototype._removeRows):
Notify SelectionController of removed rows.
* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.insertChild):
(WI.TreeOutline.prototype.removeChildAtIndex):
Remove the child from the element's `children` after calling `_forgetTreeElement`,
which needs to calculate the child's index to pass to the SelectionController.
(WI.TreeOutline.prototype.removeChildren):
Remove child items during iteration so that `children` doesn't contain
detached TreeElements while calling `_forgetTreeElement`.
(WI.TreeOutline.prototype._rememberTreeElement):
(WI.TreeOutline.prototype._forgetTreeElement):
LayoutTests:
* inspector/table/table-remove-rows-expected.txt:
* inspector/table/table-remove-rows.html:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239175
268f45cc-cd09-0410-ab3c-
d52691b4dbfc