Changeset 244615 in webkit
- Timestamp:
- Apr 24, 2019 2:30:51 PM (5 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r244577 r244615 1 2019-04-24 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Network: importing a HAR with an active detail view shows no content 4 https://bugs.webkit.org/show_bug.cgi?id=197223 5 6 Reviewed by Timothy Hatcher. 7 8 When hiding the detail view, we force a `layout` of the Network table, which causes the 9 cached row count to be set to `0`, which prevents the `reloadDataAddedToEndOnly` from 10 rendering anything since the `WI.Table` thinks it has no rows. 11 12 Given that all of the users of `WI.Table` are backed by an array, we don't need to cache the 13 number of rows since `.length` is an extremely cheap operation. In turn, this guarantees 14 that we are always rendering with an accurate value. 15 16 * UserInterface/Views/Table.js: 17 (WI.Table): 18 (WI.Table.prototype.get numberOfRows): 19 (WI.Table.prototype.reloadData): 20 (WI.Table.prototype._removeRows): 21 1 22 2019-04-23 Devin Rousso <drousso@apple.com> 2 23 -
trunk/Source/WebInspectorUI/UserInterface/Views/Table.js
r242174 r244615 77 77 78 78 this._cachedRows = new Map; 79 this._cachedNumberOfRows = NaN;80 79 81 80 this._columnSpecs = new Map; … … 114 113 this._visibleRowIndexEnd = NaN; 115 114 115 console.assert(this._dataSource.tableNumberOfRows, "Table data source must implement tableNumberOfRows."); 116 116 console.assert(this._dataSource.tableIndexForRepresentedObject, "Table data source must implement tableIndexForRepresentedObject."); 117 117 console.assert(this._dataSource.tableRepresentedObjectForIndex, "Table data source must implement tableRepresentedObjectForIndex."); … … 146 146 get numberOfRows() 147 147 { 148 if (isNaN(this._cachedNumberOfRows)) 149 this._cachedNumberOfRows = this._dataSource.tableNumberOfRows(this); 150 151 return this._cachedNumberOfRows; 148 return this._dataSource.tableNumberOfRows(this); 152 149 } 153 150 … … 254 251 this._selectionController.reset(); 255 252 256 this._cachedNumberOfRows = NaN;257 253 this._previousRevealedRowCount = NaN; 258 254 this.needsLayout(); … … 1436 1432 return; 1437 1433 1438 for (let index = lastIndex + 1; index < this. _cachedNumberOfRows; ++index)1434 for (let index = lastIndex + 1; index < this.numberOfRows; ++index) 1439 1435 adjustRowAtIndex(index); 1440 1436 1441 this._cachedNumberOfRows -= removed;1442 console.assert(this._cachedNumberOfRows >= 0);1443 1437 1444 1438 this._selectionController.didRemoveItems(representedObjects); 1445 1439 1446 if (this._delegate.tableDidRemoveRows) {1440 if (this._delegate.tableDidRemoveRows) 1447 1441 this._delegate.tableDidRemoveRows(this, rowIndexes); 1448 console.assert(this._cachedNumberOfRows === this._dataSource.tableNumberOfRows(this), "Table data source should update after removing rows.");1449 }1450 1442 } 1451 1443
Note: See TracChangeset
for help on using the changeset viewer.