<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[211608] trunk/Source/WebInspectorUI</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/211608">211608</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2017-02-02 16:22:49 -0800 (Thu, 02 Feb 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: can't jump from Search Tab result to see resource in other tabs (Resource, Debugger, Network)
https://bugs.webkit.org/show_bug.cgi?id=167072

Patch by Devin Rousso &lt;dcrousso+webkit@gmail.com&gt; on 2017-02-02
Reviewed by Timothy Hatcher.

* UserInterface/Base/Main.js:
(WebInspector.tabContentViewForRepresentedObject):
(WebInspector.showRepresentedObject):
(WebInspector.showMainFrameDOMTree):
(WebInspector.showSourceCodeForFrame):
(WebInspector.showSourceCode):
(WebInspector.showSourceCodeLocation):
(WebInspector.showOriginalUnformattedSourceCodeLocation):
(WebInspector.showOriginalOrFormattedSourceCodeLocation):
(WebInspector.showOriginalOrFormattedSourceCodeTextRange):
(WebInspector.showResourceRequest):
Rework parameters to add optional `options` dictionary that can be used to indicate
additional functionality.

* UserInterface/Views/TabBrowser.js:
(WebInspector.TabBrowser.prototype.bestTabContentViewForRepresentedObject):
Ignore instances of SearchTabContentView as it can display content views for all types of
searchable data.  Determined by a newly added optional `options` parameter.

* UserInterface/Base/Utilities.js:
(Object.shallowMerge):
Merges the keys of two objects into a new one.

* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WebInspector.ComputedStyleDetailsPanel.prototype._goToRegionFlowArrowWasClicked):
(WebInspector.ComputedStyleDetailsPanel.prototype._goToContentFlowArrowWasClicked):

* UserInterface/Views/SearchSidebarPanel.js:
(WebInspector.SearchSidebarPanel.prototype.performSearch.createTreeElementForMatchObject):
(WebInspector.SearchSidebarPanel.prototype.performSearch.resourceCallback):
(WebInspector.SearchSidebarPanel.prototype.performSearch.resourcesCallback):
(WebInspector.SearchSidebarPanel.prototype.performSearch.searchScripts.scriptCallback):
(WebInspector.SearchSidebarPanel.prototype.performSearch.searchScripts):
(WebInspector.SearchSidebarPanel.prototype.performSearch.domSearchResults):
(WebInspector.SearchSidebarPanel.prototype.performSearch.domCallback):
(WebInspector.SearchSidebarPanel.prototype.performSearch):
(WebInspector.SearchSidebarPanel.prototype._treeElementDoubleClick):
* UserInterface/Views/TreeElement.js:
(WebInspector.TreeElement.treeElementDoubleClicked):
Add an event dispatch whenever a TreeElement is double clicked via the `dblclick` event.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseMainjs">trunk/Source/WebInspectorUI/UserInterface/Base/Main.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseUtilitiesjs">trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsComputedStyleDetailsPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSearchSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTabBrowserjs">trunk/Source/WebInspectorUI/UserInterface/Views/TabBrowser.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/TreeElement.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (211607 => 211608)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2017-02-03 00:15:18 UTC (rev 211607)
+++ trunk/Source/WebInspectorUI/ChangeLog        2017-02-03 00:22:49 UTC (rev 211608)
</span><span class="lines">@@ -1,3 +1,51 @@
</span><ins>+2017-02-02  Devin Rousso  &lt;dcrousso+webkit@gmail.com&gt;
+
+        Web Inspector: can't jump from Search Tab result to see resource in other tabs (Resource, Debugger, Network)
+        https://bugs.webkit.org/show_bug.cgi?id=167072
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Base/Main.js:
+        (WebInspector.tabContentViewForRepresentedObject):
+        (WebInspector.showRepresentedObject):
+        (WebInspector.showMainFrameDOMTree):
+        (WebInspector.showSourceCodeForFrame):
+        (WebInspector.showSourceCode):
+        (WebInspector.showSourceCodeLocation):
+        (WebInspector.showOriginalUnformattedSourceCodeLocation):
+        (WebInspector.showOriginalOrFormattedSourceCodeLocation):
+        (WebInspector.showOriginalOrFormattedSourceCodeTextRange):
+        (WebInspector.showResourceRequest):
+        Rework parameters to add optional `options` dictionary that can be used to indicate
+        additional functionality.
+
+        * UserInterface/Views/TabBrowser.js:
+        (WebInspector.TabBrowser.prototype.bestTabContentViewForRepresentedObject):
+        Ignore instances of SearchTabContentView as it can display content views for all types of
+        searchable data.  Determined by a newly added optional `options` parameter.
+
+        * UserInterface/Base/Utilities.js:
+        (Object.shallowMerge):
+        Merges the keys of two objects into a new one.
+
+        * UserInterface/Views/ComputedStyleDetailsPanel.js:
+        (WebInspector.ComputedStyleDetailsPanel.prototype._goToRegionFlowArrowWasClicked):
+        (WebInspector.ComputedStyleDetailsPanel.prototype._goToContentFlowArrowWasClicked):
+
+        * UserInterface/Views/SearchSidebarPanel.js:
+        (WebInspector.SearchSidebarPanel.prototype.performSearch.createTreeElementForMatchObject):
+        (WebInspector.SearchSidebarPanel.prototype.performSearch.resourceCallback):
+        (WebInspector.SearchSidebarPanel.prototype.performSearch.resourcesCallback):
+        (WebInspector.SearchSidebarPanel.prototype.performSearch.searchScripts.scriptCallback):
+        (WebInspector.SearchSidebarPanel.prototype.performSearch.searchScripts):
+        (WebInspector.SearchSidebarPanel.prototype.performSearch.domSearchResults):
+        (WebInspector.SearchSidebarPanel.prototype.performSearch.domCallback):
+        (WebInspector.SearchSidebarPanel.prototype.performSearch):
+        (WebInspector.SearchSidebarPanel.prototype._treeElementDoubleClick):
+        * UserInterface/Views/TreeElement.js:
+        (WebInspector.TreeElement.treeElementDoubleClicked):
+        Add an event dispatch whenever a TreeElement is double clicked via the `dblclick` event.
+
</ins><span class="cx"> 2017-02-01  Yusuke Suzuki  &lt;utatane.tea@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Upgrade Esprima to the latest one to support dynamic import
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseMainjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (211607 => 211608)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js        2017-02-03 00:15:18 UTC (rev 211607)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js        2017-02-03 00:22:49 UTC (rev 211608)
</span><span class="lines">@@ -1133,9 +1133,9 @@
</span><span class="cx">     return null;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-WebInspector.tabContentViewForRepresentedObject = function(representedObject)
</del><ins>+WebInspector.tabContentViewForRepresentedObject = function(representedObject, options = {})
</ins><span class="cx"> {
</span><del>-    var tabContentView = this.tabBrowser.bestTabContentViewForRepresentedObject(representedObject);
</del><ins>+    let tabContentView = this.tabBrowser.bestTabContentViewForRepresentedObject(representedObject, options);
</ins><span class="cx">     if (tabContentView)
</span><span class="cx">         return tabContentView;
</span><span class="cx"> 
</span><span class="lines">@@ -1152,9 +1152,9 @@
</span><span class="cx">     return tabContentView;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-WebInspector.showRepresentedObject = function(representedObject, cookie)
</del><ins>+WebInspector.showRepresentedObject = function(representedObject, cookie, options = {})
</ins><span class="cx"> {
</span><del>-    var tabContentView = this.tabContentViewForRepresentedObject(representedObject);
</del><ins>+    let tabContentView = this.tabContentViewForRepresentedObject(representedObject, options);
</ins><span class="cx">     console.assert(tabContentView);
</span><span class="cx">     if (!tabContentView)
</span><span class="cx">         return;
</span><span class="lines">@@ -1163,21 +1163,16 @@
</span><span class="cx">     tabContentView.showRepresentedObject(representedObject, cookie);
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-WebInspector.showMainFrameDOMTree = function(nodeToSelect)
</del><ins>+WebInspector.showMainFrameDOMTree = function(nodeToSelect, options = {})
</ins><span class="cx"> {
</span><span class="cx">     console.assert(WebInspector.frameResourceManager.mainFrame);
</span><span class="cx">     if (!WebInspector.frameResourceManager.mainFrame)
</span><span class="cx">         return;
</span><del>-    this.showRepresentedObject(WebInspector.frameResourceManager.mainFrame.domTree, {nodeToSelect});
</del><ins>+    this.showRepresentedObject(WebInspector.frameResourceManager.mainFrame.domTree, {nodeToSelect}, options);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-WebInspector.showContentFlowDOMTree = function(contentFlow, nodeToSelect)
</del><ins>+WebInspector.showSourceCodeForFrame = function(frameIdentifier, options = {})
</ins><span class="cx"> {
</span><del>-    this.showRepresentedObject(contentFlow, {nodeToSelect});
-};
-
-WebInspector.showSourceCodeForFrame = function(frameIdentifier)
-{
</del><span class="cx">     var frame = WebInspector.frameResourceManager.frameForIdentifier(frameIdentifier);
</span><span class="cx">     if (!frame) {
</span><span class="cx">         this._frameIdentifierToShowSourceCodeWhenAvailable = frameIdentifier;
</span><span class="lines">@@ -1186,11 +1181,13 @@
</span><span class="cx"> 
</span><span class="cx">     this._frameIdentifierToShowSourceCodeWhenAvailable = undefined;
</span><span class="cx"> 
</span><del>-    this.showRepresentedObject(frame);
</del><ins>+    this.showRepresentedObject(frame, null, options);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-WebInspector.showSourceCode = function(sourceCode, positionToReveal, textRangeToSelect, forceUnformatted)
</del><ins>+WebInspector.showSourceCode = function(sourceCode, options = {})
</ins><span class="cx"> {
</span><ins>+    const positionToReveal = options.positionToReveal;
+
</ins><span class="cx">     console.assert(!positionToReveal || positionToReveal instanceof WebInspector.SourceCodePosition, positionToReveal);
</span><span class="cx">     var representedObject = sourceCode;
</span><span class="cx"> 
</span><span class="lines">@@ -1200,33 +1197,43 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     var cookie = positionToReveal ? {lineNumber: positionToReveal.lineNumber, columnNumber: positionToReveal.columnNumber} : {};
</span><del>-    this.showRepresentedObject(representedObject, cookie);
</del><ins>+    this.showRepresentedObject(representedObject, cookie, options);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-WebInspector.showSourceCodeLocation = function(sourceCodeLocation)
</del><ins>+WebInspector.showSourceCodeLocation = function(sourceCodeLocation, options = {})
</ins><span class="cx"> {
</span><del>-    this.showSourceCode(sourceCodeLocation.displaySourceCode, sourceCodeLocation.displayPosition());
</del><ins>+    this.showSourceCode(sourceCodeLocation.displaySourceCode, Object.shallowMerge(options, {
+        positionToReveal: sourceCodeLocation.displayPosition()
+    }));
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-WebInspector.showOriginalUnformattedSourceCodeLocation = function(sourceCodeLocation)
</del><ins>+WebInspector.showOriginalUnformattedSourceCodeLocation = function(sourceCodeLocation, options = {})
</ins><span class="cx"> {
</span><del>-    this.showSourceCode(sourceCodeLocation.sourceCode, sourceCodeLocation.position(), null, true);
</del><ins>+    this.showSourceCode(sourceCodeLocation.sourceCode, Object.shallowMerge(options, {
+        positionToReveal: sourceCodeLocation.position(),
+        forceUnformatted: true
+    }));
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-WebInspector.showOriginalOrFormattedSourceCodeLocation = function(sourceCodeLocation)
</del><ins>+WebInspector.showOriginalOrFormattedSourceCodeLocation = function(sourceCodeLocation, options = {})
</ins><span class="cx"> {
</span><del>-    this.showSourceCode(sourceCodeLocation.sourceCode, sourceCodeLocation.formattedPosition());
</del><ins>+    this.showSourceCode(sourceCodeLocation.sourceCode, Object.shallowMerge(options, {
+        positionToReveal: sourceCodeLocation.formattedPosition()
+    }));
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-WebInspector.showOriginalOrFormattedSourceCodeTextRange = function(sourceCodeTextRange)
</del><ins>+WebInspector.showOriginalOrFormattedSourceCodeTextRange = function(sourceCodeTextRange, options = {})
</ins><span class="cx"> {
</span><span class="cx">     var textRangeToSelect = sourceCodeTextRange.formattedTextRange;
</span><del>-    this.showSourceCode(sourceCodeTextRange.sourceCode, textRangeToSelect.startPosition(), textRangeToSelect);
</del><ins>+    this.showSourceCode(sourceCodeTextRange.sourceCode, Object.shallowMerge(options, {
+        positionToReveal: textRangeToSelect.startPosition(),
+        textRangeToSelect
+    }));
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-WebInspector.showResourceRequest = function(resource)
</del><ins>+WebInspector.showResourceRequest = function(resource, options = {})
</ins><span class="cx"> {
</span><del>-    this.showRepresentedObject(resource, {[WebInspector.ResourceClusterContentView.ContentViewIdentifierCookieKey]: WebInspector.ResourceClusterContentView.RequestIdentifier});
</del><ins>+    this.showRepresentedObject(resource, {[WebInspector.ResourceClusterContentView.ContentViewIdentifierCookieKey]: WebInspector.ResourceClusterContentView.RequestIdentifier}, options);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WebInspector.debuggerToggleBreakpoints = function(event)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseUtilitiesjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js (211607 => 211608)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js        2017-02-03 00:15:18 UTC (rev 211607)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js        2017-02-03 00:22:49 UTC (rev 211608)
</span><span class="lines">@@ -85,6 +85,20 @@
</span><span class="cx">     }
</span><span class="cx"> });
</span><span class="cx"> 
</span><ins>+Object.defineProperty(Object, &quot;shallowMerge&quot;,
+{
+    value(a, b)
+    {
+        let result = Object.shallowCopy(a);
+        let keys = Object.keys(b);
+        for (let i = 0; i &lt; keys.length; ++i) {
+            console.assert(!result.hasOwnProperty(keys[i]) || result[keys[i]] === b[keys[i]], keys[i]);
+            result[keys[i]] = b[keys[i]];
+        }
+        return result;
+    }
+});
+
</ins><span class="cx"> Object.defineProperty(Object.prototype, &quot;valueForCaseInsensitiveKey&quot;,
</span><span class="cx"> {
</span><span class="cx">     value: function(key)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsComputedStyleDetailsPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.js (211607 => 211608)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.js        2017-02-03 00:15:18 UTC (rev 211607)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.js        2017-02-03 00:22:49 UTC (rev 211608)
</span><span class="lines">@@ -278,12 +278,12 @@
</span><span class="cx"> 
</span><span class="cx">     _goToRegionFlowArrowWasClicked()
</span><span class="cx">     {
</span><del>-        WebInspector.showContentFlowDOMTree(this._regionFlow);
</del><ins>+        WebInspector.showRepresentedObject(this._regionFlow);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     _goToContentFlowArrowWasClicked()
</span><span class="cx">     {
</span><del>-        WebInspector.showContentFlowDOMTree(this._contentFlow, this.nodeStyles.node);
</del><ins>+        WebInspector.showRepresentedObject(this._contentFlow, {nodeToSelect: this.nodeStyles.node});
</ins><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSearchSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js (211607 => 211608)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js        2017-02-03 00:15:18 UTC (rev 211607)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js        2017-02-03 00:22:49 UTC (rev 211608)
</span><span class="lines">@@ -95,6 +95,17 @@
</span><span class="cx"> 
</span><span class="cx">         var updateEmptyContentPlaceholderTimeout = null;
</span><span class="cx"> 
</span><ins>+        function createTreeElementForMatchObject(matchObject, parentTreeElement)
+        {
+            let matchTreeElement = new WebInspector.SearchResultTreeElement(matchObject);
+            matchTreeElement.addEventListener(WebInspector.TreeElement.Event.DoubleClick, this._treeElementDoubleClick, this);
+
+            parentTreeElement.appendChild(matchTreeElement);
+
+            if (!this.contentTreeOutline.selectedTreeElement)
+                matchTreeElement.revealAndSelect(false, true);
+        }
+
</ins><span class="cx">         function updateEmptyContentPlaceholderSoon()
</span><span class="cx">         {
</span><span class="cx">             if (updateEmptyContentPlaceholderTimeout)
</span><span class="lines">@@ -146,13 +157,10 @@
</span><span class="cx"> 
</span><span class="cx">                 for (var i = 0; i &lt; resourceMatches.length; ++i) {
</span><span class="cx">                     var match = resourceMatches[i];
</span><del>-                    forEachMatch(searchQuery, match.lineContent, function(lineMatch, lastIndex) {
</del><ins>+                    forEachMatch(searchQuery, match.lineContent, (lineMatch, lastIndex) =&gt; {
</ins><span class="cx">                         var matchObject = new WebInspector.SourceCodeSearchMatchObject(resource, match.lineContent, searchQuery, new WebInspector.TextRange(match.lineNumber, lineMatch.index, match.lineNumber, lastIndex));
</span><del>-                        var matchTreeElement = new WebInspector.SearchResultTreeElement(matchObject);
-                        resourceTreeElement.appendChild(matchTreeElement);
-                        if (!this.contentTreeOutline.selectedTreeElement)
-                            matchTreeElement.revealAndSelect(false, true);
-                    }.bind(this));
</del><ins>+                        createTreeElementForMatchObject.call(this, matchObject, resourceTreeElement);
+                    });
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 updateEmptyContentPlaceholder.call(this);
</span><span class="lines">@@ -186,13 +194,10 @@
</span><span class="cx"> 
</span><span class="cx">                 for (var i = 0; i &lt; scriptMatches.length; ++i) {
</span><span class="cx">                     var match = scriptMatches[i];
</span><del>-                    forEachMatch(searchQuery, match.lineContent, function(lineMatch, lastIndex) {
</del><ins>+                    forEachMatch(searchQuery, match.lineContent, (lineMatch, lastIndex) =&gt; {
</ins><span class="cx">                         var matchObject = new WebInspector.SourceCodeSearchMatchObject(script, match.lineContent, searchQuery, new WebInspector.TextRange(match.lineNumber, lineMatch.index, match.lineNumber, lastIndex));
</span><del>-                        var matchTreeElement = new WebInspector.SearchResultTreeElement(matchObject);
-                        scriptTreeElement.appendChild(matchTreeElement);
-                        if (!this.contentTreeOutline.selectedTreeElement)
-                            matchTreeElement.revealAndSelect(false, true);
-                    }.bind(this));
</del><ins>+                        createTreeElementForMatchObject.call(this, matchObject, scriptTreeElement);
+                    });
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 updateEmptyContentPlaceholder.call(this);
</span><span class="lines">@@ -243,22 +248,16 @@
</span><span class="cx"> 
</span><span class="cx">                     // Textual matches.
</span><span class="cx">                     var didFindTextualMatch = false;
</span><del>-                    forEachMatch(searchQuery, domNodeTitle, function(lineMatch, lastIndex) {
</del><ins>+                    forEachMatch(searchQuery, domNodeTitle, (lineMatch, lastIndex) =&gt; {
</ins><span class="cx">                         var matchObject = new WebInspector.DOMSearchMatchObject(resource, domNode, domNodeTitle, searchQuery, new WebInspector.TextRange(0, lineMatch.index, 0, lastIndex));
</span><del>-                        var matchTreeElement = new WebInspector.SearchResultTreeElement(matchObject);
-                        resourceTreeElement.appendChild(matchTreeElement);
-                        if (!this.contentTreeOutline.selectedTreeElement)
-                            matchTreeElement.revealAndSelect(false, true);
</del><ins>+                        createTreeElementForMatchObject.call(this, matchObject, resourceTreeElement);
</ins><span class="cx">                         didFindTextualMatch = true;
</span><del>-                    }.bind(this));
</del><ins>+                    });
</ins><span class="cx"> 
</span><span class="cx">                     // Non-textual matches are CSS Selector or XPath matches. In such cases, display the node entirely highlighted.
</span><span class="cx">                     if (!didFindTextualMatch) {
</span><span class="cx">                         var matchObject = new WebInspector.DOMSearchMatchObject(resource, domNode, domNodeTitle, domNodeTitle, new WebInspector.TextRange(0, 0, 0, domNodeTitle.length));
</span><del>-                        var matchTreeElement = new WebInspector.SearchResultTreeElement(matchObject);
-                        resourceTreeElement.appendChild(matchTreeElement);
-                        if (!this.contentTreeOutline.selectedTreeElement)
-                            matchTreeElement.revealAndSelect(false, true);
</del><ins>+                        createTreeElementForMatchObject.call(this, matchObject, resourceTreeElement);
</ins><span class="cx">                     }
</span><span class="cx"> 
</span><span class="cx">                     updateEmptyContentPlaceholder.call(this);
</span><span class="lines">@@ -370,4 +369,17 @@
</span><span class="cx">         else if (treeElement.representedObject instanceof WebInspector.SourceCodeSearchMatchObject)
</span><span class="cx">             WebInspector.showOriginalOrFormattedSourceCodeTextRange(treeElement.representedObject.sourceCodeTextRange);
</span><span class="cx">     }
</span><ins>+
+    _treeElementDoubleClick(event)
+    {
+        let treeElement = event.target;
+        if (!treeElement)
+            return;
+
+        const options = {ignoreSearchTab: true};
+        if (treeElement.representedObject instanceof WebInspector.DOMSearchMatchObject)
+            WebInspector.showMainFrameDOMTree(treeElement.representedObject.domNode, options);
+        else if (treeElement.representedObject instanceof WebInspector.SourceCodeSearchMatchObject)
+            WebInspector.showOriginalOrFormattedSourceCodeTextRange(treeElement.representedObject.sourceCodeTextRange, options);
+    }
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTabBrowserjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TabBrowser.js (211607 => 211608)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TabBrowser.js        2017-02-03 00:15:18 UTC (rev 211607)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TabBrowser.js        2017-02-03 00:22:49 UTC (rev 211608)
</span><span class="lines">@@ -107,11 +107,14 @@
</span><span class="cx">         return null;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bestTabContentViewForRepresentedObject(representedObject)
</del><ins>+    bestTabContentViewForRepresentedObject(representedObject, options = {})
</ins><span class="cx">     {
</span><span class="cx">         console.assert(!this.selectedTabContentView || this.selectedTabContentView === this._recentTabContentViews[0]);
</span><span class="cx"> 
</span><span class="cx">         for (var tabContentView of this._recentTabContentViews) {
</span><ins>+            if (options.ignoreSearchTab &amp;&amp; tabContentView instanceof WebInspector.SearchTabContentView)
+                continue;
+
</ins><span class="cx">             if (tabContentView.canShowRepresentedObject(representedObject))
</span><span class="cx">                 return tabContentView;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTreeElementjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TreeElement.js (211607 => 211608)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TreeElement.js        2017-02-03 00:15:18 UTC (rev 211607)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TreeElement.js        2017-02-03 00:22:49 UTC (rev 211608)
</span><span class="lines">@@ -310,6 +310,9 @@
</span><span class="cx">         if (element.treeElement.isEventWithinDisclosureTriangle(event))
</span><span class="cx">             return;
</span><span class="cx"> 
</span><ins>+        if (element.treeElement.dispatchEventToListeners(WebInspector.TreeElement.Event.DoubleClick))
+            return;
+
</ins><span class="cx">         if (element.treeElement.ondblclick)
</span><span class="cx">             element.treeElement.ondblclick.call(element.treeElement, event);
</span><span class="cx">         else if (element.treeElement.hasChildren &amp;&amp; !element.treeElement.expanded)
</span><span class="lines">@@ -620,3 +623,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> };
</span><ins>+
+WebInspector.TreeElement.Event = {
+    DoubleClick: &quot;tree-element-double-click&quot;,
+};
</ins></span></pre>
</div>
</div>

</body>
</html>