Changeset 244155 in webkit
- Timestamp:
- Apr 10, 2019 3:44:50 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r244154 r244155 1 2019-04-10 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: REGRESSION (r238602): Elements: deleting the last child of a collapsed parent selects the parent's next sibling 4 https://bugs.webkit.org/show_bug.cgi?id=192711 5 <rdar://problem/46738990> 6 7 Reviewed by Timothy Hatcher. 8 9 Original patch by Matt Baker <mattbaker@apple.com>. 10 11 * inspector/table/table-remove-rows.html: 12 * inspector/table/table-remove-rows-expected.txt: 13 1 14 2019-04-10 Devin Rousso <drousso@apple.com> 2 15 -
trunk/LayoutTests/inspector/table/table-remove-rows-expected.txt
r239175 r244155 45 45 PASS: Should remove rows [3]. 46 46 47 -- Running test case: Table.RemoveSelectedRows. Multiple.SelectFollowing48 Given a Table with selected rows [ 0,2]:49 *Row 047 -- Running test case: Table.RemoveSelectedRows.Single.SelectPrecedingOverFollowing 48 Given a Table with selected rows [2]: 49 Row 0 50 50 Row 1 51 51 * Row 2 52 52 Row 3 53 53 Selection changed before removing rows: 54 -Row 055 54 Row 0 55 * Row 1 56 56 - Row 2 57 *Row 358 PASS: Should remove rows [ 0,2].57 Row 3 58 PASS: Should remove rows [2]. 59 59 60 -- Running test case: Table.RemoveSelectedRows.Multiple.Select Hole61 Given a Table with selected rows [0, 3]:60 -- Running test case: Table.RemoveSelectedRows.Multiple.SelectFollowing 61 Given a Table with selected rows [0,1]: 62 62 * Row 0 63 63 * Row 1 64 64 Row 2 65 *Row 365 Row 3 66 66 Selection changed before removing rows: 67 67 - Row 0 68 *Row 169 70 -Row 371 PASS: Should remove rows [0, 3].68 - Row 1 69 * Row 2 70 Row 3 71 PASS: Should remove rows [0,1]. 72 72 73 73 -- Running test case: Table.RemoveSelectedRows.Multiple.SelectPreceding … … 84 84 PASS: Should remove rows [2,3]. 85 85 86 -- Running test case: Table.RemoveSelectedRows.Multiple.SelectPrecedingOverFollowing 87 Given a Table with selected rows [1,2]: 88 Row 0 89 * Row 1 90 * Row 2 91 Row 3 92 Selection changed before removing rows: 93 * Row 0 94 - Row 1 95 - Row 2 96 Row 3 97 PASS: Should remove rows [1,2]. 98 99 -- Running test case: Table.RemoveSelectedRows.Multiple.SelectPrecedingOverGap 100 Given a Table with selected rows [1,3]: 101 Row 0 102 * Row 1 103 Row 2 104 * Row 3 105 Selection changed before removing rows: 106 * Row 0 107 - Row 1 108 Row 2 109 - Row 3 110 PASS: Should remove rows [1,3]. 111 112 -- Running test case: Table.RemoveSelectedRows.Multiple.SelectGapOverFollowing 113 Given a Table with selected rows [0,2]: 114 * Row 0 115 Row 1 116 * Row 2 117 Row 3 118 Selection changed before removing rows: 119 - Row 0 120 * Row 1 121 - Row 2 122 Row 3 123 PASS: Should remove rows [0,2]. 124 86 125 -- Running test case: Table.RemoveRow.NotCached 87 126 Given a Table with selected rows [], remove row 999. -
trunk/LayoutTests/inspector/table/table-remove-rows.html
r239175 r244155 173 173 addTestCase({ 174 174 name: "Table.RemoveSelectedRows.Single.SelectFollowing", 175 description: "Remove the selected row, causing the following row to be selected.",175 description: "Remove a selected row not preceded by a selectable row.", 176 176 rowIndexes: [0], 177 177 }); … … 179 179 addTestCase({ 180 180 name: "Table.RemoveSelectedRows.Single.SelectPreceding", 181 description: "Remove the selected row, causing the preceding row to be selected.",181 description: "Remove a selected row not followed by a selectable row.", 182 182 rowIndexes: [lastRowIndex], 183 183 }); 184 184 185 185 addTestCase({ 186 name: "Table.RemoveSelectedRows.Single.SelectPrecedingOverFollowing", 187 description: "Remove a selected row between two selectable rows.", 188 rowIndexes: [lastRowIndex - 1], 189 }); 190 191 addTestCase({ 186 192 name: "Table.RemoveSelectedRows.Multiple.SelectFollowing", 187 description: "Remove selected rows, causing the row following the selection to be selected.", 188 rowIndexes: [0, lastRowIndex - 1], 189 }); 190 191 addTestCase({ 192 name: "Table.RemoveSelectedRows.Multiple.SelectHole", 193 description: "Remove selected rows, causing the first deselected row inside the selection to be selected.", 194 rowIndexes: [0, lastRowIndex], 193 description: "Remove a contiguous selection not preceded by a selectable row.", 194 rowIndexes: [0, 1], 195 195 }); 196 196 197 197 addTestCase({ 198 198 name: "Table.RemoveSelectedRows.Multiple.SelectPreceding", 199 description: "Remove selected rows, causing the row preceding the selection to be selected.",199 description: "Remove a contiguous selection not followed by a selectable row.", 200 200 rowIndexes: [lastRowIndex - 1, lastRowIndex], 201 }); 202 203 addTestCase({ 204 name: "Table.RemoveSelectedRows.Multiple.SelectPrecedingOverFollowing", 205 description: "Remove a contiguous selection between two selectable rows.", 206 rowIndexes: [1, 2], 207 }); 208 209 addTestCase({ 210 name: "Table.RemoveSelectedRows.Multiple.SelectPrecedingOverGap", 211 description: "Remove a non-contiguous selection preceded by a selectable row.", 212 rowIndexes: [1, 3], 213 }); 214 215 addTestCase({ 216 name: "Table.RemoveSelectedRows.Multiple.SelectGapOverFollowing", 217 description: "Remove a non-contiguous selection followed by a selectable row.", 218 rowIndexes: [0, 2], 201 219 }); 202 220 -
trunk/Source/WebInspectorUI/ChangeLog
r244154 r244155 1 2019-04-10 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: REGRESSION (r238602): Elements: deleting the last child of a collapsed parent selects the parent's next sibling 4 https://bugs.webkit.org/show_bug.cgi?id=192711 5 <rdar://problem/46738990> 6 7 Reviewed by Timothy Hatcher. 8 9 Original patch by Matt Baker <mattbaker@apple.com>. 10 11 * UserInterface/Controllers/SelectionController.js: 12 (WI.SelectionController.prototype.removeSelectedItems): 13 When looking for a new item to select, start with the item preceding the 14 selection, instead of the item following the selection. This matches 15 pre-multiple selection behavior, as well as Mail and Xcode. 16 17 * UserInterface/Views/DOMTreeElement.js: 18 (WI.DOMTreeElement.prototype.onexpand): 19 Drive-by fix: when a hidden node is selected, its selection area is drawn 20 with a height of 0px. Update the selection area once the hidden node's 21 parent is expanded. AFAIK, this has always been broken. 22 23 * UserInterface/Views/DOMTreeOutline.js: 24 (WI.DOMTreeOutline.prototype.ondelete): 25 After a delete the `SelectionController` may have chosen a child of a 26 collapsed parent as the new selected item. If the item isn't the closing tag (e.g. after 27 deleting the last child), reveal it. 28 29 (WI.DOMTreeOutline.prototype.selectionControllerPreviousSelectableItem): 30 31 * UserInterface/Views/TreeElement.js: 32 (WI.TreeElement.prototype.get previousSelectableSibling): Added. 33 (WI.TreeElement.prototype.get nextSelectableSibling): Added. 34 35 * UserInterface/Views/TreeOutline.js: 36 (WI.TreeOutline.prototype.selectionControllerPreviousSelectableItem): 37 (WI.TreeOutline.prototype.selectionControllerNextSelectableItem): 38 Set `skipUnrevealed` to false, so that children of collapsed parent nodes 39 are considered when looking for an item to selected after a delete. Hidden `TreeElement`s 40 are still ignored as they aren't `selectable`. 41 1 42 2019-04-10 Devin Rousso <drousso@apple.com> 2 43 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/SelectionController.js
r244154 r244155 179 179 let orderedSelection = Array.from(this._selectedItems).sort(this._comparator); 180 180 181 // Try selecting the item following the selection.182 let lastSelectedItem = orderedSelection.lastValue;183 let itemToSelect = this._ nextSelectableItem(lastSelectedItem);181 // Try selecting the item preceding the selection. 182 let firstSelectedItem = orderedSelection[0]; 183 let itemToSelect = this._previousSelectableItem(firstSelectedItem); 184 184 if (!itemToSelect) { 185 // If no item exists after the last item in the selection, try selecting185 // If no item exists before the first item in the selection, try selecting 186 186 // a deselected item (hole) within the selection. 187 itemToSelect = orderedSelection[0];187 itemToSelect = firstSelectedItem; 188 188 while (itemToSelect && this.hasSelectedItem(itemToSelect)) 189 189 itemToSelect = this._nextSelectableItem(itemToSelect); … … 191 191 if (!itemToSelect || this.hasSelectedItem(itemToSelect)) { 192 192 // If the selection contains no holes, try selecting the item 193 // preceding the selection.194 itemToSelect = this._ previousSelectableItem(orderedSelection[0]);193 // following the selection. 194 itemToSelect = this._nextSelectableItem(orderedSelection.lastValue); 195 195 } 196 196 } -
trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js
r244154 r244155 607 607 608 608 this.updateTitle(); 609 610 for (let treeElement of this.children) 611 treeElement.updateSelectionArea(); 609 612 } 610 613 -
trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js
r244154 r244155 336 336 this._treeElementsToRemove = null; 337 337 338 if (this.selectedTreeElement && !this.selectedTreeElement.isCloseTag()) { 339 console.assert(this.selectedTreeElements.length === 1); 340 this.selectedTreeElement.reveal(); 341 } 342 338 343 return true; 344 } 345 346 // SelectionController delegate overrides 347 348 selectionControllerPreviousSelectableItem(controller, item) 349 { 350 let treeElement = this.getCachedTreeElement(item); 351 console.assert(treeElement, "Missing TreeElement for representedObject.", item); 352 if (!treeElement) 353 return null; 354 355 if (this._treeElementsToRemove) { 356 // When deleting, force the SelectionController to check siblings in 357 // the opposite direction before searching up the parent chain. 358 if (!treeElement.previousSelectableSibling && treeElement.nextSelectableSibling) 359 return null; 360 } 361 362 return super.selectionControllerPreviousSelectableItem(controller, item); 339 363 } 340 364 -
trunk/Source/WebInspectorUI/UserInterface/Views/TreeElement.js
r243242 r244155 185 185 } 186 186 187 get previousSelectableSibling() 188 { 189 let treeElement = this.previousSibling; 190 while (treeElement && !treeElement.selectable) 191 treeElement = treeElement.previousSibling; 192 return treeElement; 193 } 194 195 get nextSelectableSibling() 196 { 197 let treeElement = this.nextSibling; 198 while (treeElement && !treeElement.selectable) 199 treeElement = treeElement.nextSibling; 200 return treeElement; 201 } 202 187 203 canSelectOnMouseDown(event) 188 204 { -
trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js
r244154 r244155 856 856 return null; 857 857 858 const skipUnrevealed = true;858 const skipUnrevealed = false; 859 859 const stayWithin = null; 860 860 const dontPopulate = true; … … 875 875 return null; 876 876 877 const skipUnrevealed = true;877 const skipUnrevealed = false; 878 878 const stayWithin = null; 879 879 const dontPopulate = true;
Note: See TracChangeset
for help on using the changeset viewer.