WebKit Bugzilla
Attachment 373185 Details for
Bug 193841
: REGRESSION (r238563): Web Inspector: Selection is erratic when holding Up/Down on Network Table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193841-20190629212648.patch (text/plain), 4.09 KB, created by
Matt Baker
on 2019-06-29 21:26:50 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Matt Baker
Created:
2019-06-29 21:26:50 PDT
Size:
4.09 KB
patch
obsolete
>Subversion Revision: 246952 >diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index bd18877505bf4822bdb63cb3698ba419fdfc4de8..441070cc37cb5ce85f13250815739e72ab99404f 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,27 @@ >+2019-06-29 Matt Baker <mattbaker@apple.com> >+ >+ REGRESSION (r238563): Web Inspector: Selection is erratic when holding Up/Down on Network Table >+ https://bugs.webkit.org/show_bug.cgi?id=193841 >+ <rdar://problem/47559124> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Intermittent resource loads cause the Network table to reload all of its >+ data as records in the data source are inserted or updated. The content >+ view restores the selection after reloading the table data, but when the >+ selected row is revealed it appears to "jump" around, as a result of Table >+ calling `scrollIntoPosition` on the DOM node for the row. >+ >+ This patch adds a new Table method, `reloadDataPreservingSelection`, which >+ preserves the selection and scroll position between reloads. >+ >+ * UserInterface/Views/NetworkTableContentView.js: >+ (WI.NetworkTableContentView.prototype._reloadTable): >+ (WI.NetworkTableContentView.prototype._restoreSelectedRow): Deleted. >+ >+ * UserInterface/Views/Table.js: >+ (WI.Table.prototype.reloadDataPreservingSelection): >+ > 2019-06-29 Nikita Vasilyev <nvasilyev@apple.com> > > Remove duplicate "Private" section and fix white space >diff --git a/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js b/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js >index e27ae10b03bb11eebf8fc7c11ad9755e02089c7e..4af1772edeb13c4e159f6a0ce94a3a3347207900 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js >+++ b/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js >@@ -1963,8 +1963,7 @@ WI.NetworkTableContentView = class NetworkTableContentView extends WI.ContentVie > > _reloadTable() > { >- this._table.reloadData(); >- this._restoreSelectedRow(); >+ this._table.reloadDataPreservingSelection(); > } > > _generateTypeFilter() >@@ -2090,22 +2089,6 @@ WI.NetworkTableContentView = class NetworkTableContentView extends WI.ContentVie > } > } > >- _restoreSelectedRow() >- { >- if (!this._selectedObject) >- return; >- >- let rowIndex = this._rowIndexForRepresentedObject(this._selectedObject); >- if (rowIndex === -1) { >- this._selectedObject = null; >- this._table.deselectAll(); >- return; >- } >- >- this._table.selectRow(rowIndex); >- this._showDetailView(this._selectedObject); >- } >- > _HARResources() > { > let resources = this._activeCollection.filteredEntries.map((x) => x.resource); >diff --git a/Source/WebInspectorUI/UserInterface/Views/Table.js b/Source/WebInspectorUI/UserInterface/Views/Table.js >index e44a7c26182ec6c36f6af4919aa315cc04814d6c..6d13c180a9f92035c2462572b5514e400bd435f6 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/Table.js >+++ b/Source/WebInspectorUI/UserInterface/Views/Table.js >@@ -254,6 +254,26 @@ WI.Table = class Table extends WI.View > this.needsLayout(); > } > >+ reloadDataPreservingSelection() >+ { >+ let previousScrollTop = this._scrollContainerElement.scrollTop; >+ let previousSelectedItems = new Set(this._selectionController.selectedItems); >+ >+ this.reloadData(); >+ >+ if (!previousSelectedItems.size) >+ return; >+ >+ if (this.allowsMultipleSelection) >+ this._selectionController.selectItems(previousSelectedItems); >+ else { >+ console.assert(previousSelectedItems.size === 1, "Should not have multiple selected items when allowsMultipleSelection is false."); >+ this._selectionController.selectItem(previousSelectedItems.firstValue); >+ } >+ >+ this._scrollContainerElement.scrollTop = previousScrollTop; >+ } >+ > reloadDataAddedToEndOnly() > { > this._previousRevealedRowCount = NaN;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193841
:
373091
|
373185
|
373280
|
373285
|
373291
|
373292
|
373326