Title: [201210] trunk/Source/WebInspectorUI
Revision
201210
Author
[email protected]
Date
2016-05-19 23:31:47 -0700 (Thu, 19 May 2016)

Log Message

Web Inspector: Main Resource with <scripts> not showing up in debugger sidebar after reload
https://bugs.webkit.org/show_bug.cgi?id=157939
<rdar://problem/26385691>

Patch by Joseph Pecoraro <[email protected]> on 2016-05-19
Reviewed by Timothy Hatcher.

The order of events on a reload are:

    - MainResourceChanged, add main resource
    - ScriptsCleared, remove all elements

This change makes it so ScriptsCleared add the main resource (and
potentially other resources). This also avoids the work in
MainResourceChanged on reloads / navigations that would be wasted if
ScriptsCleared were to just remove it. However, this is still needed
for initial load where ScriptsCleared does not happen.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype._mainResourceDidChange):
Only add the main resource tree here when we are first loading.

(WebInspector.DebuggerSidebarPanel.prototype._scriptsCleared):
Add the main resource tree after we remove all children in navigations.

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel.prototype._contentTreeOutlineTreeSelectionDidChange):
This was not gracefully handling if there was no selected tree element.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (201209 => 201210)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-05-20 04:13:33 UTC (rev 201209)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-05-20 06:31:47 UTC (rev 201210)
@@ -1,5 +1,35 @@
 2016-05-19  Joseph Pecoraro  <[email protected]>
 
+        Web Inspector: Main Resource with <scripts> not showing up in debugger sidebar after reload
+        https://bugs.webkit.org/show_bug.cgi?id=157939
+        <rdar://problem/26385691>
+
+        Reviewed by Timothy Hatcher.
+
+        The order of events on a reload are:
+
+            - MainResourceChanged, add main resource
+            - ScriptsCleared, remove all elements
+
+        This change makes it so ScriptsCleared add the main resource (and
+        potentially other resources). This also avoids the work in
+        MainResourceChanged on reloads / navigations that would be wasted if
+        ScriptsCleared were to just remove it. However, this is still needed
+        for initial load where ScriptsCleared does not happen.
+
+        * UserInterface/Views/DebuggerSidebarPanel.js:
+        (WebInspector.DebuggerSidebarPanel.prototype._mainResourceDidChange):
+        Only add the main resource tree here when we are first loading.
+
+        (WebInspector.DebuggerSidebarPanel.prototype._scriptsCleared):
+        Add the main resource tree after we remove all children in navigations.
+
+        * UserInterface/Views/NavigationSidebarPanel.js:
+        (WebInspector.NavigationSidebarPanel.prototype._contentTreeOutlineTreeSelectionDidChange):
+        This was not gracefully handling if there was no selected tree element.
+
+2016-05-19  Joseph Pecoraro  <[email protected]>
+
         Web Inspector: Visual Style connectors are not always centered properly
         https://bugs.webkit.org/show_bug.cgi?id=157932
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js (201209 => 201210)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js	2016-05-20 04:13:33 UTC (rev 201209)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js	2016-05-20 06:31:47 UTC (rev 201210)
@@ -423,10 +423,12 @@
             this.contentBrowser.contentViewContainer.closeAllContentViews();
         }
 
-        var resource = event.target.mainResource;
-        this._addTreeElementForSourceCodeToTreeOutline(resource, this._scriptsContentTreeOutline);
-        this._addBreakpointsForSourceCode(resource);
-        this._addIssuesForSourceCode(resource);
+        if (!event.data.oldMainResource) {
+            var resource = event.target.mainResource;
+            this._addTreeElementForSourceCodeToTreeOutline(resource, this._scriptsContentTreeOutline);
+            this._addBreakpointsForSourceCode(resource);
+            this._addIssuesForSourceCode(resource);
+        }
     }
 
     _timelineCapturingWillStart(event)
@@ -500,6 +502,8 @@
         }
 
         this._scriptsContentTreeOutline.removeChildren();
+
+        this._addResourcesRecursivelyForFrame(WebInspector.frameResourceManager.mainFrame);
     }
 
     _breakpointAdded(event)

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js (201209 => 201210)


--- trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js	2016-05-20 04:13:33 UTC (rev 201209)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js	2016-05-20 06:31:47 UTC (rev 201210)
@@ -674,8 +674,10 @@
 
         // Prevent two selections in the sidebar, if the selected tree outline is changing.
         let treeOutline = selectedElement.treeOutline;
-        if (this._selectedContentTreeOutline && this._selectedContentTreeOutline !== treeOutline)
-            this._selectedContentTreeOutline.selectedTreeElement.deselect();
+        if (this._selectedContentTreeOutline && this._selectedContentTreeOutline !== treeOutline) {
+            if (this._selectedContentTreeOutline.selectedTreeElement)
+                this._selectedContentTreeOutline.selectedTreeElement.deselect();
+        }
 
         treeOutline[WebInspector.NavigationSidebarPanel.PreviousSelectedTreeElementSymbol] = null;
         this._selectedContentTreeOutline = treeOutline;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to