Title: [216461] trunk/Source/WebInspectorUI
Revision
216461
Author
commit-qu...@webkit.org
Date
2017-05-08 16:12:29 -0700 (Mon, 08 May 2017)

Log Message

Web Inspector: Request/Response toggles not working
https://bugs.webkit.org/show_bug.cgi?id=171833
<rdar://problem/31341637>

Patch by Joseph Pecoraro <pecor...@apple.com> on 2017-05-08
Reviewed by Brian Burg.

* UserInterface/Views/HierarchicalPathNavigationItem.js:
(WebInspector.HierarchicalPathNavigationItem.set components.let.componentsEqual):
(WebInspector.HierarchicalPathNavigationItem.prototype.set components):
If the new components being set were shallowly equal, then they wouldn't
actually be updated even if ultimately they are different. In this case
the Path Components with values "request" / "response" would not update
between different resources because the path components had equivalent
simple values. Provide a different discriminator (comparisonData) which
can be an object so these path components compare as necessarily different.

* UserInterface/Views/HeapSnapshotClusterContentView.js:
(WebInspector.HeapSnapshotClusterContentView.createPathComponent):
(WebInspector.HeapSnapshotClusterContentView):
* UserInterface/Views/ResourceClusterContentView.js:
(WebInspector.ResourceClusterContentView.createPathComponent):
(WebInspector.ResourceClusterContentView):
(WebInspector.ResourceClusterContentView.prototype._resourceTypeDidChange):
* UserInterface/Views/SVGImageResourceClusterContentView.js:
(WebInspector.SVGImageResourceClusterContentView):
* UserInterface/Views/ScriptClusterTimelineView.js:
(WebInspector.ScriptClusterTimelineView.createPathComponent):
(WebInspector.ScriptClusterTimelineView):
Provide comparisonData for path components cases that would need it.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (216460 => 216461)


--- trunk/Source/WebInspectorUI/ChangeLog	2017-05-08 22:51:11 UTC (rev 216460)
+++ trunk/Source/WebInspectorUI/ChangeLog	2017-05-08 23:12:29 UTC (rev 216461)
@@ -1,3 +1,35 @@
+2017-05-08  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Request/Response toggles not working
+        https://bugs.webkit.org/show_bug.cgi?id=171833
+        <rdar://problem/31341637>
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Views/HierarchicalPathNavigationItem.js:
+        (WebInspector.HierarchicalPathNavigationItem.set components.let.componentsEqual):
+        (WebInspector.HierarchicalPathNavigationItem.prototype.set components):
+        If the new components being set were shallowly equal, then they wouldn't
+        actually be updated even if ultimately they are different. In this case
+        the Path Components with values "request" / "response" would not update
+        between different resources because the path components had equivalent
+        simple values. Provide a different discriminator (comparisonData) which
+        can be an object so these path components compare as necessarily different.
+
+        * UserInterface/Views/HeapSnapshotClusterContentView.js:
+        (WebInspector.HeapSnapshotClusterContentView.createPathComponent):
+        (WebInspector.HeapSnapshotClusterContentView):
+        * UserInterface/Views/ResourceClusterContentView.js:
+        (WebInspector.ResourceClusterContentView.createPathComponent):
+        (WebInspector.ResourceClusterContentView):
+        (WebInspector.ResourceClusterContentView.prototype._resourceTypeDidChange):
+        * UserInterface/Views/SVGImageResourceClusterContentView.js:
+        (WebInspector.SVGImageResourceClusterContentView):
+        * UserInterface/Views/ScriptClusterTimelineView.js:
+        (WebInspector.ScriptClusterTimelineView.createPathComponent):
+        (WebInspector.ScriptClusterTimelineView):
+        Provide comparisonData for path components cases that would need it.
+
 2017-05-08  Chris Dumez  <cdu...@apple.com>
 
         Drop non-standard Element.scrollByLines() / scrollByPages()

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClusterContentView.js (216460 => 216461)


--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClusterContentView.js	2017-05-08 22:51:11 UTC (rev 216460)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClusterContentView.js	2017-05-08 23:12:29 UTC (rev 216461)
@@ -37,6 +37,7 @@
         {
             let pathComponent = new WebInspector.HierarchicalPathComponent(displayName, className, identifier, false, true);
             pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._pathComponentSelected, this);
+            pathComponent.comparisonData = heapSnapshot;
             return pathComponent;
         }
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathNavigationItem.js (216460 => 216461)


--- trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathNavigationItem.js	2017-05-08 22:51:11 UTC (rev 216460)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathNavigationItem.js	2017-05-08 23:12:29 UTC (rev 216461)
@@ -48,7 +48,13 @@
             let getRepresentedObjects = (component) => component.representedObject;
             let representedObjectsA = a.map(getRepresentedObjects);
             let representedObjectsB = b.map(getRepresentedObjects);
-            return Array.shallowEqual(representedObjectsA, representedObjectsB);
+            if (!Array.shallowEqual(representedObjectsA, representedObjectsB))
+                return false;
+
+            let getExtraComparisonData = (component) => component.comparisonData;
+            let extraComparisonDataA = a.map(getExtraComparisonData);
+            let extraComparisonDataB = b.map(getExtraComparisonData);
+            return Array.shallowEqual(extraComparisonDataA, extraComparisonDataB);
         };
 
         if (this._components && componentsEqual(this._components, newComponents))

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceClusterContentView.js (216460 => 216461)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceClusterContentView.js	2017-05-08 22:51:11 UTC (rev 216460)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceClusterContentView.js	2017-05-08 23:12:29 UTC (rev 216461)
@@ -35,8 +35,9 @@
 
         function createPathComponent(displayName, className, identifier)
         {
-            var pathComponent = new WebInspector.HierarchicalPathComponent(displayName, className, identifier, false, true);
+            let pathComponent = new WebInspector.HierarchicalPathComponent(displayName, className, identifier, false, true);
             pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._pathComponentSelected, this);
+            pathComponent.comparisonData = resource;
             return pathComponent;
         }
 
@@ -256,7 +257,7 @@
         if (!currentResponseContentView)
             return;
 
-        delete this._responseContentView;
+        this._responseContentView = null;
 
         this.contentViewContainer.replaceContentView(currentResponseContentView, this.responseContentView);
     }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SVGImageResourceClusterContentView.js (216460 => 216461)


--- trunk/Source/WebInspectorUI/UserInterface/Views/SVGImageResourceClusterContentView.js	2017-05-08 22:51:11 UTC (rev 216460)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SVGImageResourceClusterContentView.js	2017-05-08 23:12:29 UTC (rev 216461)
@@ -36,6 +36,7 @@
             const showSelectorArrows = true;
             let pathComponent = new WebInspector.HierarchicalPathComponent(displayName, className, identifier, textOnly, showSelectorArrows);
             pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._pathComponentSelected, this);
+            pathComponent.comparisonData = resource;
             return pathComponent;
         };
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ScriptClusterTimelineView.js (216460 => 216461)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ScriptClusterTimelineView.js	2017-05-08 22:51:11 UTC (rev 216460)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScriptClusterTimelineView.js	2017-05-08 23:12:29 UTC (rev 216461)
@@ -38,6 +38,7 @@
         {
             let pathComponent = new WebInspector.HierarchicalPathComponent(displayName, className, identifier, false, showSelectorArrows);
             pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._pathComponentSelected, this);
+            pathComponent.comparisonData = timeline;
             return pathComponent;
         }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to