https://bugs.webkit.org/show_bug.cgi?id=192711
<rdar://problem/46738990>
Reviewed by Timothy Hatcher.
Original patch by Matt Baker <mattbaker@apple.com>.
Source/WebInspectorUI:
* UserInterface/Controllers/SelectionController.js:
(WI.SelectionController.prototype.removeSelectedItems):
When looking for a new item to select, start with the item preceding the
selection, instead of the item following the selection. This matches
pre-multiple selection behavior, as well as Mail and Xcode.
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.onexpand):
Drive-by fix: when a hidden node is selected, its selection area is drawn
with a height of 0px. Update the selection area once the hidden node's
parent is expanded. AFAIK, this has always been broken.
* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.ondelete):
After a delete the `SelectionController` may have chosen a child of a
collapsed parent as the new selected item. If the item isn't the closing tag (e.g. after
deleting the last child), reveal it.
(WI.DOMTreeOutline.prototype.selectionControllerPreviousSelectableItem):
* UserInterface/Views/TreeElement.js:
(WI.TreeElement.prototype.get previousSelectableSibling): Added.
(WI.TreeElement.prototype.get nextSelectableSibling): Added.
* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.selectionControllerPreviousSelectableItem):
(WI.TreeOutline.prototype.selectionControllerNextSelectableItem):
Set `skipUnrevealed` to false, so that children of collapsed parent nodes
are considered when looking for an item to selected after a delete. Hidden `TreeElement`s
are still ignored as they aren't `selectable`.
LayoutTests:
* inspector/table/table-remove-rows.html:
* inspector/table/table-remove-rows-expected.txt:
Canonical link: https://commits.webkit.org/211071@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244155 268f45cc-cd09-0410-ab3c-d52691b4dbfc