Web Inspector: Don't show the Search tab if it's open and matches the representedObject
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Apr 2017 20:05:32 +0000 (20:05 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Apr 2017 20:05:32 +0000 (20:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=168709

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2017-04-21
Reviewed by Brian Burg.

* UserInterface/Base/Main.js:
(WebInspector.handlePossibleLinkClick):
(WebInspector.openURL):
(WebInspector.showSourceCode):
(WebInspector.showOriginalUnformattedSourceCodeLocation):
(WebInspector.showOriginalOrFormattedSourceCodeLocation):
(WebInspector.showOriginalOrFormattedSourceCodeTextRange):
(WebInspector._frameWasAdded):
(WebInspector.createSourceCodeLocationLink):
(WebInspector.linkifyLocation):
(WebInspector.linkifyElement):
Add `options` parameter to provide greater customization.  Also fix some style issues.

* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView.prototype.hasRepresentedObject): Deleted.
* UserInterface/Views/NetworkSidebarPanel.js:
(WebInspector.NetworkSidebarPanel.prototype.hasRepresentedObject): Deleted.
* UserInterface/Views/NetworkTabContentView.js:
(WebInspector.NetworkTabContentView.prototype.canShowRepresentedObject):
* UserInterface/Views/SearchTabContentView.js:
(WebInspector.SearchTabContentView.prototype.canShowRepresentedObject):
Ensure that the Search tab can only display resources that it has entries for in its view.
Also rework the way in which this is determined.

* UserInterface/Controllers/BreakpointPopoverController.js:
(WebInspector.BreakpointPopoverController.prototype.appendContextMenuItems):
* UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.showMainResourceForFrame):
* UserInterface/Views/CSSStyleDeclarationSection.js:
(WebInspector.CSSStyleDeclarationSection.prototype.refresh):
* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
(WebInspector.CSSStyleDeclarationTextEditor.tokenTrackingControllerHighlightedRangeWasClicked.showRangeInSourceCode):
(WebInspector.CSSStyleDeclarationTextEditor.tokenTrackingControllerHighlightedRangeWasClicked):
* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WebInspector.ComputedStyleDetailsPanel.prototype.cssStyleDeclarationTextEditorShowProperty):
* UserInterface/Views/ConsoleMessageView.js:
(WebInspector.ConsoleMessageView.prototype._linkifyLocation):
* UserInterface/Views/DOMDetailsSidebarPanel.js:
(WebInspector.DOMDetailsSidebarPanel.prototype._mouseWasClicked):
* UserInterface/Views/DOMTreeContentView.js:
(WebInspector.DOMTreeContentView.prototype._mouseWasClicked.followLink):
* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement.prototype._showCustomElementDefinition):
* UserInterface/Views/DebuggerDashboardView.js:
(WebInspector.DebuggerDashboardView.prototype._rebuildLocation):
* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype._treeSelectionDidChange):
(WebInspector.DebuggerSidebarPanel.prototype._updatePauseReasonGotoArrow):
* UserInterface/Views/ErrorObjectView.js:
(WebInspector.ErrorObjectView.makeSourceLinkWithPrefix):
* UserInterface/Views/EventListenerSectionGroup.js:
(WebInspector.EventListenerSectionGroup.prototype._functionTextOrLink):
* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populatePreview):
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPathRow):
* UserInterface/Views/ObjectTreeBaseTreeElement.js:
(WebInspector.ObjectTreeBaseTreeElement.prototype._appendMenusItemsForObject):
(WebInspector.ObjectTreeBaseTreeElement):
* UserInterface/Views/ProbeSetDetailsSection.js:
(WebInspector.ProbeSetDetailsSection.prototype._updateLinkElement):
* UserInterface/Views/ProfileDataGridNode.js:
(WebInspector.ProfileDataGridNode.prototype._displayContent):
* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WebInspector.ResourceDetailsSidebarPanel.prototype._refreshRelatedResourcesSection):
(WebInspector.ResourceDetailsSidebarPanel.prototype._goToRequestDataClicked):
* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel.prototype._treeSelectionDidChange):
* UserInterface/Views/ResourceTimelineDataGridNode.js:
(WebInspector.ResourceTimelineDataGridNode.prototype._dataGridNodeGoToArrowClicked):
* UserInterface/Views/RulesStyleDetailsPanel.js:
(WebInspector.RulesStyleDetailsPanel.prototype.refresh.insertMediaOrInheritanceLabel):
* UserInterface/Views/SearchSidebarPanel.js:
(WebInspector.SearchSidebarPanel.prototype._treeElementDoubleClick):
* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype.tokenTrackingControllerHighlightedRangeWasClicked):
* UserInterface/Views/SourceCodeTimelineTimelineDataGridNode.js:
(WebInspector.SourceCodeTimelineTimelineDataGridNode.prototype._createNameCellContent):
* UserInterface/Views/TimelineDataGrid.js:
(WebInspector.TimelineDataGrid.prototype._popoverCallStackTreeSelectionDidChange):
* UserInterface/Views/TimelineDataGridNode.js:
(WebInspector.TimelineDataGridNode.prototype.createCellContent):
* UserInterface/Views/VisualStyleSelectorTreeItem.js:
(WebInspector.VisualStyleSelectorTreeItem.prototype.populateContextMenu):
Ensure that the Search tab is never shown from links generated by these functions.
Also do the same for the Network tab in some cases.

* UserInterface/Views/NetworkTimelineView.js:
(WebInspector.NetworkTimelineView.prototype.canShowContentViewForTreeElement): Deleted.
(WebInspector.NetworkTimelineView.prototype.showContentViewForTreeElement): Deleted.
Drive-by cleanup: remove dead code.

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

34 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/CSSStyleDeclarationSection.js
Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js
Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.js
Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js
Source/WebInspectorUI/UserInterface/Views/DOMDetailsSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js
Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js
Source/WebInspectorUI/UserInterface/Views/DebuggerDashboardView.js
Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/ErrorObjectView.js
Source/WebInspectorUI/UserInterface/Views/EventListenerSectionGroup.js
Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.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/ProbeSetDetailsSection.js
Source/WebInspectorUI/UserInterface/Views/ProfileDataGridNode.js
Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNode.js
Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js
Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/SearchTabContentView.js
Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js
Source/WebInspectorUI/UserInterface/Views/SourceCodeTimelineTimelineDataGridNode.js
Source/WebInspectorUI/UserInterface/Views/TimelineDataGrid.js
Source/WebInspectorUI/UserInterface/Views/TimelineDataGridNode.js
Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorTreeItem.js

index 0031838..9faa957 100644 (file)
@@ -1,3 +1,101 @@
+2017-04-21  Devin Rousso  <dcrousso+webkit@gmail.com>
+
+        Web Inspector: Don't show the Search tab if it's open and matches the representedObject
+        https://bugs.webkit.org/show_bug.cgi?id=168709
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Base/Main.js:
+        (WebInspector.handlePossibleLinkClick):
+        (WebInspector.openURL):
+        (WebInspector.showSourceCode):
+        (WebInspector.showOriginalUnformattedSourceCodeLocation):
+        (WebInspector.showOriginalOrFormattedSourceCodeLocation):
+        (WebInspector.showOriginalOrFormattedSourceCodeTextRange):
+        (WebInspector._frameWasAdded):
+        (WebInspector.createSourceCodeLocationLink):
+        (WebInspector.linkifyLocation):
+        (WebInspector.linkifyElement):
+        Add `options` parameter to provide greater customization.  Also fix some style issues.
+
+        * UserInterface/Views/NetworkGridContentView.js:
+        (WebInspector.NetworkGridContentView.prototype.hasRepresentedObject): Deleted.
+        * UserInterface/Views/NetworkSidebarPanel.js:
+        (WebInspector.NetworkSidebarPanel.prototype.hasRepresentedObject): Deleted.
+        * UserInterface/Views/NetworkTabContentView.js:
+        (WebInspector.NetworkTabContentView.prototype.canShowRepresentedObject):
+        * UserInterface/Views/SearchTabContentView.js:
+        (WebInspector.SearchTabContentView.prototype.canShowRepresentedObject):
+        Ensure that the Search tab can only display resources that it has entries for in its view.
+        Also rework the way in which this is determined.
+
+        * UserInterface/Controllers/BreakpointPopoverController.js:
+        (WebInspector.BreakpointPopoverController.prototype.appendContextMenuItems):
+        * UserInterface/Protocol/InspectorFrontendAPI.js:
+        (InspectorFrontendAPI.showMainResourceForFrame):
+        * UserInterface/Views/CSSStyleDeclarationSection.js:
+        (WebInspector.CSSStyleDeclarationSection.prototype.refresh):
+        * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
+        (WebInspector.CSSStyleDeclarationTextEditor.tokenTrackingControllerHighlightedRangeWasClicked.showRangeInSourceCode):
+        (WebInspector.CSSStyleDeclarationTextEditor.tokenTrackingControllerHighlightedRangeWasClicked):
+        * UserInterface/Views/ComputedStyleDetailsPanel.js:
+        (WebInspector.ComputedStyleDetailsPanel.prototype.cssStyleDeclarationTextEditorShowProperty):
+        * UserInterface/Views/ConsoleMessageView.js:
+        (WebInspector.ConsoleMessageView.prototype._linkifyLocation):
+        * UserInterface/Views/DOMDetailsSidebarPanel.js:
+        (WebInspector.DOMDetailsSidebarPanel.prototype._mouseWasClicked):
+        * UserInterface/Views/DOMTreeContentView.js:
+        (WebInspector.DOMTreeContentView.prototype._mouseWasClicked.followLink):
+        * UserInterface/Views/DOMTreeElement.js:
+        (WebInspector.DOMTreeElement.prototype._showCustomElementDefinition):
+        * UserInterface/Views/DebuggerDashboardView.js:
+        (WebInspector.DebuggerDashboardView.prototype._rebuildLocation):
+        * UserInterface/Views/DebuggerSidebarPanel.js:
+        (WebInspector.DebuggerSidebarPanel.prototype._treeSelectionDidChange):
+        (WebInspector.DebuggerSidebarPanel.prototype._updatePauseReasonGotoArrow):
+        * UserInterface/Views/ErrorObjectView.js:
+        (WebInspector.ErrorObjectView.makeSourceLinkWithPrefix):
+        * UserInterface/Views/EventListenerSectionGroup.js:
+        (WebInspector.EventListenerSectionGroup.prototype._functionTextOrLink):
+        * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
+        (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populatePreview):
+        (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPathRow):
+        * UserInterface/Views/ObjectTreeBaseTreeElement.js:
+        (WebInspector.ObjectTreeBaseTreeElement.prototype._appendMenusItemsForObject):
+        (WebInspector.ObjectTreeBaseTreeElement):
+        * UserInterface/Views/ProbeSetDetailsSection.js:
+        (WebInspector.ProbeSetDetailsSection.prototype._updateLinkElement):
+        * UserInterface/Views/ProfileDataGridNode.js:
+        (WebInspector.ProfileDataGridNode.prototype._displayContent):
+        * UserInterface/Views/ResourceDetailsSidebarPanel.js:
+        (WebInspector.ResourceDetailsSidebarPanel.prototype._refreshRelatedResourcesSection):
+        (WebInspector.ResourceDetailsSidebarPanel.prototype._goToRequestDataClicked):
+        * UserInterface/Views/ResourceSidebarPanel.js:
+        (WebInspector.ResourceSidebarPanel.prototype._treeSelectionDidChange):
+        * UserInterface/Views/ResourceTimelineDataGridNode.js:
+        (WebInspector.ResourceTimelineDataGridNode.prototype._dataGridNodeGoToArrowClicked):
+        * UserInterface/Views/RulesStyleDetailsPanel.js:
+        (WebInspector.RulesStyleDetailsPanel.prototype.refresh.insertMediaOrInheritanceLabel):
+        * UserInterface/Views/SearchSidebarPanel.js:
+        (WebInspector.SearchSidebarPanel.prototype._treeElementDoubleClick):
+        * UserInterface/Views/SourceCodeTextEditor.js:
+        (WebInspector.SourceCodeTextEditor.prototype.tokenTrackingControllerHighlightedRangeWasClicked):
+        * UserInterface/Views/SourceCodeTimelineTimelineDataGridNode.js:
+        (WebInspector.SourceCodeTimelineTimelineDataGridNode.prototype._createNameCellContent):
+        * UserInterface/Views/TimelineDataGrid.js:
+        (WebInspector.TimelineDataGrid.prototype._popoverCallStackTreeSelectionDidChange):
+        * UserInterface/Views/TimelineDataGridNode.js:
+        (WebInspector.TimelineDataGridNode.prototype.createCellContent):
+        * UserInterface/Views/VisualStyleSelectorTreeItem.js:
+        (WebInspector.VisualStyleSelectorTreeItem.prototype.populateContextMenu):
+        Ensure that the Search tab is never shown from links generated by these functions.
+        Also do the same for the Network tab in some cases.
+
+        * UserInterface/Views/NetworkTimelineView.js:
+        (WebInspector.NetworkTimelineView.prototype.canShowContentViewForTreeElement): Deleted.
+        (WebInspector.NetworkTimelineView.prototype.showContentViewForTreeElement): Deleted.
+        Drive-by cleanup: remove dead code.
+
 2017-04-20  Matt Baker  <mattbaker@apple.com>
 
         Web Inspector: Add regular expression support to XHR breakpoints
index 6da96cc..b873b6d 100644 (file)
@@ -803,7 +803,7 @@ WebInspector.updateVisibilityState = function(visible)
     this.notifications.dispatchEventToListeners(WebInspector.Notification.VisibilityStateDidChange);
 };
 
-WebInspector.handlePossibleLinkClick = function(event, frame, alwaysOpenExternally)
+WebInspector.handlePossibleLinkClick = function(event, frame, options = {})
 {
     var anchorElement = event.target.enclosingNodeOrSelfWithNodeName("a");
     if (!anchorElement || !anchorElement.href)
@@ -818,7 +818,7 @@ WebInspector.handlePossibleLinkClick = function(event, frame, alwaysOpenExternal
     event.preventDefault();
     event.stopPropagation();
 
-    this.openURL(anchorElement.href, frame, {lineNumber: anchorElement.lineNumber});
+    this.openURL(anchorElement.href, frame, Object.shallowMerge(options, {lineNumber: anchorElement.lineNumber}));
 
     return true;
 };
@@ -1214,7 +1214,7 @@ WebInspector.showSourceCode = function(sourceCode, options = {})
 WebInspector.showSourceCodeLocation = function(sourceCodeLocation, options = {})
 {
     this.showSourceCode(sourceCodeLocation.displaySourceCode, Object.shallowMerge(options, {
-        positionToReveal: sourceCodeLocation.displayPosition()
+        positionToReveal: sourceCodeLocation.displayPosition(),
     }));
 };
 
@@ -1222,14 +1222,14 @@ WebInspector.showOriginalUnformattedSourceCodeLocation = function(sourceCodeLoca
 {
     this.showSourceCode(sourceCodeLocation.sourceCode, Object.shallowMerge(options, {
         positionToReveal: sourceCodeLocation.position(),
-        forceUnformatted: true
+        forceUnformatted: true,
     }));
 };
 
 WebInspector.showOriginalOrFormattedSourceCodeLocation = function(sourceCodeLocation, options = {})
 {
     this.showSourceCode(sourceCodeLocation.sourceCode, Object.shallowMerge(options, {
-        positionToReveal: sourceCodeLocation.formattedPosition()
+        positionToReveal: sourceCodeLocation.formattedPosition(),
     }));
 };
 
@@ -1238,7 +1238,7 @@ WebInspector.showOriginalOrFormattedSourceCodeTextRange = function(sourceCodeTex
     var textRangeToSelect = sourceCodeTextRange.formattedTextRange;
     this.showSourceCode(sourceCodeTextRange.sourceCode, Object.shallowMerge(options, {
         positionToReveal: textRangeToSelect.startPosition(),
-        textRangeToSelect
+        textRangeToSelect,
     }));
 };
 
@@ -1393,7 +1393,11 @@ WebInspector._frameWasAdded = function(event)
 
     function delayedWork()
     {
-        this.showSourceCodeForFrame(frame.id);
+        const options = {
+            ignoreNetworkTab: true,
+            ignoreSearchTab: true,
+        };
+        this.showSourceCodeForFrame(frame.id, options);
     }
 
     // Delay showing the frame since FrameWasAdded is called before MainFrameChanged.
@@ -2294,7 +2298,7 @@ WebInspector.createGoToArrowButton = function()
     return button;
 };
 
-WebInspector.createSourceCodeLocationLink = function(sourceCodeLocation, dontFloat, useGoToArrowButton)
+WebInspector.createSourceCodeLocationLink = function(sourceCodeLocation, options = {})
 {
     console.assert(sourceCodeLocation);
     if (!sourceCodeLocation)
@@ -2302,42 +2306,42 @@ WebInspector.createSourceCodeLocationLink = function(sourceCodeLocation, dontFlo
 
     var linkElement = document.createElement("a");
     linkElement.className = "go-to-link";
-    WebInspector.linkifyElement(linkElement, sourceCodeLocation);
+    WebInspector.linkifyElement(linkElement, sourceCodeLocation, options);
     sourceCodeLocation.populateLiveDisplayLocationTooltip(linkElement);
 
-    if (useGoToArrowButton)
+    if (options.useGoToArrowButton)
         linkElement.appendChild(WebInspector.createGoToArrowButton());
     else
         sourceCodeLocation.populateLiveDisplayLocationString(linkElement, "textContent");
 
-    if (dontFloat)
+    if (options.dontFloat)
         linkElement.classList.add("dont-float");
 
     return linkElement;
 };
 
-WebInspector.linkifyLocation = function(url, lineNumber, columnNumber, className)
+WebInspector.linkifyLocation = function(url, sourceCodePosition, options = {})
 {
     var sourceCode = WebInspector.sourceCodeForURL(url);
 
     if (!sourceCode) {
         var anchor = document.createElement("a");
         anchor.href = url;
-        anchor.lineNumber = lineNumber;
-        if (className)
-            anchor.className = className;
-        anchor.append(WebInspector.displayNameForURL(url) + ":" + lineNumber);
+        anchor.lineNumber = sourceCodePosition.lineNumber;
+        if (options.className)
+            anchor.className = options.className;
+        anchor.append(WebInspector.displayNameForURL(url) + ":" + sourceCodePosition.lineNumber);
         return anchor;
     }
 
-    var sourceCodeLocation = sourceCode.createSourceCodeLocation(lineNumber, columnNumber);
-    var linkElement = WebInspector.createSourceCodeLocationLink(sourceCodeLocation, true);
-    if (className)
-        linkElement.classList.add(className);
+    let sourceCodeLocation = sourceCode.createSourceCodeLocation(sourceCodePosition.lineNumber, sourceCodePosition.columnNumber);
+    let linkElement = WebInspector.createSourceCodeLocationLink(sourceCodeLocation, Object.shallowMerge(options, {dontFloat: true}));
+    if (options.className)
+        linkElement.classList.add(options.className);
     return linkElement;
 };
 
-WebInspector.linkifyElement = function(linkElement, sourceCodeLocation) {
+WebInspector.linkifyElement = function(linkElement, sourceCodeLocation, options = {}) {
     console.assert(sourceCodeLocation);
 
     function showSourceCodeLocation(event)
@@ -2346,9 +2350,9 @@ WebInspector.linkifyElement = function(linkElement, sourceCodeLocation) {
         event.preventDefault();
 
         if (event.metaKey)
-            this.showOriginalUnformattedSourceCodeLocation(sourceCodeLocation);
+            this.showOriginalUnformattedSourceCodeLocation(sourceCodeLocation, options);
         else
-            this.showSourceCodeLocation(sourceCodeLocation);
+            this.showSourceCodeLocation(sourceCodeLocation, options);
     }
 
     linkElement.addEventListener("click", showSourceCodeLocation.bind(this));
index 4aa7c77..96c3e15 100644 (file)
@@ -67,7 +67,11 @@ WebInspector.BreakpointPopoverController = class BreakpointPopoverController ext
         };
 
         const revealOriginalSourceCodeLocation = () => {
-            WebInspector.showOriginalOrFormattedSourceCodeLocation(breakpoint.sourceCodeLocation, {ignoreNetworkTab: true});
+            const options = {
+                ignoreNetworkTab: true,
+                ignoreSearchTab: true,
+            };
+            WebInspector.showOriginalOrFormattedSourceCodeLocation(breakpoint.sourceCodeLocation, options);
         };
 
         if (WebInspector.debuggerManager.isBreakpointEditable(breakpoint))
index 13b50d7..1bdcf17 100644 (file)
@@ -109,7 +109,11 @@ InspectorFrontendAPI = {
 
     showMainResourceForFrame: function(frameIdentifier)
     {
-        WebInspector.showSourceCodeForFrame(frameIdentifier, {ignoreNetworkTab: true});
+        const options = {
+            ignoreNetworkTab: true,
+            ignoreSearchTab: true,
+        };
+        WebInspector.showSourceCodeForFrame(frameIdentifier, options);
     },
 
     contextMenuItemSelected: function(id)
index 673de3c..ffa12ea 100644 (file)
@@ -247,7 +247,12 @@ WebInspector.CSSStyleDeclarationSection = class CSSStyleDeclarationSection exten
                 appendSelectorTextKnownToMatch.call(this, this._style.ownerRule.selectorText);
 
             if (this._style.ownerRule.sourceCodeLocation) {
-                let sourceCodeLink = WebInspector.createSourceCodeLocationLink(this._style.ownerRule.sourceCodeLocation, true);
+                const options = {
+                    dontFloat: true,
+                    ignoreNetworkTab: true,
+                    ignoreSearchTab: true,
+                };
+                let sourceCodeLink = WebInspector.createSourceCodeLocationLink(this._style.ownerRule.sourceCodeLocation, options);
                 this._originElement.appendChild(sourceCodeLink);
             } else {
                 let originString;
index 32e8290..d0e61ec 100644 (file)
@@ -1705,11 +1705,16 @@ WebInspector.CSSStyleDeclarationTextEditor = class CSSStyleDeclarationTextEditor
 
         let token = candidate.hoveredToken;
 
+        const options = {
+            ignoreNetworkTab: true,
+            ignoreSearchTab: true,
+        };
+
         // Special case option-clicking url(...) links.
         if (token && /\blink\b/.test(token.type)) {
             let url = token.string;
             let baseURL = sourceCodeLocation ? sourceCodeLocation.sourceCode.url : this._style.node.ownerDocument.documentURL;
-            WebInspector.openURL(absoluteURL(url, baseURL));
+            WebInspector.openURL(absoluteURL(url, baseURL), options);
             return;
         }
 
@@ -1726,7 +1731,7 @@ WebInspector.CSSStyleDeclarationTextEditor = class CSSStyleDeclarationTextEditor
             if (!sourceCode || !range)
                 return false;
 
-            WebInspector.showSourceCodeLocation(sourceCode.createSourceCodeLocation(range.startLine, range.startColumn), {ignoreNetworkTab: true});
+            WebInspector.showSourceCodeLocation(sourceCode.createSourceCodeLocation(range.startLine, range.startColumn), options);
             return true;
         }
 
index b83cc59..3c9bb1a 100644 (file)
@@ -102,8 +102,12 @@ WebInspector.ComputedStyleDetailsPanel = class ComputedStyleDetailsPanel extends
 
         let sourceCode = ownerRule.sourceCodeLocation.sourceCode;
         let {startLine, startColumn} = effectiveProperty.styleSheetTextRange;
-        let sourceCodeLocation = sourceCode.createSourceCodeLocation(startLine, startColumn);
-        WebInspector.showSourceCodeLocation(sourceCodeLocation, {ignoreNetworkTab: true});
+
+        const options = {
+            ignoreNetworkTab: true,
+            ignoreSearchTab: true,
+        };
+        WebInspector.showSourceCodeLocation(sourceCode.createSourceCodeLocation(startLine, startColumn), options);
     }
 
     refresh(significantChange)
index de844fc..24a32f3 100644 (file)
@@ -702,7 +702,12 @@ WebInspector.ConsoleMessageView = class ConsoleMessageView extends WebInspector.
 
     _linkifyLocation(url, lineNumber, columnNumber)
     {
-        return WebInspector.linkifyLocation(url, lineNumber, columnNumber, "console-message-url");
+        const options = {
+            className: "console-message-url",
+            ignoreNetworkTab: true,
+            ignoreSearchTab: true,
+        };
+        return WebInspector.linkifyLocation(url, new WebInspector.SourceCodePosition(lineNumber, columnNumber), options);
     }
 
     _userProvidedColumnNames(columnNamesArgument)
index 32e6383..8c641c3 100644 (file)
@@ -107,6 +107,10 @@ WebInspector.DOMDetailsSidebarPanel = class DOMDetailsSidebarPanel extends WebIn
                 var parentFrame = mainResource.parentFrame;
         }
 
-        WebInspector.handlePossibleLinkClick(event, parentFrame);
+        const options = {
+            ignoreNetworkTab: true,
+            ignoreSearchTab: true,
+        };
+        WebInspector.handlePossibleLinkClick(event, parentFrame, options);
     }
 };
index 6ff6cdf..fc84e1d 100644 (file)
@@ -486,8 +486,13 @@ WebInspector.DOMTreeContentView = class DOMTreeContentView extends WebInspector.
             // Since followLink is delayed, the call to WebInspector.openURL can't look at window.event
             // 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, lineNumber: anchorElement.lineNumber});
+            const options = {
+                alwaysOpenExternally: event ? event.metaKey : false,
+                lineNumber: anchorElement.lineNumber,
+                ignoreNetworkTab: true,
+                ignoreSearchTab: true,
+            };
+            WebInspector.openURL(anchorElement.href, this._frame, options);
         }
 
         // Start a timeout since this is a single click, if the timeout is canceled before it fires,
index 2bc1edc..01ce34b 100644 (file)
@@ -720,7 +720,12 @@ WebInspector.DOMTreeElement = class DOMTreeElement extends WebInspector.TreeElem
                 if (WebInspector.frameResourceManager.resourceForURL(url)) {
                     contextMenu.appendItem(WebInspector.UIString("Reveal in Resources Tab"), () => {
                         let frame = WebInspector.frameResourceManager.frameForIdentifier(node.frameIdentifier);
-                        WebInspector.openURL(url, frame, {ignoreNetworkTab: true});
+
+                        const options = {
+                            ignoreNetworkTab: true,
+                            ignoreSearchTab: true,
+                        };
+                        WebInspector.openURL(url, frame, options);
                     });
                 }
 
@@ -1586,7 +1591,12 @@ WebInspector.DOMTreeElement = class DOMTreeElement extends WebInspector.TreeElem
                         return;
 
                     let sourceCodeLocation = sourceCode.createSourceCodeLocation(location.lineNumber, location.columnNumber || 0);
-                    WebInspector.showSourceCodeLocation(sourceCodeLocation, {ignoreNetworkTab: true});
+
+                    const options = {
+                        ignoreNetworkTab: true,
+                        ignoreSearchTab: true,
+                    };
+                    WebInspector.showSourceCodeLocation(sourceCodeLocation, options);
                 });
                 result.release();
             });
index 90b9b52..1d7652c 100644 (file)
@@ -88,9 +88,12 @@ WebInspector.DebuggerDashboardView = class DebuggerDashboardView extends WebInsp
         nameElement.classList.add("function-name");
         this._locationElement.appendChild(nameElement);
 
-        var sourceCodeLocation = WebInspector.debuggerManager.activeCallFrame.sourceCodeLocation;
-        var shouldPreventLinkFloat = true;
-        var linkElement = WebInspector.createSourceCodeLocationLink(sourceCodeLocation, shouldPreventLinkFloat);
+        const options = {
+            dontFloat: true,
+            ignoreNetworkTab: true,
+            ignoreSearchTab: true,
+        };
+        let linkElement = WebInspector.createSourceCodeLocationLink(WebInspector.debuggerManager.activeCallFrame.sourceCodeLocation, options);
         this._locationElement.appendChild(linkElement);
     }
 
index 3f0d20c..0c55d8c 100644 (file)
@@ -825,8 +825,13 @@ WebInspector.DebuggerSidebarPanel = class DebuggerSidebarPanel extends WebInspec
         if (!treeElement)
             return;
 
+        const options = {
+            ignoreNetworkTab: true,
+            ignoreSearchTab: true,
+        };
+
         if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) {
-            WebInspector.showSourceCode(treeElement.representedObject, {ignoreNetworkTab: true});
+            WebInspector.showSourceCode(treeElement.representedObject, options);
             return;
         }
 
@@ -836,12 +841,13 @@ WebInspector.DebuggerSidebarPanel = class DebuggerSidebarPanel extends WebInspec
                 WebInspector.debuggerManager.activeCallFrame = callFrame;
 
             if (callFrame.sourceCodeLocation)
-                WebInspector.showSourceCodeLocation(callFrame.sourceCodeLocation, {ignoreNetworkTab: true});
+                WebInspector.showSourceCodeLocation(callFrame.sourceCodeLocation, options);
+
             return;
         }
 
         if (treeElement instanceof WebInspector.IssueTreeElement) {
-            WebInspector.showSourceCodeLocation(treeElement.issueMessage.sourceCodeLocation, {ignoreNetworkTab: true});
+            WebInspector.showSourceCodeLocation(treeElement.issueMessage.sourceCodeLocation, options);
             return;
         }
 
@@ -850,7 +856,7 @@ WebInspector.DebuggerSidebarPanel = class DebuggerSidebarPanel extends WebInspec
 
         let breakpoint = treeElement.breakpoint;
         if (treeElement.treeOutline === this._pauseReasonTreeOutline) {
-            WebInspector.showSourceCodeLocation(breakpoint.sourceCodeLocation, {ignoreNetworkTab: true});
+            WebInspector.showSourceCodeLocation(breakpoint.sourceCodeLocation, options);
             return;
         }
 
@@ -861,7 +867,7 @@ WebInspector.DebuggerSidebarPanel = class DebuggerSidebarPanel extends WebInspec
         if (!(treeElement.parent.representedObject instanceof WebInspector.SourceCode))
             return;
 
-        WebInspector.showSourceCodeLocation(breakpoint.sourceCodeLocation, {ignoreNetworkTab: true});
+        WebInspector.showSourceCodeLocation(breakpoint.sourceCodeLocation, options);
     }
 
     _compareTopLevelTreeElements(a, b)
@@ -1079,7 +1085,12 @@ WebInspector.DebuggerSidebarPanel = class DebuggerSidebarPanel extends WebInspec
         if (!sourceCodeLocation)
             return;
 
-        var linkElement = WebInspector.createSourceCodeLocationLink(sourceCodeLocation, false, true);
+        const options = {
+            useGoToArrowButton: true,
+            ignoreNetworkTab: true,
+            ignoreSearchTab: true,
+        };
+        let linkElement = WebInspector.createSourceCodeLocationLink(sourceCodeLocation, options);
         this._pauseReasonLinkContainerElement.appendChild(linkElement);
     }
 
index 6dbf9df..edd59e8 100644 (file)
@@ -57,7 +57,11 @@ WebInspector.ErrorObjectView = class ErrorObjectView extends WebInspector.Object
         span.classList.add("error-object-link-container");
         span.textContent = " — ";
 
-        var a = WebInspector.linkifyLocation(sourceURL, parseInt(lineNumber) - 1, parseInt(columnNumber));
+        const options = {
+            ignoreNetworkTab: true,
+            ignoreSearchTab: true,
+        };
+        let a = WebInspector.linkifyLocation(sourceURL, new WebInspector.SourceCodePosition(parseInt(lineNumber) - 1, parseInt(columnNumber)), options);
         a.classList.add("error-object-link");
         span.appendChild(a);
 
index 1bc76ce..bf48719 100644 (file)
@@ -89,7 +89,14 @@ WebInspector.EventListenerSectionGroup = class EventListenerSectionGroup extends
             return functionName;
 
         var sourceCodeLocation = sourceCode.createSourceCodeLocation(this._eventListener.location.lineNumber, this._eventListener.location.columnNumber || 0);
-        var linkElement = WebInspector.createSourceCodeLocationLink(sourceCodeLocation, anonymous);
+
+        const options = {
+            dontFloat: anonymous,
+            ignoreNetworkTab: true,
+            ignoreSearchTab: true,
+        };
+        let linkElement = WebInspector.createSourceCodeLocationLink(sourceCodeLocation, options);
+
         if (anonymous)
             return linkElement;
 
index 4c3378b..fc4229b 100644 (file)
@@ -312,9 +312,13 @@ WebInspector.HeapSnapshotInstanceDataGridNode = class HeapSnapshotInstanceDataGr
                     let sourceCodeLocation = sourceCode.createSourceCodeLocation(location.lineNumber, location.columnNumber);
                     sourceCodeLocation.populateLiveDisplayLocationString(locationElement, "textContent", WebInspector.SourceCodeLocation.ColumnStyle.Hidden, WebInspector.SourceCodeLocation.NameStyle.Short);
 
-                    const dontFloat = true;
-                    const useGoToArrowButton = true;
-                    let goToArrowButtonLink = WebInspector.createSourceCodeLocationLink(sourceCodeLocation, dontFloat, useGoToArrowButton);
+                    const options = {
+                        dontFloat: true,
+                        useGoToArrowButton: true,
+                        ignoreNetworkTab: true,
+                        ignoreSearchTab: true,
+                    };
+                    let goToArrowButtonLink = WebInspector.createSourceCodeLocationLink(sourceCodeLocation, options);
                     containerElement.appendChild(goToArrowButtonLink);
                 }
                 return;
@@ -426,10 +430,15 @@ WebInspector.HeapSnapshotInstanceDataGridNode = class HeapSnapshotInstanceDataGr
                         let location = functionDetails.location;
                         let sourceCode = WebInspector.debuggerManager.scriptForIdentifier(location.scriptId, WebInspector.assumingMainTarget());
                         if (sourceCode) {
-                            const dontFloat = true;
-                            const useGoToArrowButton = true;
                             let sourceCodeLocation = sourceCode.createSourceCodeLocation(location.lineNumber, location.columnNumber);
-                            let goToArrowButtonLink = WebInspector.createSourceCodeLocationLink(sourceCodeLocation, dontFloat, useGoToArrowButton);
+
+                            const options = {
+                                dontFloat: true,
+                                useGoToArrowButton: true,
+                                ignoreNetworkTab: true,
+                                ignoreSearchTab: true,
+                            };
+                            let goToArrowButtonLink = WebInspector.createSourceCodeLocationLink(sourceCodeLocation, options);
                             containerElement.replaceChild(goToArrowButtonLink, goToArrowPlaceHolderElement);
                         }
                     }
index 3d65ff1..5323641 100644 (file)
@@ -267,15 +267,6 @@ 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
 
     _resourceCachingDisabledSettingChanged()
index f33294b..d4f5eb2 100644 (file)
@@ -94,11 +94,6 @@ WebInspector.NetworkSidebarPanel = class NetworkSidebarPanel extends WebInspecto
         return !this.restoringState || !this._restoredShowingNetworkGridContentView;
     }
 
-    hasRepresentedObject(representedObject)
-    {
-        return this._networkGridView.hasRepresentedObject(representedObject);
-    }
-
     // Protected
 
     saveStateToCookie(cookie)
index d12ccb0..6745b9d 100644 (file)
@@ -59,7 +59,7 @@ WebInspector.NetworkTabContentView = class NetworkTabContentView extends WebInsp
         if (!(representedObject instanceof WebInspector.Resource))
             return false;
 
-        return this._navigationSidebarPanel.hasRepresentedObject(representedObject);
+        return !!this._navigationSidebarPanel.contentTreeOutline.getCachedTreeElement(representedObject);
     }
 
     get supportsSplitContentBrowser()
index 0b4abca..7015bf0 100644 (file)
@@ -203,23 +203,6 @@ WebInspector.NetworkTimelineView = class NetworkTimelineView extends WebInspecto
 
     // Protected
 
-    canShowContentViewForTreeElement(treeElement)
-    {
-        if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement)
-            return true;
-        return super.canShowContentViewForTreeElement(treeElement);
-    }
-
-    showContentViewForTreeElement(treeElement)
-    {
-        if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) {
-            WebInspector.showSourceCode(treeElement.representedObject, {ignoreNetworkTab: true});
-            return;
-        }
-
-        console.error("Unknown tree element selected.", treeElement);
-    }
-
     dataGridNodePathComponentSelected(event)
     {
         let pathComponent = event.data.pathComponent;
index e3a61cf..d0370c8 100644 (file)
@@ -228,7 +228,12 @@ WebInspector.ObjectTreeBaseTreeElement = class ObjectTreeBaseTreeElement extends
                             return;
 
                         let sourceCodeLocation = sourceCode.createSourceCodeLocation(location.lineNumber, location.columnNumber || 0);
-                        WebInspector.showSourceCodeLocation(sourceCodeLocation, {ignoreNetworkTab: true});
+
+                        const options = {
+                            ignoreNetworkTab: true,
+                            ignoreSearchTab: true,
+                        };
+                        WebInspector.showSourceCodeLocation(sourceCodeLocation, options);
                     });
                 });
             }
index 72b5658..69ab0ae 100644 (file)
@@ -93,15 +93,19 @@ WebInspector.ProbeSetDetailsSection = class ProbeSetDetailsSection extends WebIn
 
     _updateLinkElement()
     {
+        const options = {
+            ignoreNetworkTab: true,
+            ignoreSearchTab: true,
+        };
+
         var breakpoint = this._probeSet.breakpoint;
         if (breakpoint.sourceCodeLocation.sourceCode)
-            this.titleElement = WebInspector.createSourceCodeLocationLink(breakpoint.sourceCodeLocation);
+            this.titleElement = WebInspector.createSourceCodeLocationLink(breakpoint.sourceCodeLocation, options);
         else {
             // Fallback for when we can't create a live source link.
             console.assert(!breakpoint.resolved);
 
-            var location = breakpoint.sourceCodeLocation;
-            this.titleElement = WebInspector.linkifyLocation(breakpoint.contentIdentifier, location.displayLineNumber, location.displayColumnNumber);
+            this.titleElement = WebInspector.linkifyLocation(breakpoint.contentIdentifier, breakpoint.sourceCodeLocation.position, options);
         }
 
         this.titleElement.classList.add(WebInspector.ProbeSetDetailsSection.DontFloatLinkStyleClassName);
index 1ab1298..f9ac9a1 100644 (file)
@@ -241,10 +241,13 @@ WebInspector.ProfileDataGridNode = class ProfileDataGridNode extends WebInspecto
             locationElement.classList.add("location");
             sourceCodeLocation.populateLiveDisplayLocationString(locationElement, "textContent", WebInspector.SourceCodeLocation.ColumnStyle.Hidden, WebInspector.SourceCodeLocation.NameStyle.Short);
 
-            let dontFloat = true;
-            let useGoToArrowButton = true;
-            let goToArrowButtonLink = WebInspector.createSourceCodeLocationLink(sourceCodeLocation, dontFloat, useGoToArrowButton);
-            fragment.appendChild(goToArrowButtonLink);
+            const options = {
+                dontFloat: true,
+                useGoToArrowButton: true,
+                ignoreNetworkTab: true,
+                ignoreSearchTab: true,
+            };
+            fragment.appendChild(WebInspector.createSourceCodeLocationLink(sourceCodeLocation, options));
         }
 
         return fragment;
index 66d65b5..9089782 100644 (file)
@@ -275,7 +275,14 @@ WebInspector.ResourceDetailsSidebarPanel = class ResourceDetailsSidebarPanel ext
         }
 
         let initiatorLocation = this._resource.initiatorSourceCodeLocation;
-        this._initiatorRow.value = initiatorLocation ? WebInspector.createSourceCodeLocationLink(initiatorLocation, true) : null;
+        if (initiatorLocation) {
+            const options = {
+                dontFloat: true,
+                ignoreSearchTab: true,
+            };
+            this._initiatorRow.value = WebInspector.createSourceCodeLocationLink(initiatorLocation, options);
+        } else
+            this._initiatorRow.value = null;
 
         let initiatedResources = this._resource.initiatedResources;
         if (initiatedResources.length) {
@@ -497,7 +504,10 @@ WebInspector.ResourceDetailsSidebarPanel = class ResourceDetailsSidebarPanel ext
 
     _goToRequestDataClicked()
     {
-        WebInspector.showResourceRequest(this._resource);
+        const options = {
+            ignoreSearchTab: true,
+        };
+        WebInspector.showResourceRequest(this._resource, options);
     }
 
     _refreshRequestDataSection()
index e42c295..71ba7fc 100644 (file)
@@ -422,7 +422,12 @@ WebInspector.ResourceSidebarPanel = class ResourceSidebarPanel extends WebInspec
             || treeElement instanceof WebInspector.ResourceTreeElement
             || treeElement instanceof WebInspector.ScriptTreeElement
             || treeElement instanceof WebInspector.ContentFlowTreeElement) {
-            WebInspector.showRepresentedObject(treeElement.representedObject, null, {ignoreNetworkTab: true});
+            const cookie = null;
+            const options = {
+                ignoreNetworkTab: true,
+                ignoreSearchTab: true,
+            };
+            WebInspector.showRepresentedObject(treeElement.representedObject, cookie, options);
             return;
         }
 
index d0c2457..8ccdd05 100644 (file)
@@ -271,7 +271,11 @@ WebInspector.ResourceTimelineDataGridNode = class ResourceTimelineDataGridNode e
 
     _dataGridNodeGoToArrowClicked()
     {
-        WebInspector.showSourceCode(this._resource, {ignoreNetworkTab: true});
+        const options = {
+            ignoreNetworkTab: true,
+            ignoreSearchTab: true,
+        };
+        WebInspector.showSourceCode(this._resource, options);
     }
 
     _updateStatus(cell)
index c03d89f..8747704 100644 (file)
@@ -204,8 +204,14 @@ WebInspector.RulesStyleDetailsPanel = class RulesStyleDetailsPanel extends WebIn
                     mediaLabel.className = "label";
                     mediaLabel.append(prefixElement, media.text);
 
-                    if (media.sourceCodeLocation)
-                        mediaLabel.append(" \u2014 ", WebInspector.createSourceCodeLocationLink(media.sourceCodeLocation, true));
+                    if (media.sourceCodeLocation) {
+                        const options = {
+                            dontFloat: true,
+                            ignoreNetworkTab: true,
+                            ignoreSearchTab: true,
+                        };
+                        mediaLabel.append(" \u2014 ", WebInspector.createSourceCodeLocationLink(media.sourceCodeLocation, options));
+                    }
 
                     newDOMFragment.appendChild(mediaLabel);
 
index 79230dd..4cfa81b 100644 (file)
@@ -355,8 +355,13 @@ WebInspector.SearchSidebarPanel = class SearchSidebarPanel extends WebInspector.
         if (!treeElement || treeElement instanceof WebInspector.FolderTreeElement)
             return;
 
+        const options = {
+            ignoreNetworkTab: true,
+        };
+
         if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) {
-            WebInspector.showRepresentedObject(treeElement.representedObject, null, {ignoreNetworkTab: true});
+            const cookie = null;
+            WebInspector.showRepresentedObject(treeElement.representedObject, cookie, options);
             return;
         }
 
@@ -367,7 +372,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, {ignoreNetworkTab: true});
+            WebInspector.showOriginalOrFormattedSourceCodeTextRange(treeElement.representedObject.sourceCodeTextRange, options);
     }
 
     _treeElementDoubleClick(event)
@@ -376,9 +381,15 @@ WebInspector.SearchSidebarPanel = class SearchSidebarPanel extends WebInspector.
         if (!treeElement)
             return;
 
-        if (treeElement.representedObject instanceof WebInspector.DOMSearchMatchObject)
-            WebInspector.showMainFrameDOMTree(treeElement.representedObject.domNode, {ignoreSearchTab: true});
-        else if (treeElement.representedObject instanceof WebInspector.SourceCodeSearchMatchObject)
-            WebInspector.showOriginalOrFormattedSourceCodeTextRange(treeElement.representedObject.sourceCodeTextRange, {ignoreNetworkTab: true, ignoreSearchTab: true});
+        if (treeElement.representedObject instanceof WebInspector.DOMSearchMatchObject) {
+            WebInspector.showMainFrameDOMTree(treeElement.representedObject.domNode, {
+                ignoreSearchTab: true,
+            });
+        } else if (treeElement.representedObject instanceof WebInspector.SourceCodeSearchMatchObject) {
+            WebInspector.showOriginalOrFormattedSourceCodeTextRange(treeElement.representedObject.sourceCodeTextRange, {
+                ignoreNetworkTab: true,
+                ignoreSearchTab: true,
+            });
+        }
     }
 };
index 25fff78..780936a 100644 (file)
@@ -70,7 +70,10 @@ WebInspector.SearchTabContentView = class SearchTabContentView extends WebInspec
 
     canShowRepresentedObject(representedObject)
     {
-        return representedObject instanceof WebInspector.Resource || representedObject instanceof WebInspector.Script || representedObject instanceof WebInspector.DOMTree;
+        if (!(representedObject instanceof WebInspector.Resource) && !(representedObject instanceof WebInspector.Script) && !(representedObject instanceof WebInspector.DOMTree))
+            return false;
+
+        return !!this._navigationSidebarPanel.contentTreeOutline.getCachedTreeElement(representedObject);
     }
 
     focusSearchField()
index f27da07..20010a6 100644 (file)
@@ -1667,11 +1667,16 @@ WebInspector.SourceCodeTextEditor = class SourceCodeTextEditor extends WebInspec
         if (/\blink\b/.test(this.tokenTrackingController.candidate.hoveredToken.type))
             return;
 
+        const options = {
+            ignoreNetworkTab: true,
+            ignoreSearchTab: true,
+        };
+
         var sourceCodeLocation = this._sourceCodeLocationForEditorPosition(this.tokenTrackingController.candidate.hoveredTokenRange.start);
         if (this.sourceCode instanceof WebInspector.SourceMapResource)
-            WebInspector.showOriginalOrFormattedSourceCodeLocation(sourceCodeLocation, {ignoreNetworkTab: true});
+            WebInspector.showOriginalOrFormattedSourceCodeLocation(sourceCodeLocation, options);
         else
-            WebInspector.showSourceCodeLocation(sourceCodeLocation, {ignoreNetworkTab: true});
+            WebInspector.showSourceCodeLocation(sourceCodeLocation, options);
     }
 
     tokenTrackingControllerNewHighlightCandidate(tokenTrackingController, candidate)
index c766654..6909401 100644 (file)
@@ -87,7 +87,12 @@ WebInspector.SourceCodeTimelineTimelineDataGridNode = class SourceCodeTimelineTi
             subtitleElement.classList.add("subtitle");
             sourceCodeLocation.populateLiveDisplayLocationString(subtitleElement, "textContent", null, WebInspector.SourceCodeLocation.NameStyle.None, WebInspector.UIString("line "));
 
-            let goToArrowButtonLink = WebInspector.createSourceCodeLocationLink(sourceCodeLocation, false, true);
+            const options = {
+                useGoToArrowButton: true,
+                ignoreNetworkTab: true,
+                ignoreSearchTab: true,
+            };
+            let goToArrowButtonLink = WebInspector.createSourceCodeLocationLink(sourceCodeLocation, options);
             fragment.append(goToArrowButtonLink, subtitleElement);
 
             // Give the whole cell a tooltip and keep it up to date.
index 6c43883..ecb4d47 100644 (file)
@@ -530,7 +530,10 @@ WebInspector.TimelineDataGrid = class TimelineDataGrid extends WebInspector.Data
         if (!callFrame.sourceCodeLocation)
             return;
 
-        WebInspector.showSourceCodeLocation(callFrame.sourceCodeLocation, {ignoreNetworkTab: true});
+        WebInspector.showSourceCodeLocation(callFrame.sourceCodeLocation, {
+            ignoreNetworkTab: true,
+            ignoreSearchTab: true,
+        });
     }
 };
 
index 32b1324..bbb6ff1 100644 (file)
@@ -108,6 +108,12 @@ WebInspector.TimelineDataGridNode = class TimelineDataGridNode extends WebInspec
         if (!value)
             return emDash;
 
+        const options = {
+            useGoToArrowButton: true,
+            ignoreNetworkTab: true,
+            ignoreSearchTab: true,
+        };
+
         if (value instanceof WebInspector.SourceCodeLocation) {
             if (value.sourceCode instanceof WebInspector.Resource) {
                 cell.classList.add(WebInspector.ResourceTreeElement.ResourceIconStyleClassName);
@@ -125,9 +131,7 @@ WebInspector.TimelineDataGridNode = class TimelineDataGridNode extends WebInspec
             value.populateLiveDisplayLocationTooltip(cell);
 
             var fragment = document.createDocumentFragment();
-
-            var goToArrowButtonLink = WebInspector.createSourceCodeLocationLink(value, false, true);
-            fragment.appendChild(goToArrowButtonLink);
+            fragment.appendChild(WebInspector.createSourceCodeLocationLink(value, options));
 
             var titleElement = document.createElement("span");
             value.populateLiveDisplayLocationString(titleElement, "textContent");
@@ -154,8 +158,7 @@ WebInspector.TimelineDataGridNode = class TimelineDataGridNode extends WebInspec
                 // Give the whole cell a tooltip and keep it up to date.
                 callFrame.sourceCodeLocation.populateLiveDisplayLocationTooltip(cell);
 
-                var goToArrowButtonLink = WebInspector.createSourceCodeLocationLink(callFrame.sourceCodeLocation, false, true);
-                fragment.appendChild(goToArrowButtonLink);
+                fragment.appendChild(WebInspector.createSourceCodeLocationLink(value, options));
 
                 if (isAnonymousFunction) {
                     // For anonymous functions we show the resource or script icon and name.
index 2fe970a..a8fee7c 100644 (file)
@@ -137,10 +137,15 @@ WebInspector.VisualStyleSelectorTreeItem = class VisualStyleSelectorTreeItem ext
             return;
 
         contextMenu.appendItem(WebInspector.UIString("Show Source"), () => {
+            const options = {
+                ignoreNetworkTab: true,
+                ignoreSearchTab: true,
+            };
+
             if (event.metaKey)
-                WebInspector.showOriginalUnformattedSourceCodeLocation(this.representedObject.ownerRule.sourceCodeLocation, {ignoreNetworkTab: true});
+                WebInspector.showOriginalUnformattedSourceCodeLocation(this.representedObject.ownerRule.sourceCodeLocation, options);
             else
-                WebInspector.showSourceCodeLocation(this.representedObject.ownerRule.sourceCodeLocation, {ignoreNetworkTab: true});
+                WebInspector.showSourceCodeLocation(this.representedObject.ownerRule.sourceCodeLocation, options);
         });
 
         // Only used one colon temporarily since single-colon pseudo elements are valid CSS.