haikuwebkit/LayoutTests/inspector/table
Devin Rousso 44a0c9a966 Web Inspector: REGRESSION (r238602): Elements: deleting the last child of a collapsed parent selects the parent's next sibling
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
2019-04-10 22:44:50 +00:00
..
resources
table-remove-rows-expected.txt Web Inspector: REGRESSION (r238602): Elements: deleting the last child of a collapsed parent selects the parent's next sibling 2019-04-10 22:44:50 +00:00
table-remove-rows.html Web Inspector: REGRESSION (r238602): Elements: deleting the last child of a collapsed parent selects the parent's next sibling 2019-04-10 22:44:50 +00:00
table-selection-expected.txt Web Inspector: SelectionController should not extend the selection when allowsMultipleSelection is false 2018-12-05 23:50:08 +00:00
table-selection.html Web Inspector: SelectionController should not extend the selection when allowsMultipleSelection is false 2018-12-05 23:50:08 +00:00