Title: [246560] trunk/Source/WebInspectorUI
Revision
246560
Author
drou...@apple.com
Date
2019-06-18 12:50:06 -0700 (Tue, 18 Jun 2019)

Log Message

Web Inspector: Network: detail view shouldn't stay open when the related entry is removed
https://bugs.webkit.org/show_bug.cgi?id=198951

Reviewed by Joseph Pecoraro.

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype._mainResourceDidChange):
Hide the detail view if the main resource changes and we aren't preserving the log.

* UserInterface/Views/Table.js:
(WI.Table.prototype.reloadVisibleColumnCells):
Only attempt to populate cells for rows that the `_dataSource` actually has. Without this,
the `_delegate` may be asked to populate a cell for a row it doesn't have, which would error.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (246559 => 246560)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-06-18 19:37:35 UTC (rev 246559)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-06-18 19:50:06 UTC (rev 246560)
@@ -1,5 +1,21 @@
 2019-06-18  Devin Rousso  <drou...@apple.com>
 
+        Web Inspector: Network: detail view shouldn't stay open when the related entry is removed
+        https://bugs.webkit.org/show_bug.cgi?id=198951
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Views/NetworkTableContentView.js:
+        (WI.NetworkTableContentView.prototype._mainResourceDidChange):
+        Hide the detail view if the main resource changes and we aren't preserving the log.
+
+        * UserInterface/Views/Table.js:
+        (WI.Table.prototype.reloadVisibleColumnCells):
+        Only attempt to populate cells for rows that the `_dataSource` actually has. Without this,
+        the `_delegate` may be asked to populate a cell for a row it doesn't have, which would error.
+
+2019-06-18  Devin Rousso  <drou...@apple.com>
+
         Web Inspector: parseQueryParameters fails to successfully parse query parameter values that contain "="
         https://bugs.webkit.org/show_bug.cgi?id=198971
         <rdar://problem/51852782>

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js (246559 => 246560)


--- trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js	2019-06-18 19:37:35 UTC (rev 246559)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js	2019-06-18 19:50:06 UTC (rev 246560)
@@ -1585,11 +1585,15 @@
 
     _mainResourceDidChange(event)
     {
-        this._runForMainCollection((collection) => {
+        this._runForMainCollection((collection, wasMain) => {
             let frame = event.target;
-            if (frame.isMainFrame() && WI.settings.clearNetworkOnNavigate.value)
+            if (frame.isMainFrame() && WI.settings.clearNetworkOnNavigate.value) {
                 this._resetCollection(collection);
 
+                if (wasMain && !this._needsInitialPopulate)
+                    this._hideDetailView();
+            }
+
             if (this._transitioningPageTarget) {
                 this._transitioningPageTarget = false;
                 this._needsInitialPopulate = true;

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/Table.js (246559 => 246560)


--- trunk/Source/WebInspectorUI/UserInterface/Views/Table.js	2019-06-18 19:37:35 UTC (rev 246559)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Table.js	2019-06-18 19:50:06 UTC (rev 246560)
@@ -281,7 +281,8 @@
         if (columnIndex === -1)
             return;
 
-        for (let rowIndex = this._visibleRowIndexStart; rowIndex < this._visibleRowIndexEnd; ++rowIndex) {
+        let numberOfRows = Math.min(this._visibleRowIndexEnd, this.numberOfRows);
+        for (let rowIndex = this._visibleRowIndexStart; rowIndex < numberOfRows; ++rowIndex) {
             let row = this._cachedRows.get(rowIndex);
             if (!row)
                 continue;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to