Web Inspector: Prefer Resources tab over Network tab when showing files
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2017 22:44:29 +0000 (22:44 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2017 22:44:29 +0000 (22:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=168021

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2017-02-21
Reviewed by Timothy Hatcher.

* UserInterface/Base/Main.js:
(WebInspector.handlePossibleLinkClick):
(WebInspector.openURL):
Add `options` parameter to provide greater customization.

* UserInterface/Views/TabBrowser.js:
(WebInspector.TabBrowser.prototype.bestTabContentViewForRepresentedObject):
Add logic for `ignoreNetworkTab` option that will ignore instances of NetworkTabContentView.

* UserInterface/Controllers/BreakpointPopoverController.js:
(WebInspector.BreakpointPopoverController.prototype.appendContextMenuItems):
* UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.showMainResourceForFrame):
* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
(WebInspector.CSSStyleDeclarationTextEditor.tokenTrackingControllerHighlightedRangeWasClicked.showRangeInSourceCode):
* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WebInspector.ComputedStyleDetailsPanel.prototype.cssStyleDeclarationTextEditorShowProperty):
* UserInterface/Views/ContextMenuUtilities.js:
(WebInspector.appendContextMenuItemsForSourceCode):
* UserInterface/Views/DOMTreeContentView.js:
(WebInspector.DOMTreeContentView.prototype._mouseWasClicked.followLink):
* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement.prototype._populateTagContextMenu):
(WebInspector.DOMTreeElement.prototype._showCustomElementDefinition):
* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype._treeSelectionDidChange):
* UserInterface/Views/NetworkTimelineView.js:
(WebInspector.NetworkTimelineView.prototype.showContentViewForTreeElement):
* UserInterface/Views/ObjectTreeBaseTreeElement.js:
(WebInspector.ObjectTreeBaseTreeElement.prototype._appendMenusItemsForObject):
* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel.prototype._treeSelectionDidChange):
* UserInterface/Views/ResourceTimelineDataGridNode.js:
(WebInspector.ResourceTimelineDataGridNode.prototype._dataGridNodeGoToArrowClicked):
* UserInterface/Views/SearchSidebarPanel.js:
(WebInspector.SearchSidebarPanel.prototype._treeSelectionDidChange):
(WebInspector.SearchSidebarPanel.prototype._treeElementDoubleClick):
* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype.tokenTrackingControllerHighlightedRangeWasClicked):
* UserInterface/Views/TimelineDataGrid.js:
(WebInspector.TimelineDataGrid.prototype._popoverCallStackTreeSelectionDidChange):
* UserInterface/Views/VisualStyleSelectorTreeItem.js:
(WebInspector.VisualStyleSelectorTreeItem.prototype.populateContextMenu):
Change arguments of functions to change content views to ignore the Network tab.

* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView.prototype.hasRepresentedObject):
* UserInterface/Views/NetworkSidebarPanel.js:
(WebInspector.NetworkSidebarPanel.prototype.hasRepresentedObject):
* UserInterface/Views/NetworkTabContentView.js:
(WebInspector.NetworkTabContentView.prototype.canShowRepresentedObject):
Ensure that the Network tab can only display resources that it has entries for in its view.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212761 268f45cc-cd09-0410-ab3c-d52691b4dbfc

22 files changed:
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Main.js
Source/WebInspectorUI/UserInterface/Controllers/BreakpointPopoverController.js
Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendAPI.js
Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js
Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.js
Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js
Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js
Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js
Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/NetworkGridContentView.js
Source/WebInspectorUI/UserInterface/Views/NetworkSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/NetworkTabContentView.js
Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js
Source/WebInspectorUI/UserInterface/Views/ObjectTreeBaseTreeElement.js
Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNode.js
Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js
Source/WebInspectorUI/UserInterface/Views/TabBrowser.js
Source/WebInspectorUI/UserInterface/Views/TimelineDataGrid.js
Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorTreeItem.js

index 3325534..0023c82 100644 (file)
@@ -1,3 +1,63 @@
+2017-02-21  Devin Rousso  <dcrousso+webkit@gmail.com>
+
+        Web Inspector: Prefer Resources tab over Network tab when showing files
+        https://bugs.webkit.org/show_bug.cgi?id=168021
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Base/Main.js:
+        (WebInspector.handlePossibleLinkClick):
+        (WebInspector.openURL):
+        Add `options` parameter to provide greater customization.
+
+        * UserInterface/Views/TabBrowser.js:
+        (WebInspector.TabBrowser.prototype.bestTabContentViewForRepresentedObject):
+        Add logic for `ignoreNetworkTab` option that will ignore instances of NetworkTabContentView.
+
+        * UserInterface/Controllers/BreakpointPopoverController.js:
+        (WebInspector.BreakpointPopoverController.prototype.appendContextMenuItems):
+        * UserInterface/Protocol/InspectorFrontendAPI.js:
+        (InspectorFrontendAPI.showMainResourceForFrame):
+        * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
+        (WebInspector.CSSStyleDeclarationTextEditor.tokenTrackingControllerHighlightedRangeWasClicked.showRangeInSourceCode):
+        * UserInterface/Views/ComputedStyleDetailsPanel.js:
+        (WebInspector.ComputedStyleDetailsPanel.prototype.cssStyleDeclarationTextEditorShowProperty):
+        * UserInterface/Views/ContextMenuUtilities.js:
+        (WebInspector.appendContextMenuItemsForSourceCode):
+        * UserInterface/Views/DOMTreeContentView.js:
+        (WebInspector.DOMTreeContentView.prototype._mouseWasClicked.followLink):
+        * UserInterface/Views/DOMTreeElement.js:
+        (WebInspector.DOMTreeElement.prototype._populateTagContextMenu):
+        (WebInspector.DOMTreeElement.prototype._showCustomElementDefinition):
+        * UserInterface/Views/DebuggerSidebarPanel.js:
+        (WebInspector.DebuggerSidebarPanel.prototype._treeSelectionDidChange):
+        * UserInterface/Views/NetworkTimelineView.js:
+        (WebInspector.NetworkTimelineView.prototype.showContentViewForTreeElement):
+        * UserInterface/Views/ObjectTreeBaseTreeElement.js:
+        (WebInspector.ObjectTreeBaseTreeElement.prototype._appendMenusItemsForObject):
+        * UserInterface/Views/ResourceSidebarPanel.js:
+        (WebInspector.ResourceSidebarPanel.prototype._treeSelectionDidChange):
+        * UserInterface/Views/ResourceTimelineDataGridNode.js:
+        (WebInspector.ResourceTimelineDataGridNode.prototype._dataGridNodeGoToArrowClicked):
+        * UserInterface/Views/SearchSidebarPanel.js:
+        (WebInspector.SearchSidebarPanel.prototype._treeSelectionDidChange):
+        (WebInspector.SearchSidebarPanel.prototype._treeElementDoubleClick):
+        * UserInterface/Views/SourceCodeTextEditor.js:
+        (WebInspector.SourceCodeTextEditor.prototype.tokenTrackingControllerHighlightedRangeWasClicked):
+        * UserInterface/Views/TimelineDataGrid.js:
+        (WebInspector.TimelineDataGrid.prototype._popoverCallStackTreeSelectionDidChange):
+        * UserInterface/Views/VisualStyleSelectorTreeItem.js:
+        (WebInspector.VisualStyleSelectorTreeItem.prototype.populateContextMenu):
+        Change arguments of functions to change content views to ignore the Network tab.
+
+        * UserInterface/Views/NetworkGridContentView.js:
+        (WebInspector.NetworkGridContentView.prototype.hasRepresentedObject):
+        * UserInterface/Views/NetworkSidebarPanel.js:
+        (WebInspector.NetworkSidebarPanel.prototype.hasRepresentedObject):
+        * UserInterface/Views/NetworkTabContentView.js:
+        (WebInspector.NetworkTabContentView.prototype.canShowRepresentedObject):
+        Ensure that the Network tab can only display resources that it has entries for in its view.
+
 2017-02-21  Brian Burg  <bburg@apple.com>
 
         Web Inspector: RTL: console scope bar's unread message indicator is misaligned
index c223d65..e2bb507 100644 (file)
@@ -810,24 +810,24 @@ WebInspector.handlePossibleLinkClick = function(event, frame, alwaysOpenExternal
     event.preventDefault();
     event.stopPropagation();
 
-    this.openURL(anchorElement.href, frame, false, anchorElement.lineNumber);
+    this.openURL(anchorElement.href, frame, {lineNumber: anchorElement.lineNumber});
 
     return true;
 };
 
-WebInspector.openURL = function(url, frame, alwaysOpenExternally, lineNumber)
+WebInspector.openURL = function(url, frame, options = {})
 {
     console.assert(url);
     if (!url)
         return;
 
-    console.assert(typeof lineNumber === "undefined" || typeof lineNumber === "number", "lineNumber should be a number.");
+    console.assert(typeof options.lineNumber === "undefined" || typeof options.lineNumber === "number", "lineNumber should be a number.");
 
     // If alwaysOpenExternally is not defined, base it off the command/meta key for the current event.
-    if (alwaysOpenExternally === undefined || alwaysOpenExternally === null)
-        alwaysOpenExternally = window.event ? window.event.metaKey : false;
+    if (options.alwaysOpenExternally === undefined || options.alwaysOpenExternally === null)
+        options.alwaysOpenExternally = window.event ? window.event.metaKey : false;
 
-    if (alwaysOpenExternally) {
+    if (options.alwaysOpenExternally) {
         InspectorFrontendHost.openInNewTab(url);
         return;
     }
@@ -844,8 +844,8 @@ WebInspector.openURL = function(url, frame, alwaysOpenExternally, lineNumber)
     let simplifiedURL = removeURLFragment(url);
     var resource = frame.url === simplifiedURL ? frame.mainResource : frame.resourceForURL(simplifiedURL, searchChildFrames);
     if (resource) {
-        var position = new WebInspector.SourceCodePosition(lineNumber, 0);
-        this.showSourceCode(resource, position);
+        let positionToReveal = new WebInspector.SourceCodePosition(options.lineNumber, 0);
+        this.showSourceCode(resource, Object.shallowMerge(options, {positionToReveal}));
         return;
     }
 
index 1b30fc9..2aa4d30 100644 (file)
@@ -67,7 +67,7 @@ WebInspector.BreakpointPopoverController = class BreakpointPopoverController ext
         };
 
         const revealOriginalSourceCodeLocation = () => {
-            WebInspector.showOriginalOrFormattedSourceCodeLocation(breakpoint.sourceCodeLocation);
+            WebInspector.showOriginalOrFormattedSourceCodeLocation(breakpoint.sourceCodeLocation, {ignoreNetworkTab: true});
         };
 
         if (WebInspector.debuggerManager.isBreakpointEditable(breakpoint))
index 99ef372..13b50d7 100644 (file)
@@ -109,7 +109,7 @@ InspectorFrontendAPI = {
 
     showMainResourceForFrame: function(frameIdentifier)
     {
-        WebInspector.showSourceCodeForFrame(frameIdentifier);
+        WebInspector.showSourceCodeForFrame(frameIdentifier, {ignoreNetworkTab: true});
     },
 
     contextMenuItemSelected: function(id)
index 191749c..1893901 100644 (file)
@@ -1680,7 +1680,7 @@ WebInspector.CSSStyleDeclarationTextEditor = class CSSStyleDeclarationTextEditor
             if (!sourceCode || !range)
                 return false;
 
-            WebInspector.showSourceCodeLocation(sourceCode.createSourceCodeLocation(range.startLine, range.startColumn));
+            WebInspector.showSourceCodeLocation(sourceCode.createSourceCodeLocation(range.startLine, range.startColumn), {ignoreNetworkTab: true});
             return true;
         }
 
index 0e7a238..2a95c1d 100644 (file)
@@ -103,7 +103,7 @@ WebInspector.ComputedStyleDetailsPanel = class ComputedStyleDetailsPanel extends
         let sourceCode = ownerRule.sourceCodeLocation.sourceCode;
         let {startLine, startColumn} = effectiveProperty.styleSheetTextRange;
         let sourceCodeLocation = sourceCode.createSourceCodeLocation(startLine, startColumn);
-        WebInspector.showSourceCodeLocation(sourceCodeLocation);
+        WebInspector.showSourceCodeLocation(sourceCodeLocation, {ignoreNetworkTab: true});
     }
 
     refresh(significantChange)
index ef6100a..40b489b 100644 (file)
@@ -38,8 +38,7 @@ WebInspector.appendContextMenuItemsForSourceCode = function(contextMenu, sourceC
     if (sourceCode.url) {
         contextMenu.appendItem(WebInspector.UIString("Open in New Tab"), () => {
             const frame = null;
-            const alwaysOpenExternally = true;
-            WebInspector.openURL(sourceCode.url, frame, alwaysOpenExternally);
+            WebInspector.openURL(sourceCode.url, frame, {alwaysOpenExternally: true});
         });
 
         contextMenu.appendItem(WebInspector.UIString("Copy Link Address"), () => {
index 37d9dae..bc6391e 100644 (file)
@@ -431,7 +431,7 @@ WebInspector.DOMTreeContentView = class DOMTreeContentView extends WebInspector.
             // to see if the command key is down like it normally would. So we need to do that check
             // before calling WebInspector.openURL.
             var alwaysOpenExternally = event ? event.metaKey : false;
-            WebInspector.openURL(anchorElement.href, this._frame, alwaysOpenExternally, anchorElement.lineNumber);
+            WebInspector.openURL(anchorElement.href, this._frame, {alwaysOpenExternally, lineNumber: anchorElement.lineNumber});
         }
 
         // Start a timeout since this is a single click, if the timeout is canceled before it fires,
index bee7a1d..6f31ea3 100644 (file)
@@ -652,14 +652,13 @@ WebInspector.DOMTreeElement = class DOMTreeElement extends WebInspector.TreeElem
 
                 contextMenu.appendItem(WebInspector.UIString("Open in New Tab"), () => {
                     const frame = null;
-                    const alwaysOpenExternally = true;
-                    WebInspector.openURL(url, frame, alwaysOpenExternally);
+                    WebInspector.openURL(url, frame, {alwaysOpenExternally: true});
                 });
 
                 if (WebInspector.frameResourceManager.resourceForURL(url)) {
                     contextMenu.appendItem(WebInspector.UIString("Reveal in Resources Tab"), () => {
                         let frame = WebInspector.frameResourceManager.frameForIdentifier(node.frameIdentifier);
-                        WebInspector.openURL(url, frame);
+                        WebInspector.openURL(url, frame, {ignoreNetworkTab: true});
                     });
                 }
 
@@ -1514,7 +1513,7 @@ WebInspector.DOMTreeElement = class DOMTreeElement extends WebInspector.TreeElem
                         return;
 
                     let sourceCodeLocation = sourceCode.createSourceCodeLocation(location.lineNumber, location.columnNumber || 0);
-                    WebInspector.showSourceCodeLocation(sourceCodeLocation);
+                    WebInspector.showSourceCodeLocation(sourceCodeLocation, {ignoreNetworkTab: true});
                 });
                 result.release();
             });
index 767a412..c6365a8 100644 (file)
@@ -782,7 +782,7 @@ WebInspector.DebuggerSidebarPanel = class DebuggerSidebarPanel extends WebInspec
             return;
 
         if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) {
-            WebInspector.showSourceCode(treeElement.representedObject);
+            WebInspector.showSourceCode(treeElement.representedObject, {ignoreNetworkTab: true});
             return;
         }
 
@@ -792,12 +792,12 @@ WebInspector.DebuggerSidebarPanel = class DebuggerSidebarPanel extends WebInspec
                 WebInspector.debuggerManager.activeCallFrame = callFrame;
 
             if (callFrame.sourceCodeLocation)
-                WebInspector.showSourceCodeLocation(callFrame.sourceCodeLocation);
+                WebInspector.showSourceCodeLocation(callFrame.sourceCodeLocation, {ignoreNetworkTab: true});
             return;
         }
 
         if (treeElement instanceof WebInspector.IssueTreeElement) {
-            WebInspector.showSourceCodeLocation(treeElement.issueMessage.sourceCodeLocation);
+            WebInspector.showSourceCodeLocation(treeElement.issueMessage.sourceCodeLocation, {ignoreNetworkTab: true});
             return;
         }
 
@@ -806,7 +806,7 @@ WebInspector.DebuggerSidebarPanel = class DebuggerSidebarPanel extends WebInspec
 
         let breakpoint = treeElement.breakpoint;
         if (treeElement.treeOutline === this._pauseReasonTreeOutline) {
-            WebInspector.showSourceCodeLocation(breakpoint.sourceCodeLocation);
+            WebInspector.showSourceCodeLocation(breakpoint.sourceCodeLocation, {ignoreNetworkTab: true});
             return;
         }
 
@@ -817,7 +817,7 @@ WebInspector.DebuggerSidebarPanel = class DebuggerSidebarPanel extends WebInspec
         if (!(treeElement.parent.representedObject instanceof WebInspector.SourceCode))
             return;
 
-        WebInspector.showSourceCodeLocation(breakpoint.sourceCodeLocation);
+        WebInspector.showSourceCodeLocation(breakpoint.sourceCodeLocation, {ignoreNetworkTab: true});
     }
 
     _compareTopLevelTreeElements(a, b)
index 50c58f8..e55a943 100644 (file)
@@ -225,6 +225,15 @@ WebInspector.NetworkGridContentView = class NetworkGridContentView extends WebIn
         this.reset();
     }
 
+    hasRepresentedObject(representedObject)
+    {
+        const comparator = (dataGridNode) => dataGridNode.resource === representedObject;
+        const skipHidden = true;
+        const stayWithin = false;
+        const dontPopulate = true;
+        return this._dataGrid.findNode(comparator, skipHidden, stayWithin, dontPopulate);
+    }
+
     // Private
 
     _processPendingRecords()
index b2f0581..cf78a41 100644 (file)
@@ -94,6 +94,11 @@ WebInspector.NetworkSidebarPanel = class NetworkSidebarPanel extends WebInspecto
         return !this.restoringState || !this._restoredShowingNetworkGridContentView;
     }
 
+    hasRepresentedObject(representedObject)
+    {
+        return this._networkGridView.hasRepresentedObject(representedObject);
+    }
+
     // Protected
 
     saveStateToCookie(cookie)
index 0e90a07..d12ccb0 100644 (file)
@@ -56,7 +56,10 @@ WebInspector.NetworkTabContentView = class NetworkTabContentView extends WebInsp
 
     canShowRepresentedObject(representedObject)
     {
-        return representedObject instanceof WebInspector.Resource;
+        if (!(representedObject instanceof WebInspector.Resource))
+            return false;
+
+        return this._navigationSidebarPanel.hasRepresentedObject(representedObject);
     }
 
     get supportsSplitContentBrowser()
index 86688e3..2414d95 100644 (file)
@@ -188,7 +188,7 @@ WebInspector.NetworkTimelineView = class NetworkTimelineView extends WebInspecto
     showContentViewForTreeElement(treeElement)
     {
         if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) {
-            WebInspector.showSourceCode(treeElement.representedObject);
+            WebInspector.showSourceCode(treeElement.representedObject, {ignoreNetworkTab: true});
             return;
         }
 
index 53afa13..e3a61cf 100644 (file)
@@ -228,7 +228,7 @@ WebInspector.ObjectTreeBaseTreeElement = class ObjectTreeBaseTreeElement extends
                             return;
 
                         let sourceCodeLocation = sourceCode.createSourceCodeLocation(location.lineNumber, location.columnNumber || 0);
-                        WebInspector.showSourceCodeLocation(sourceCodeLocation);
+                        WebInspector.showSourceCodeLocation(sourceCodeLocation, {ignoreNetworkTab: true});
                     });
                 });
             }
index 4b93e61..e42c295 100644 (file)
@@ -422,7 +422,7 @@ WebInspector.ResourceSidebarPanel = class ResourceSidebarPanel extends WebInspec
             || treeElement instanceof WebInspector.ResourceTreeElement
             || treeElement instanceof WebInspector.ScriptTreeElement
             || treeElement instanceof WebInspector.ContentFlowTreeElement) {
-            WebInspector.showRepresentedObject(treeElement.representedObject);
+            WebInspector.showRepresentedObject(treeElement.representedObject, null, {ignoreNetworkTab: true});
             return;
         }
 
index a82fabe..e4db013 100644 (file)
@@ -240,7 +240,7 @@ WebInspector.ResourceTimelineDataGridNode = class ResourceTimelineDataGridNode e
 
     _dataGridNodeGoToArrowClicked()
     {
-        WebInspector.showSourceCode(this._resource);
+        WebInspector.showSourceCode(this._resource, {ignoreNetworkTab: true});
     }
 
     _updateStatus(cell)
index 20a77c2..79230dd 100644 (file)
@@ -356,7 +356,7 @@ WebInspector.SearchSidebarPanel = class SearchSidebarPanel extends WebInspector.
             return;
 
         if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) {
-            WebInspector.showRepresentedObject(treeElement.representedObject);
+            WebInspector.showRepresentedObject(treeElement.representedObject, null, {ignoreNetworkTab: true});
             return;
         }
 
@@ -367,7 +367,7 @@ WebInspector.SearchSidebarPanel = class SearchSidebarPanel extends WebInspector.
         if (treeElement.representedObject instanceof WebInspector.DOMSearchMatchObject)
             WebInspector.showMainFrameDOMTree(treeElement.representedObject.domNode);
         else if (treeElement.representedObject instanceof WebInspector.SourceCodeSearchMatchObject)
-            WebInspector.showOriginalOrFormattedSourceCodeTextRange(treeElement.representedObject.sourceCodeTextRange);
+            WebInspector.showOriginalOrFormattedSourceCodeTextRange(treeElement.representedObject.sourceCodeTextRange, {ignoreNetworkTab: true});
     }
 
     _treeElementDoubleClick(event)
@@ -376,10 +376,9 @@ WebInspector.SearchSidebarPanel = class SearchSidebarPanel extends WebInspector.
         if (!treeElement)
             return;
 
-        const options = {ignoreSearchTab: true};
         if (treeElement.representedObject instanceof WebInspector.DOMSearchMatchObject)
-            WebInspector.showMainFrameDOMTree(treeElement.representedObject.domNode, options);
+            WebInspector.showMainFrameDOMTree(treeElement.representedObject.domNode, {ignoreSearchTab: true});
         else if (treeElement.representedObject instanceof WebInspector.SourceCodeSearchMatchObject)
-            WebInspector.showOriginalOrFormattedSourceCodeTextRange(treeElement.representedObject.sourceCodeTextRange, options);
+            WebInspector.showOriginalOrFormattedSourceCodeTextRange(treeElement.representedObject.sourceCodeTextRange, {ignoreNetworkTab: true, ignoreSearchTab: true});
     }
 };
index 215bfbc..523b928 100644 (file)
@@ -1669,9 +1669,9 @@ WebInspector.SourceCodeTextEditor = class SourceCodeTextEditor extends WebInspec
 
         var sourceCodeLocation = this._sourceCodeLocationForEditorPosition(this.tokenTrackingController.candidate.hoveredTokenRange.start);
         if (this.sourceCode instanceof WebInspector.SourceMapResource)
-            WebInspector.showOriginalOrFormattedSourceCodeLocation(sourceCodeLocation);
+            WebInspector.showOriginalOrFormattedSourceCodeLocation(sourceCodeLocation, {ignoreNetworkTab: true});
         else
-            WebInspector.showSourceCodeLocation(sourceCodeLocation);
+            WebInspector.showSourceCodeLocation(sourceCodeLocation, {ignoreNetworkTab: true});
     }
 
     tokenTrackingControllerNewHighlightCandidate(tokenTrackingController, candidate)
index de87236..7fe7a2a 100644 (file)
@@ -115,6 +115,9 @@ WebInspector.TabBrowser = class TabBrowser extends WebInspector.View
             if (options.ignoreSearchTab && tabContentView instanceof WebInspector.SearchTabContentView)
                 continue;
 
+            if (options.ignoreNetworkTab && tabContentView instanceof WebInspector.NetworkTabContentView)
+                continue;
+
             if (tabContentView.canShowRepresentedObject(representedObject))
                 return tabContentView;
         }
index 01f1125..84edeea 100644 (file)
@@ -525,7 +525,7 @@ WebInspector.TimelineDataGrid = class TimelineDataGrid extends WebInspector.Data
         if (!callFrame.sourceCodeLocation)
             return;
 
-        WebInspector.showSourceCodeLocation(callFrame.sourceCodeLocation);
+        WebInspector.showSourceCodeLocation(callFrame.sourceCodeLocation, {ignoreNetworkTab: true});
     }
 };
 
index 807c3a1..2fe970a 100644 (file)
@@ -138,9 +138,9 @@ WebInspector.VisualStyleSelectorTreeItem = class VisualStyleSelectorTreeItem ext
 
         contextMenu.appendItem(WebInspector.UIString("Show Source"), () => {
             if (event.metaKey)
-                WebInspector.showOriginalUnformattedSourceCodeLocation(this.representedObject.ownerRule.sourceCodeLocation);
+                WebInspector.showOriginalUnformattedSourceCodeLocation(this.representedObject.ownerRule.sourceCodeLocation, {ignoreNetworkTab: true});
             else
-                WebInspector.showSourceCodeLocation(this.representedObject.ownerRule.sourceCodeLocation);
+                WebInspector.showSourceCodeLocation(this.representedObject.ownerRule.sourceCodeLocation, {ignoreNetworkTab: true});
         });
 
         // Only used one colon temporarily since single-colon pseudo elements are valid CSS.