haikuwebkit/LayoutTests/inspector/table/table-remove-rows-expected.txt

129 lines
2.9 KiB
Plaintext
Raw Permalink Normal View History

Web Inspector: Table should support deleting rows https://bugs.webkit.org/show_bug.cgi?id=189803 <rdar://problem/44655709> Reviewed by Devin Rousso. Source/WebInspectorUI: Add methods for removing rows from a Table without reloading the data source. This patch adds Table.prototype.removeRow for removing a single row, and Table.prototype.removeSelectedRows for removing the entire selection. The latter also attempts to select a new row, if possible, before removing the selection. * UserInterface/Base/IndexSet.js: (WI.IndexSet.prototype.copy): * UserInterface/Views/Table.js: (WI.Table): (WI.Table.prototype.get numberOfRows): Cache the number of rows in the table data source. Invalidate cached value whenever table data is reloaded. Removing rows immediately updates cached value, without incurring a potentially expensive reload. (WI.Table.prototype.reloadData): (WI.Table.prototype.selectRow): (WI.Table.prototype.deselectRow): (WI.Table.prototype.removeRow): (WI.Table.prototype.removeSelectedRows): Remove the selected rows and select a new row, if possible. (WI.Table.prototype._updateVisibleRows): (WI.Table.prototype._handleKeyDown): (WI.Table.prototype._deselectAllAndSelect): Drive-by fix: should work when `rowToSelect` isn't already selected. (WI.Table.prototype._removeRows): Remove rows and adjust the indexes of rows that are shifted up as a result of preceding rows being removed. LayoutTests: * inspector/table/resources/table-utilities.js: (TestPage.registerInitializer.InspectorTest.TableDelegate.prototype.tableDidRemoveRows): (TestPage.registerInitializer.createDataSource): (TestPage.registerInitializer.InspectorTest.createTable): (TestPage.registerInitializer.InspectorTest.createTableWithDelegate): (TestPage.registerInitializer): Update table test utilities to keep TableDataSource backing array in sync when rows are removed. Also allow the number of table rows to be specified when creating a table for testing. * inspector/table/table-remove-rows-expected.txt: Added. * inspector/table/table-remove-rows.html: Added. Add tests for new Table methods `removeRow(rowIndex)` and `removeSelectedRows()`. * inspector/unit-tests/index-set-expected.txt: * inspector/unit-tests/index-set.html: Add tests for new IndexSet method `copy()`. Canonical link: https://commits.webkit.org/205823@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-27 23:30:03 +00:00
Tests that rows can be removed from Table, and that the selection is updated when removing selected rows.
An asterix (*) indicates a selected row; a hyphen (-) indicates a removed row.
== Running test suite: Table.RemoveRows
-- Running test case: Table.RemoveRow.NoneSelected
Given a Table with selected rows [], remove row 0.
PASS: Should remove row 0.
-- Running test case: Table.RemoveRow.Selected
Given a Table with selected rows [0], remove row 0.
Selection changed to [] before removing row 0.
PASS: Should remove row 0.
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: Canonical link: https://commits.webkit.org/207249@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-13 20:46:59 +00:00
-- Running test case: Table.RemoveRow.PrecedingSelected
Given a Table with selected rows [1,3], remove row 0.
PASS: Should remove row 0.
PASS: Selected row indexes should be adjusted.
Web Inspector: Table should support deleting rows https://bugs.webkit.org/show_bug.cgi?id=189803 <rdar://problem/44655709> Reviewed by Devin Rousso. Source/WebInspectorUI: Add methods for removing rows from a Table without reloading the data source. This patch adds Table.prototype.removeRow for removing a single row, and Table.prototype.removeSelectedRows for removing the entire selection. The latter also attempts to select a new row, if possible, before removing the selection. * UserInterface/Base/IndexSet.js: (WI.IndexSet.prototype.copy): * UserInterface/Views/Table.js: (WI.Table): (WI.Table.prototype.get numberOfRows): Cache the number of rows in the table data source. Invalidate cached value whenever table data is reloaded. Removing rows immediately updates cached value, without incurring a potentially expensive reload. (WI.Table.prototype.reloadData): (WI.Table.prototype.selectRow): (WI.Table.prototype.deselectRow): (WI.Table.prototype.removeRow): (WI.Table.prototype.removeSelectedRows): Remove the selected rows and select a new row, if possible. (WI.Table.prototype._updateVisibleRows): (WI.Table.prototype._handleKeyDown): (WI.Table.prototype._deselectAllAndSelect): Drive-by fix: should work when `rowToSelect` isn't already selected. (WI.Table.prototype._removeRows): Remove rows and adjust the indexes of rows that are shifted up as a result of preceding rows being removed. LayoutTests: * inspector/table/resources/table-utilities.js: (TestPage.registerInitializer.InspectorTest.TableDelegate.prototype.tableDidRemoveRows): (TestPage.registerInitializer.createDataSource): (TestPage.registerInitializer.InspectorTest.createTable): (TestPage.registerInitializer.InspectorTest.createTableWithDelegate): (TestPage.registerInitializer): Update table test utilities to keep TableDataSource backing array in sync when rows are removed. Also allow the number of table rows to be specified when creating a table for testing. * inspector/table/table-remove-rows-expected.txt: Added. * inspector/table/table-remove-rows.html: Added. Add tests for new Table methods `removeRow(rowIndex)` and `removeSelectedRows()`. * inspector/unit-tests/index-set-expected.txt: * inspector/unit-tests/index-set.html: Add tests for new IndexSet method `copy()`. Canonical link: https://commits.webkit.org/205823@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-27 23:30:03 +00:00
-- Running test case: Table.RemoveSelectedRows.Single.SelectFollowing
Given a Table with selected rows [0]:
* Row 0
Row 1
Row 2
Row 3
Selection changed before removing rows:
- Row 0
* Row 1
Row 2
Row 3
PASS: Should remove rows [0].
-- Running test case: Table.RemoveSelectedRows.Single.SelectPreceding
Given a Table with selected rows [3]:
Row 0
Row 1
Row 2
* Row 3
Selection changed before removing rows:
Row 0
Row 1
* Row 2
- Row 3
PASS: Should remove rows [3].
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
-- Running test case: Table.RemoveSelectedRows.Single.SelectPrecedingOverFollowing
Given a Table with selected rows [2]:
Row 0
Web Inspector: Table should support deleting rows https://bugs.webkit.org/show_bug.cgi?id=189803 <rdar://problem/44655709> Reviewed by Devin Rousso. Source/WebInspectorUI: Add methods for removing rows from a Table without reloading the data source. This patch adds Table.prototype.removeRow for removing a single row, and Table.prototype.removeSelectedRows for removing the entire selection. The latter also attempts to select a new row, if possible, before removing the selection. * UserInterface/Base/IndexSet.js: (WI.IndexSet.prototype.copy): * UserInterface/Views/Table.js: (WI.Table): (WI.Table.prototype.get numberOfRows): Cache the number of rows in the table data source. Invalidate cached value whenever table data is reloaded. Removing rows immediately updates cached value, without incurring a potentially expensive reload. (WI.Table.prototype.reloadData): (WI.Table.prototype.selectRow): (WI.Table.prototype.deselectRow): (WI.Table.prototype.removeRow): (WI.Table.prototype.removeSelectedRows): Remove the selected rows and select a new row, if possible. (WI.Table.prototype._updateVisibleRows): (WI.Table.prototype._handleKeyDown): (WI.Table.prototype._deselectAllAndSelect): Drive-by fix: should work when `rowToSelect` isn't already selected. (WI.Table.prototype._removeRows): Remove rows and adjust the indexes of rows that are shifted up as a result of preceding rows being removed. LayoutTests: * inspector/table/resources/table-utilities.js: (TestPage.registerInitializer.InspectorTest.TableDelegate.prototype.tableDidRemoveRows): (TestPage.registerInitializer.createDataSource): (TestPage.registerInitializer.InspectorTest.createTable): (TestPage.registerInitializer.InspectorTest.createTableWithDelegate): (TestPage.registerInitializer): Update table test utilities to keep TableDataSource backing array in sync when rows are removed. Also allow the number of table rows to be specified when creating a table for testing. * inspector/table/table-remove-rows-expected.txt: Added. * inspector/table/table-remove-rows.html: Added. Add tests for new Table methods `removeRow(rowIndex)` and `removeSelectedRows()`. * inspector/unit-tests/index-set-expected.txt: * inspector/unit-tests/index-set.html: Add tests for new IndexSet method `copy()`. Canonical link: https://commits.webkit.org/205823@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-27 23:30:03 +00:00
Row 1
* Row 2
Row 3
Selection changed before removing rows:
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
Row 0
* Row 1
Web Inspector: Table should support deleting rows https://bugs.webkit.org/show_bug.cgi?id=189803 <rdar://problem/44655709> Reviewed by Devin Rousso. Source/WebInspectorUI: Add methods for removing rows from a Table without reloading the data source. This patch adds Table.prototype.removeRow for removing a single row, and Table.prototype.removeSelectedRows for removing the entire selection. The latter also attempts to select a new row, if possible, before removing the selection. * UserInterface/Base/IndexSet.js: (WI.IndexSet.prototype.copy): * UserInterface/Views/Table.js: (WI.Table): (WI.Table.prototype.get numberOfRows): Cache the number of rows in the table data source. Invalidate cached value whenever table data is reloaded. Removing rows immediately updates cached value, without incurring a potentially expensive reload. (WI.Table.prototype.reloadData): (WI.Table.prototype.selectRow): (WI.Table.prototype.deselectRow): (WI.Table.prototype.removeRow): (WI.Table.prototype.removeSelectedRows): Remove the selected rows and select a new row, if possible. (WI.Table.prototype._updateVisibleRows): (WI.Table.prototype._handleKeyDown): (WI.Table.prototype._deselectAllAndSelect): Drive-by fix: should work when `rowToSelect` isn't already selected. (WI.Table.prototype._removeRows): Remove rows and adjust the indexes of rows that are shifted up as a result of preceding rows being removed. LayoutTests: * inspector/table/resources/table-utilities.js: (TestPage.registerInitializer.InspectorTest.TableDelegate.prototype.tableDidRemoveRows): (TestPage.registerInitializer.createDataSource): (TestPage.registerInitializer.InspectorTest.createTable): (TestPage.registerInitializer.InspectorTest.createTableWithDelegate): (TestPage.registerInitializer): Update table test utilities to keep TableDataSource backing array in sync when rows are removed. Also allow the number of table rows to be specified when creating a table for testing. * inspector/table/table-remove-rows-expected.txt: Added. * inspector/table/table-remove-rows.html: Added. Add tests for new Table methods `removeRow(rowIndex)` and `removeSelectedRows()`. * inspector/unit-tests/index-set-expected.txt: * inspector/unit-tests/index-set.html: Add tests for new IndexSet method `copy()`. Canonical link: https://commits.webkit.org/205823@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-27 23:30:03 +00:00
- Row 2
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
Row 3
PASS: Should remove rows [2].
Web Inspector: Table should support deleting rows https://bugs.webkit.org/show_bug.cgi?id=189803 <rdar://problem/44655709> Reviewed by Devin Rousso. Source/WebInspectorUI: Add methods for removing rows from a Table without reloading the data source. This patch adds Table.prototype.removeRow for removing a single row, and Table.prototype.removeSelectedRows for removing the entire selection. The latter also attempts to select a new row, if possible, before removing the selection. * UserInterface/Base/IndexSet.js: (WI.IndexSet.prototype.copy): * UserInterface/Views/Table.js: (WI.Table): (WI.Table.prototype.get numberOfRows): Cache the number of rows in the table data source. Invalidate cached value whenever table data is reloaded. Removing rows immediately updates cached value, without incurring a potentially expensive reload. (WI.Table.prototype.reloadData): (WI.Table.prototype.selectRow): (WI.Table.prototype.deselectRow): (WI.Table.prototype.removeRow): (WI.Table.prototype.removeSelectedRows): Remove the selected rows and select a new row, if possible. (WI.Table.prototype._updateVisibleRows): (WI.Table.prototype._handleKeyDown): (WI.Table.prototype._deselectAllAndSelect): Drive-by fix: should work when `rowToSelect` isn't already selected. (WI.Table.prototype._removeRows): Remove rows and adjust the indexes of rows that are shifted up as a result of preceding rows being removed. LayoutTests: * inspector/table/resources/table-utilities.js: (TestPage.registerInitializer.InspectorTest.TableDelegate.prototype.tableDidRemoveRows): (TestPage.registerInitializer.createDataSource): (TestPage.registerInitializer.InspectorTest.createTable): (TestPage.registerInitializer.InspectorTest.createTableWithDelegate): (TestPage.registerInitializer): Update table test utilities to keep TableDataSource backing array in sync when rows are removed. Also allow the number of table rows to be specified when creating a table for testing. * inspector/table/table-remove-rows-expected.txt: Added. * inspector/table/table-remove-rows.html: Added. Add tests for new Table methods `removeRow(rowIndex)` and `removeSelectedRows()`. * inspector/unit-tests/index-set-expected.txt: * inspector/unit-tests/index-set.html: Add tests for new IndexSet method `copy()`. Canonical link: https://commits.webkit.org/205823@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-27 23:30:03 +00:00
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
-- Running test case: Table.RemoveSelectedRows.Multiple.SelectFollowing
Given a Table with selected rows [0,1]:
Web Inspector: Table should support deleting rows https://bugs.webkit.org/show_bug.cgi?id=189803 <rdar://problem/44655709> Reviewed by Devin Rousso. Source/WebInspectorUI: Add methods for removing rows from a Table without reloading the data source. This patch adds Table.prototype.removeRow for removing a single row, and Table.prototype.removeSelectedRows for removing the entire selection. The latter also attempts to select a new row, if possible, before removing the selection. * UserInterface/Base/IndexSet.js: (WI.IndexSet.prototype.copy): * UserInterface/Views/Table.js: (WI.Table): (WI.Table.prototype.get numberOfRows): Cache the number of rows in the table data source. Invalidate cached value whenever table data is reloaded. Removing rows immediately updates cached value, without incurring a potentially expensive reload. (WI.Table.prototype.reloadData): (WI.Table.prototype.selectRow): (WI.Table.prototype.deselectRow): (WI.Table.prototype.removeRow): (WI.Table.prototype.removeSelectedRows): Remove the selected rows and select a new row, if possible. (WI.Table.prototype._updateVisibleRows): (WI.Table.prototype._handleKeyDown): (WI.Table.prototype._deselectAllAndSelect): Drive-by fix: should work when `rowToSelect` isn't already selected. (WI.Table.prototype._removeRows): Remove rows and adjust the indexes of rows that are shifted up as a result of preceding rows being removed. LayoutTests: * inspector/table/resources/table-utilities.js: (TestPage.registerInitializer.InspectorTest.TableDelegate.prototype.tableDidRemoveRows): (TestPage.registerInitializer.createDataSource): (TestPage.registerInitializer.InspectorTest.createTable): (TestPage.registerInitializer.InspectorTest.createTableWithDelegate): (TestPage.registerInitializer): Update table test utilities to keep TableDataSource backing array in sync when rows are removed. Also allow the number of table rows to be specified when creating a table for testing. * inspector/table/table-remove-rows-expected.txt: Added. * inspector/table/table-remove-rows.html: Added. Add tests for new Table methods `removeRow(rowIndex)` and `removeSelectedRows()`. * inspector/unit-tests/index-set-expected.txt: * inspector/unit-tests/index-set.html: Add tests for new IndexSet method `copy()`. Canonical link: https://commits.webkit.org/205823@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-27 23:30:03 +00:00
* Row 0
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
* Row 1
Web Inspector: Table should support deleting rows https://bugs.webkit.org/show_bug.cgi?id=189803 <rdar://problem/44655709> Reviewed by Devin Rousso. Source/WebInspectorUI: Add methods for removing rows from a Table without reloading the data source. This patch adds Table.prototype.removeRow for removing a single row, and Table.prototype.removeSelectedRows for removing the entire selection. The latter also attempts to select a new row, if possible, before removing the selection. * UserInterface/Base/IndexSet.js: (WI.IndexSet.prototype.copy): * UserInterface/Views/Table.js: (WI.Table): (WI.Table.prototype.get numberOfRows): Cache the number of rows in the table data source. Invalidate cached value whenever table data is reloaded. Removing rows immediately updates cached value, without incurring a potentially expensive reload. (WI.Table.prototype.reloadData): (WI.Table.prototype.selectRow): (WI.Table.prototype.deselectRow): (WI.Table.prototype.removeRow): (WI.Table.prototype.removeSelectedRows): Remove the selected rows and select a new row, if possible. (WI.Table.prototype._updateVisibleRows): (WI.Table.prototype._handleKeyDown): (WI.Table.prototype._deselectAllAndSelect): Drive-by fix: should work when `rowToSelect` isn't already selected. (WI.Table.prototype._removeRows): Remove rows and adjust the indexes of rows that are shifted up as a result of preceding rows being removed. LayoutTests: * inspector/table/resources/table-utilities.js: (TestPage.registerInitializer.InspectorTest.TableDelegate.prototype.tableDidRemoveRows): (TestPage.registerInitializer.createDataSource): (TestPage.registerInitializer.InspectorTest.createTable): (TestPage.registerInitializer.InspectorTest.createTableWithDelegate): (TestPage.registerInitializer): Update table test utilities to keep TableDataSource backing array in sync when rows are removed. Also allow the number of table rows to be specified when creating a table for testing. * inspector/table/table-remove-rows-expected.txt: Added. * inspector/table/table-remove-rows.html: Added. Add tests for new Table methods `removeRow(rowIndex)` and `removeSelectedRows()`. * inspector/unit-tests/index-set-expected.txt: * inspector/unit-tests/index-set.html: Add tests for new IndexSet method `copy()`. Canonical link: https://commits.webkit.org/205823@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-27 23:30:03 +00:00
Row 2
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
Row 3
Web Inspector: Table should support deleting rows https://bugs.webkit.org/show_bug.cgi?id=189803 <rdar://problem/44655709> Reviewed by Devin Rousso. Source/WebInspectorUI: Add methods for removing rows from a Table without reloading the data source. This patch adds Table.prototype.removeRow for removing a single row, and Table.prototype.removeSelectedRows for removing the entire selection. The latter also attempts to select a new row, if possible, before removing the selection. * UserInterface/Base/IndexSet.js: (WI.IndexSet.prototype.copy): * UserInterface/Views/Table.js: (WI.Table): (WI.Table.prototype.get numberOfRows): Cache the number of rows in the table data source. Invalidate cached value whenever table data is reloaded. Removing rows immediately updates cached value, without incurring a potentially expensive reload. (WI.Table.prototype.reloadData): (WI.Table.prototype.selectRow): (WI.Table.prototype.deselectRow): (WI.Table.prototype.removeRow): (WI.Table.prototype.removeSelectedRows): Remove the selected rows and select a new row, if possible. (WI.Table.prototype._updateVisibleRows): (WI.Table.prototype._handleKeyDown): (WI.Table.prototype._deselectAllAndSelect): Drive-by fix: should work when `rowToSelect` isn't already selected. (WI.Table.prototype._removeRows): Remove rows and adjust the indexes of rows that are shifted up as a result of preceding rows being removed. LayoutTests: * inspector/table/resources/table-utilities.js: (TestPage.registerInitializer.InspectorTest.TableDelegate.prototype.tableDidRemoveRows): (TestPage.registerInitializer.createDataSource): (TestPage.registerInitializer.InspectorTest.createTable): (TestPage.registerInitializer.InspectorTest.createTableWithDelegate): (TestPage.registerInitializer): Update table test utilities to keep TableDataSource backing array in sync when rows are removed. Also allow the number of table rows to be specified when creating a table for testing. * inspector/table/table-remove-rows-expected.txt: Added. * inspector/table/table-remove-rows.html: Added. Add tests for new Table methods `removeRow(rowIndex)` and `removeSelectedRows()`. * inspector/unit-tests/index-set-expected.txt: * inspector/unit-tests/index-set.html: Add tests for new IndexSet method `copy()`. Canonical link: https://commits.webkit.org/205823@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-27 23:30:03 +00:00
Selection changed before removing rows:
- Row 0
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
- Row 1
* Row 2
Row 3
PASS: Should remove rows [0,1].
Web Inspector: Table should support deleting rows https://bugs.webkit.org/show_bug.cgi?id=189803 <rdar://problem/44655709> Reviewed by Devin Rousso. Source/WebInspectorUI: Add methods for removing rows from a Table without reloading the data source. This patch adds Table.prototype.removeRow for removing a single row, and Table.prototype.removeSelectedRows for removing the entire selection. The latter also attempts to select a new row, if possible, before removing the selection. * UserInterface/Base/IndexSet.js: (WI.IndexSet.prototype.copy): * UserInterface/Views/Table.js: (WI.Table): (WI.Table.prototype.get numberOfRows): Cache the number of rows in the table data source. Invalidate cached value whenever table data is reloaded. Removing rows immediately updates cached value, without incurring a potentially expensive reload. (WI.Table.prototype.reloadData): (WI.Table.prototype.selectRow): (WI.Table.prototype.deselectRow): (WI.Table.prototype.removeRow): (WI.Table.prototype.removeSelectedRows): Remove the selected rows and select a new row, if possible. (WI.Table.prototype._updateVisibleRows): (WI.Table.prototype._handleKeyDown): (WI.Table.prototype._deselectAllAndSelect): Drive-by fix: should work when `rowToSelect` isn't already selected. (WI.Table.prototype._removeRows): Remove rows and adjust the indexes of rows that are shifted up as a result of preceding rows being removed. LayoutTests: * inspector/table/resources/table-utilities.js: (TestPage.registerInitializer.InspectorTest.TableDelegate.prototype.tableDidRemoveRows): (TestPage.registerInitializer.createDataSource): (TestPage.registerInitializer.InspectorTest.createTable): (TestPage.registerInitializer.InspectorTest.createTableWithDelegate): (TestPage.registerInitializer): Update table test utilities to keep TableDataSource backing array in sync when rows are removed. Also allow the number of table rows to be specified when creating a table for testing. * inspector/table/table-remove-rows-expected.txt: Added. * inspector/table/table-remove-rows.html: Added. Add tests for new Table methods `removeRow(rowIndex)` and `removeSelectedRows()`. * inspector/unit-tests/index-set-expected.txt: * inspector/unit-tests/index-set.html: Add tests for new IndexSet method `copy()`. Canonical link: https://commits.webkit.org/205823@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-27 23:30:03 +00:00
-- Running test case: Table.RemoveSelectedRows.Multiple.SelectPreceding
Given a Table with selected rows [2,3]:
Row 0
Row 1
* Row 2
* Row 3
Selection changed before removing rows:
Row 0
* Row 1
- Row 2
- Row 3
PASS: Should remove rows [2,3].
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
-- Running test case: Table.RemoveSelectedRows.Multiple.SelectPrecedingOverFollowing
Given a Table with selected rows [1,2]:
Row 0
* Row 1
* Row 2
Row 3
Selection changed before removing rows:
* Row 0
- Row 1
- Row 2
Row 3
PASS: Should remove rows [1,2].
-- Running test case: Table.RemoveSelectedRows.Multiple.SelectPrecedingOverGap
Given a Table with selected rows [1,3]:
Row 0
* Row 1
Row 2
* Row 3
Selection changed before removing rows:
* Row 0
- Row 1
Row 2
- Row 3
PASS: Should remove rows [1,3].
-- Running test case: Table.RemoveSelectedRows.Multiple.SelectGapOverFollowing
Given a Table with selected rows [0,2]:
* Row 0
Row 1
* Row 2
Row 3
Selection changed before removing rows:
- Row 0
* Row 1
- Row 2
Row 3
PASS: Should remove rows [0,2].
Web Inspector: Table should support deleting rows https://bugs.webkit.org/show_bug.cgi?id=189803 <rdar://problem/44655709> Reviewed by Devin Rousso. Source/WebInspectorUI: Add methods for removing rows from a Table without reloading the data source. This patch adds Table.prototype.removeRow for removing a single row, and Table.prototype.removeSelectedRows for removing the entire selection. The latter also attempts to select a new row, if possible, before removing the selection. * UserInterface/Base/IndexSet.js: (WI.IndexSet.prototype.copy): * UserInterface/Views/Table.js: (WI.Table): (WI.Table.prototype.get numberOfRows): Cache the number of rows in the table data source. Invalidate cached value whenever table data is reloaded. Removing rows immediately updates cached value, without incurring a potentially expensive reload. (WI.Table.prototype.reloadData): (WI.Table.prototype.selectRow): (WI.Table.prototype.deselectRow): (WI.Table.prototype.removeRow): (WI.Table.prototype.removeSelectedRows): Remove the selected rows and select a new row, if possible. (WI.Table.prototype._updateVisibleRows): (WI.Table.prototype._handleKeyDown): (WI.Table.prototype._deselectAllAndSelect): Drive-by fix: should work when `rowToSelect` isn't already selected. (WI.Table.prototype._removeRows): Remove rows and adjust the indexes of rows that are shifted up as a result of preceding rows being removed. LayoutTests: * inspector/table/resources/table-utilities.js: (TestPage.registerInitializer.InspectorTest.TableDelegate.prototype.tableDidRemoveRows): (TestPage.registerInitializer.createDataSource): (TestPage.registerInitializer.InspectorTest.createTable): (TestPage.registerInitializer.InspectorTest.createTableWithDelegate): (TestPage.registerInitializer): Update table test utilities to keep TableDataSource backing array in sync when rows are removed. Also allow the number of table rows to be specified when creating a table for testing. * inspector/table/table-remove-rows-expected.txt: Added. * inspector/table/table-remove-rows.html: Added. Add tests for new Table methods `removeRow(rowIndex)` and `removeSelectedRows()`. * inspector/unit-tests/index-set-expected.txt: * inspector/unit-tests/index-set.html: Add tests for new IndexSet method `copy()`. Canonical link: https://commits.webkit.org/205823@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-27 23:30:03 +00:00
-- Running test case: Table.RemoveRow.NotCached
Given a Table with selected rows [], remove row 999.
PASS: Should remove row 999.