<!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>[197961] 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/197961">197961</a></dd>
<dt>Author</dt> <dd>mattbaker@apple.com</dd>
<dt>Date</dt> <dd>2016-03-10 15:18:55 -0800 (Thu, 10 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Add &quot;Quick Open&quot; dialog to debugger and resources tabs
https://bugs.webkit.org/show_bug.cgi?id=153028
&lt;rdar://problem/24194239&gt;

Reviewed by Timothy Hatcher.

* Localizations/en.lproj/localizedStrings.js:
New placeholder text for open resource dialog field.

* UserInterface/Base/Main.js:
(WebInspector.contentLoaded):
Keep a reference to the content element to use as global dialog parent,
and create keyboard shortcut for new dialog.

(WebInspector._showOpenResourceDialog):
Create dialog if needed, return if already visible.
(WebInspector.dialogWasDismissed):
Show represented object, if any, when dialog is dismissed.

* UserInterface/Main.html:
New files.

* UserInterface/Views/Dialog.js: Added.
Base class for modal dialog popovers. Implements basic setup and
teardown, and logic for validating and returning a represented object.

(WebInspector.Dialog):
(WebInspector.Dialog.prototype.get visible):
(WebInspector.Dialog.prototype.get delegate):
(WebInspector.Dialog.prototype.get representedObject):
(WebInspector.Dialog.prototype.present):
(WebInspector.Dialog.prototype.dismiss):
(WebInspector.Dialog.prototype.didPresetDialog):
(WebInspector.Dialog.prototype.representedObjectIsValid):

* UserInterface/Views/GoToLineDialog.js:
Subclass the Dialog base class.
(WebInspector.GoToLineDialog):
(WebInspector.GoToLineDialog.prototype.didPresentDialog):
Implement base class behavior hook. Replaces &quot;present&quot;.
(WebInspector.GoToLineDialog.prototype._handleInputEvent):
(WebInspector.GoToLineDialog.prototype._handleKeydownEvent):
Line number validation handled by base class/delegate.
(WebInspector.GoToLineDialog.prototype._clear):
(WebInspector.GoToLineDialog.prototype.present): Deleted.
(WebInspector.GoToLineDialog.prototype.dismiss): Deleted.
No longer needed, handled by base class.

* UserInterface/Views/OpenResourceDialog.css: Added.
(.open-resource-dialog):
(.open-resource-dialog &gt; .field):
(.open-resource-dialog &gt; .field &gt; input):
(.open-resource-dialog &gt; .field &gt; input::-webkit-input-placeholder):
(.open-resource-dialog &gt; .field &gt; img):
(.open-resource-dialog &gt; .field &gt; img:active):
(.open-resource-dialog.non-empty &gt; .field &gt; img):
(.open-resource-dialog &gt; .tree-outline):
(.open-resource-dialog &gt; .tree-outline .item):
(.open-resource-dialog &gt; .tree-outline .item:first-child):
(.open-resource-dialog &gt; .tree-outline .item.selected):
(.open-resource-dialog &gt; .tree-outline .item.selected .subtitle):
Styles for &quot;quick open&quot; dialog.

* UserInterface/Views/OpenResourceDialog.js: Added.
New dialog type, based on the Quick Open dialog found in Xcode (and its
equivalent in most modern editors).

(WebInspector.OpenResourceDialog):
(WebInspector.OpenResourceDialog.prototype._populateResourceTreeOutline.createTreeElement):
(WebInspector.OpenResourceDialog.prototype._populateResourceTreeOutline):
Populate the auto-completion tree from the list of filtered resources.

(WebInspector.OpenResourceDialog.prototype.didPresentDialog):
Build resource list once, when the dialog is presented. Update the list
when resources are added/removed in a follow-up: https://webkit.org/b/155321.

(WebInspector.OpenResourceDialog.prototype._handleInputEvent):
(WebInspector.OpenResourceDialog.prototype._handleKeydownEvent):
Escape key: dismiss dialog if input is empty, otherwise clear input.
Enter key: dismiss dialog if object selected.
Key up/down: cycle through auto-completion tree items, if any.

(WebInspector.OpenResourceDialog.prototype._handleKeyupEvent):
(WebInspector.OpenResourceDialog.prototype._handleBlurEvent):
(WebInspector.OpenResourceDialog.prototype._handleMousedownEvent):
(WebInspector.OpenResourceDialog.prototype._handleClickEvent):
(WebInspector.OpenResourceDialog.prototype._clear):
(WebInspector.OpenResourceDialog.prototype._updateFilter):
Rebuild filter regular expressions and apply to all resources. Each
resource is given a weight based on the first matching filter. Filters
are ordered by relevancy, from most to least relevant. Filtered resources
are sorted based on weight. If no matches are found, the tree is hidden.

* UserInterface/Views/ResourceTreeElement.js:
(WebInspector.ResourceTreeElement.prototype.get filterableData):
make filterable resource data more fine-grained. Priority should be given
to the resource's name, before the complete URL.

* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype.showGoToLineDialog):
(WebInspector.SourceCodeTextEditor.prototype.dialogWasDismissed):
(WebInspector.SourceCodeTextEditor.prototype.goToLineDialogValueWasValidated): Deleted.
(WebInspector.SourceCodeTextEditor.prototype.goToLineDialogWasDismissed): Deleted.
Updated for new Dialog delegate behavior.

* UserInterface/Views/TreeOutline.css:
(.tree-outline.large .item .titles):
(.tree-outline.large .item .titles.no-subtitle): Deleted.
Styles for tree elements in &quot;quick open&quot; dialog auto-completion tree.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs">trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseMainjs">trunk/Source/WebInspectorUI/UserInterface/Base/Main.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceMainhtml">trunk/Source/WebInspectorUI/UserInterface/Main.html</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsGoToLineDialogjs">trunk/Source/WebInspectorUI/UserInterface/Views/GoToLineDialog.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsResourceTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSourceCodeTextEditorjs">trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTreeOutlinecss">trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.css</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDialogjs">trunk/Source/WebInspectorUI/UserInterface/Views/Dialog.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsOpenResourceDialogcss">trunk/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsOpenResourceDialogjs">trunk/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (197960 => 197961)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2016-03-10 23:09:30 UTC (rev 197960)
+++ trunk/Source/WebInspectorUI/ChangeLog        2016-03-10 23:18:55 UTC (rev 197961)
</span><span class="lines">@@ -1,5 +1,117 @@
</span><span class="cx"> 2016-03-10  Matt Baker  &lt;mattbaker@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Web Inspector: Add &quot;Quick Open&quot; dialog to debugger and resources tabs
+        https://bugs.webkit.org/show_bug.cgi?id=153028
+        &lt;rdar://problem/24194239&gt;
+
+        Reviewed by Timothy Hatcher.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        New placeholder text for open resource dialog field.
+
+        * UserInterface/Base/Main.js:
+        (WebInspector.contentLoaded):
+        Keep a reference to the content element to use as global dialog parent,
+        and create keyboard shortcut for new dialog.
+
+        (WebInspector._showOpenResourceDialog):
+        Create dialog if needed, return if already visible.
+        (WebInspector.dialogWasDismissed):
+        Show represented object, if any, when dialog is dismissed.
+
+        * UserInterface/Main.html:
+        New files.
+
+        * UserInterface/Views/Dialog.js: Added.
+        Base class for modal dialog popovers. Implements basic setup and
+        teardown, and logic for validating and returning a represented object.
+
+        (WebInspector.Dialog):
+        (WebInspector.Dialog.prototype.get visible):
+        (WebInspector.Dialog.prototype.get delegate):
+        (WebInspector.Dialog.prototype.get representedObject):
+        (WebInspector.Dialog.prototype.present):
+        (WebInspector.Dialog.prototype.dismiss):
+        (WebInspector.Dialog.prototype.didPresetDialog):
+        (WebInspector.Dialog.prototype.representedObjectIsValid):
+
+        * UserInterface/Views/GoToLineDialog.js:
+        Subclass the Dialog base class.
+        (WebInspector.GoToLineDialog):
+        (WebInspector.GoToLineDialog.prototype.didPresentDialog):
+        Implement base class behavior hook. Replaces &quot;present&quot;.
+        (WebInspector.GoToLineDialog.prototype._handleInputEvent):
+        (WebInspector.GoToLineDialog.prototype._handleKeydownEvent):
+        Line number validation handled by base class/delegate.
+        (WebInspector.GoToLineDialog.prototype._clear):
+        (WebInspector.GoToLineDialog.prototype.present): Deleted.
+        (WebInspector.GoToLineDialog.prototype.dismiss): Deleted.
+        No longer needed, handled by base class.
+
+        * UserInterface/Views/OpenResourceDialog.css: Added.
+        (.open-resource-dialog):
+        (.open-resource-dialog &gt; .field):
+        (.open-resource-dialog &gt; .field &gt; input):
+        (.open-resource-dialog &gt; .field &gt; input::-webkit-input-placeholder):
+        (.open-resource-dialog &gt; .field &gt; img):
+        (.open-resource-dialog &gt; .field &gt; img:active):
+        (.open-resource-dialog.non-empty &gt; .field &gt; img):
+        (.open-resource-dialog &gt; .tree-outline):
+        (.open-resource-dialog &gt; .tree-outline .item):
+        (.open-resource-dialog &gt; .tree-outline .item:first-child):
+        (.open-resource-dialog &gt; .tree-outline .item.selected):
+        (.open-resource-dialog &gt; .tree-outline .item.selected .subtitle):
+        Styles for &quot;quick open&quot; dialog.
+
+        * UserInterface/Views/OpenResourceDialog.js: Added.
+        New dialog type, based on the Quick Open dialog found in Xcode (and its
+        equivalent in most modern editors).
+
+        (WebInspector.OpenResourceDialog):
+        (WebInspector.OpenResourceDialog.prototype._populateResourceTreeOutline.createTreeElement):
+        (WebInspector.OpenResourceDialog.prototype._populateResourceTreeOutline):
+        Populate the auto-completion tree from the list of filtered resources.
+
+        (WebInspector.OpenResourceDialog.prototype.didPresentDialog):
+        Build resource list once, when the dialog is presented. Update the list
+        when resources are added/removed in a follow-up: https://webkit.org/b/155321.
+
+        (WebInspector.OpenResourceDialog.prototype._handleInputEvent):
+        (WebInspector.OpenResourceDialog.prototype._handleKeydownEvent):
+        Escape key: dismiss dialog if input is empty, otherwise clear input.
+        Enter key: dismiss dialog if object selected.
+        Key up/down: cycle through auto-completion tree items, if any.
+
+        (WebInspector.OpenResourceDialog.prototype._handleKeyupEvent):
+        (WebInspector.OpenResourceDialog.prototype._handleBlurEvent):
+        (WebInspector.OpenResourceDialog.prototype._handleMousedownEvent):
+        (WebInspector.OpenResourceDialog.prototype._handleClickEvent):
+        (WebInspector.OpenResourceDialog.prototype._clear):
+        (WebInspector.OpenResourceDialog.prototype._updateFilter):
+        Rebuild filter regular expressions and apply to all resources. Each
+        resource is given a weight based on the first matching filter. Filters
+        are ordered by relevancy, from most to least relevant. Filtered resources
+        are sorted based on weight. If no matches are found, the tree is hidden.
+
+        * UserInterface/Views/ResourceTreeElement.js:
+        (WebInspector.ResourceTreeElement.prototype.get filterableData):
+        make filterable resource data more fine-grained. Priority should be given
+        to the resource's name, before the complete URL.
+
+        * UserInterface/Views/SourceCodeTextEditor.js:
+        (WebInspector.SourceCodeTextEditor.prototype.showGoToLineDialog):
+        (WebInspector.SourceCodeTextEditor.prototype.dialogWasDismissed):
+        (WebInspector.SourceCodeTextEditor.prototype.goToLineDialogValueWasValidated): Deleted.
+        (WebInspector.SourceCodeTextEditor.prototype.goToLineDialogWasDismissed): Deleted.
+        Updated for new Dialog delegate behavior.
+
+        * UserInterface/Views/TreeOutline.css:
+        (.tree-outline.large .item .titles):
+        (.tree-outline.large .item .titles.no-subtitle): Deleted.
+        Styles for tree elements in &quot;quick open&quot; dialog auto-completion tree.
+
+2016-03-10  Matt Baker  &lt;mattbaker@apple.com&gt;
+
</ins><span class="cx">         Web Inspector: TreeOutlineDataGridSynchronizer should be optional in TimelineDataGrid
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=155318
</span><span class="cx">         &lt;rdar://problem/25091949&gt;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (197960 => 197961)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2016-03-10 23:09:30 UTC (rev 197960)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2016-03-10 23:18:55 UTC (rev 197961)
</span><span class="lines">@@ -318,6 +318,7 @@
</span><span class="cx"> localizedStrings[&quot;Extra Scripts&quot;] = &quot;Extra Scripts&quot;;
</span><span class="cx"> localizedStrings[&quot;Family&quot;] = &quot;Family&quot;;
</span><span class="cx"> localizedStrings[&quot;Features&quot;] = &quot;Features&quot;;
</span><ins>+localizedStrings[&quot;File or Resource&quot;] = &quot;File or Resource&quot;;
</ins><span class="cx"> localizedStrings[&quot;Filename&quot;] = &quot;Filename&quot;;
</span><span class="cx"> localizedStrings[&quot;Fill&quot;] = &quot;Fill&quot;;
</span><span class="cx"> localizedStrings[&quot;Fill Mode&quot;] = &quot;Fill Mode&quot;;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseMainjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (197960 => 197961)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js        2016-03-10 23:09:30 UTC (rev 197960)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js        2016-03-10 23:18:55 UTC (rev 197961)
</span><span class="lines">@@ -227,9 +227,9 @@
</span><span class="cx">     this.tabBar.addEventListener(WebInspector.TabBar.Event.NewTabItemClicked, this._newTabItemClicked, this);
</span><span class="cx">     this.tabBar.addEventListener(WebInspector.TabBar.Event.OpenDefaultTab, this._openDefaultTab, this);
</span><span class="cx"> 
</span><del>-    var contentElement = document.getElementById(&quot;content&quot;);
-    contentElement.setAttribute(&quot;role&quot;, &quot;main&quot;);
-    contentElement.setAttribute(&quot;aria-label&quot;, WebInspector.UIString(&quot;Content&quot;));
</del><ins>+    this._contentElement = document.getElementById(&quot;content&quot;);
+    this._contentElement.setAttribute(&quot;role&quot;, &quot;main&quot;);
+    this._contentElement.setAttribute(&quot;aria-label&quot;, WebInspector.UIString(&quot;Content&quot;));
</ins><span class="cx"> 
</span><span class="cx">     this.splitContentBrowser = new WebInspector.ContentBrowser(document.getElementById(&quot;split-content-browser&quot;), this, true);
</span><span class="cx">     this.splitContentBrowser.navigationBar.element.addEventListener(&quot;mousedown&quot;, this._consoleResizerMouseDown.bind(this));
</span><span class="lines">@@ -255,6 +255,8 @@
</span><span class="cx">     this._saveKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, &quot;S&quot;, this._save.bind(this));
</span><span class="cx">     this._saveAsKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Shift | WebInspector.KeyboardShortcut.Modifier.CommandOrControl, &quot;S&quot;, this._saveAs.bind(this));
</span><span class="cx"> 
</span><ins>+    this.openResourceKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Command | WebInspector.KeyboardShortcut.Modifier.Shift, &quot;O&quot;, this._showOpenResourceDialog.bind(this));
+
</ins><span class="cx">     this.navigationSidebarKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Option, &quot;L&quot;, this.toggleNavigationSidebar.bind(this));
</span><span class="cx">     this.detailsSidebarKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Option, &quot;R&quot;, this.toggleDetailsSidebar.bind(this));
</span><span class="cx"> 
</span><span class="lines">@@ -465,6 +467,17 @@
</span><span class="cx">     return new Set(this._knownTabClassesByType.values());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+WebInspector._showOpenResourceDialog = function()
+{
+    if (!this._openResourceDialog)
+        this._openResourceDialog = new WebInspector.OpenResourceDialog(this);
+
+    if (this._openResourceDialog.visible)
+        return;
+
+    this._openResourceDialog.present(this._contentElement);
+}
+
</ins><span class="cx"> WebInspector._createTabContentViewForType = function(tabType)
</span><span class="cx"> {
</span><span class="cx">     let tabClass = this._knownTabClassesByType.get(tabType);
</span><span class="lines">@@ -2396,3 +2409,14 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> };
</span><ins>+
+// OpenResourceDialog delegate
+
+WebInspector.dialogWasDismissed = function(dialog)
+{
+    let representedObject = dialog.representedObject;
+    if (!representedObject)
+        return;
+
+    WebInspector.showRepresentedObject(representedObject);
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceMainhtml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (197960 => 197961)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Main.html        2016-03-10 23:09:30 UTC (rev 197960)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html        2016-03-10 23:18:55 UTC (rev 197961)
</span><span class="lines">@@ -122,6 +122,7 @@
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/ObjectTreeMapEntryTreeElement.css&quot;&gt;
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/ObjectTreePropertyTreeElement.css&quot;&gt;
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/ObjectTreeView.css&quot;&gt;
</span><ins>+    &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/OpenResourceDialog.css&quot;&gt;
</ins><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/OverviewTimelineView.css&quot;&gt;
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/PathComponentIcons.css&quot;&gt;
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/Popover.css&quot;&gt;
</span><span class="lines">@@ -379,6 +380,7 @@
</span><span class="cx">     &lt;script src=&quot;Models/WrappedPromise.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> 
</span><span class="cx">     &lt;script src=&quot;Views/View.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Views/Dialog.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> 
</span><span class="cx">     &lt;script src=&quot;Views/ConsoleCommandView.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/ConsoleMessageView.js&quot;&gt;&lt;/script&gt;
</span><span class="lines">@@ -562,6 +564,7 @@
</span><span class="cx">     &lt;script src=&quot;Views/ObjectTreePropertyTreeElement.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/ObjectTreeSetIndexTreeElement.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/ObjectTreeView.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Views/OpenResourceDialog.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Views/OverviewTimelineView.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/Popover.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/ProbeDetailsSidebarPanel.js&quot;&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDialogjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/Dialog.js (0 => 197961)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/Dialog.js                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Dialog.js        2016-03-10 23:18:55 UTC (rev 197961)
</span><span class="lines">@@ -0,0 +1,103 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.Dialog = class Dialog extends WebInspector.View
+{
+    constructor(delegate)
+    {
+        super();
+
+        this._delegate = delegate;
+        this._dismissing = false;
+        this._representedObject = null;
+        this._visible = false;
+    }
+
+    // Public
+
+    get visible()
+    {
+        return this._visible;
+    }
+
+    get delegate()
+    {
+        return this._delegate;
+    }
+
+    get representedObject()
+    {
+        return this._representedObject;
+    }
+
+    present(parentElement)
+    {
+        console.assert(!this.element.parentNode);
+
+        parentElement.appendChild(this.element);
+
+        this._visible = true;
+
+        this.didPresentDialog();
+    }
+
+    dismiss(representedObject)
+    {
+        if (this._dismissing)
+            return;
+
+        let parent = this.element.parentNode;
+        if (!parent)
+            return;
+
+        this._dismissing = true;
+        this._representedObject = representedObject || null;
+        this._visible = false;
+
+        this.element.remove();
+
+        if (this._delegate &amp;&amp; typeof this._delegate.dialogWasDismissed === &quot;function&quot;)
+            this._delegate.dialogWasDismissed(this);
+
+        this._dismissing = false;
+    }
+
+    // Protected
+
+    didPresetDialog()
+    {
+        // Implemented by subclasses.
+    }
+
+    representedObjectIsValid(value)
+    {
+        // Can be overridden by subclasses.
+
+        if (this.delegate &amp;&amp; typeof this.delegate.isDialogRepresentedObjectValid === &quot;function&quot;)
+            return this.delegate.isDialogRepresentedObjectValid(this, value);
+
+        return true;
+    }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsGoToLineDialogjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/GoToLineDialog.js (197960 => 197961)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/GoToLineDialog.js        2016-03-10 23:09:30 UTC (rev 197960)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/GoToLineDialog.js        2016-03-10 23:18:55 UTC (rev 197961)
</span><span class="lines">@@ -23,16 +23,15 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-WebInspector.GoToLineDialog = class GoToLineDialog extends WebInspector.Object
</del><ins>+WebInspector.GoToLineDialog = class GoToLineDialog extends WebInspector.Dialog
</ins><span class="cx"> {
</span><del>-    constructor()
</del><ins>+    constructor(delegate)
</ins><span class="cx">     {
</span><del>-        super();
</del><ins>+        super(delegate);
</ins><span class="cx"> 
</span><del>-        this._element = document.createElement(&quot;div&quot;);
-        this._element.className = &quot;go-to-line-dialog&quot;;
</del><ins>+        this.element.classList.add(&quot;go-to-line-dialog&quot;);
</ins><span class="cx"> 
</span><del>-        var field = this._element.appendChild(document.createElement(&quot;div&quot;));
</del><ins>+        let field = this.element.appendChild(document.createElement(&quot;div&quot;));
</ins><span class="cx"> 
</span><span class="cx">         this._input = field.appendChild(document.createElement(&quot;input&quot;));
</span><span class="cx">         this._input.type = &quot;text&quot;;
</span><span class="lines">@@ -50,34 +49,6 @@
</span><span class="cx">         this._dismissing = false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // Public
-
-    present(parent)
-    {
-        parent.appendChild(this._element);
-        this._input.focus();
-        this._clear();
-    }
-
-    dismiss()
-    {
-        if (this._dismissing)
-            return;
-
-        var parent = this._element.parentNode;
-        if (!parent)
-            return;
-
-        this._dismissing = true;
-
-        parent.removeChild(this._element);
-
-        if (this.delegate &amp;&amp; typeof this.delegate.goToLineDialogWasDismissed === &quot;function&quot;)
-            this.delegate.goToLineDialogWasDismissed(this);
-
-        this._dismissing = false;
-    }
-
</del><span class="cx">     // Protected
</span><span class="cx"> 
</span><span class="cx">     handleEvent(event)
</span><span class="lines">@@ -101,14 +72,18 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    didPresentDialog()
+    {
+        this._input.focus();
+        this._clear();
+    }
+
</ins><span class="cx">     // Private
</span><span class="cx"> 
</span><span class="cx">     _handleInputEvent(event)
</span><span class="cx">     {
</span><del>-        if (this._input.value === &quot;&quot;)
-            this._element.classList.remove(WebInspector.GoToLineDialog.NonEmptyClassName);
-        else
-            this._element.classList.add(WebInspector.GoToLineDialog.NonEmptyClassName);
</del><ins>+        let force = this._input.value !== &quot;&quot;;
+        this.element.classList.toggle(WebInspector.GoToLineDialog.NonEmptyClassName, force);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     _handleKeydownEvent(event)
</span><span class="lines">@@ -121,19 +96,14 @@
</span><span class="cx"> 
</span><span class="cx">             event.preventDefault();
</span><span class="cx">         } else if (event.keyCode === WebInspector.KeyboardShortcut.Key.Enter.keyCode) {
</span><del>-            var value = parseInt(this._input.value, 10);
</del><ins>+            let value = parseInt(this._input.value, 10);
</ins><span class="cx"> 
</span><del>-            var valueIsValid = false;
-            if (this.delegate &amp;&amp; typeof this.delegate.isGoToLineDialogValueValid === &quot;function&quot;)
-                valueIsValid = this.delegate.isGoToLineDialogValueValid(this, value);
-
-            if (valueIsValid &amp;&amp; this.delegate &amp;&amp; typeof this.delegate.goToLineDialogValueWasValidated === &quot;function&quot;) {
-                this.delegate.goToLineDialogValueWasValidated(this, value);
-                this.dismiss();
</del><ins>+            if (this.representedObjectIsValid(value)) {
+                this.dismiss(value);
</ins><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            this._input.select();
</del><ins>+            this._inputElement.select();
</ins><span class="cx"> 
</span><span class="cx">             InspectorFrontendHost.beep();
</span><span class="cx">         }
</span><span class="lines">@@ -160,7 +130,7 @@
</span><span class="cx">     _clear()
</span><span class="cx">     {
</span><span class="cx">         this._input.value = &quot;&quot;;
</span><del>-        this._element.classList.remove(WebInspector.GoToLineDialog.NonEmptyClassName);
</del><ins>+        this.element.classList.remove(WebInspector.GoToLineDialog.NonEmptyClassName);
</ins><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsOpenResourceDialogcss"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.css (0 => 197961)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.css                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.css        2016-03-10 23:18:55 UTC (rev 197961)
</span><span class="lines">@@ -0,0 +1,109 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+.open-resource-dialog {
+    position: absolute;
+    left: 50%;
+    top: 50px;
+    width: calc(100% - 40px);
+    max-width: 452px;
+    max-height: calc(100% - 100px);
+    overflow: hidden;
+
+    transform: translate(-50%, 0);
+    border-radius: 5px;
+    background-color: hsl(0, 0%, 90%);
+    border: 1px hsl(0, 0%, 70%) solid;
+    box-shadow: 1px 5px 20px 3px hsla(0, 0%, 0%, 0.33);
+
+    z-index: var(--z-index-popover);
+}
+
+.open-resource-dialog &gt; .field {
+    margin: 3px;
+    border-radius: 4px;
+    background-color: white;
+    border: 1px hsl(0, 0%, 80%) solid;
+}
+
+.open-resource-dialog &gt; .field &gt; input {
+    display: block;
+    width: 100%;
+    border: none;
+    background-color: transparent;
+    font-size: 20px;
+    color: hsl(0, 0%, 4%);
+    padding: 0 34px 1px 7px;
+    outline: none;
+}
+
+.open-resource-dialog &gt; .field &gt; input::-webkit-input-placeholder {
+    color: hsl(0, 0%, 52%);
+}
+
+.open-resource-dialog &gt; .field &gt; img {
+    position: absolute;
+    top: 10px;
+    right: 12px;
+    padding: 2px;
+    border-radius: 9px;
+    width: 15px;
+    height: 15px;
+    background-color: hsl(0, 0%, 60%);
+    display: none;
+    content: url(../Images/CloseWhite.svg);
+}
+
+.open-resource-dialog &gt; .field &gt; img:active {
+    background-color: hsl(0, 0%, 54%);
+}
+
+.open-resource-dialog.non-empty &gt; .field &gt; img {
+    display: block;
+}
+
+.open-resource-dialog &gt; .tree-outline {
+    overflow-y: scroll;
+
+    border-bottom-left-radius: 4px;
+    border-bottom-right-radius: 4px;
+}
+
+.open-resource-dialog &gt; .tree-outline .item {
+    border-top-color: hsl(0, 0%, 94%);
+}
+
+.open-resource-dialog &gt; .tree-outline .item:first-child {
+    border: none;
+}
+
+.open-resource-dialog &gt; .tree-outline .item.selected {
+    color: white;
+    background-color: hsl(209, 100%, 49%);
+}
+
+.open-resource-dialog &gt; .tree-outline .item.selected .subtitle {
+    color: hsla(0, 0%, 100%, 0.9);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsOpenResourceDialogjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js (0 => 197961)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js        2016-03-10 23:18:55 UTC (rev 197961)
</span><span class="lines">@@ -0,0 +1,228 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.OpenResourceDialog = class OpenResourceDialog extends WebInspector.Dialog
+{
+    constructor(delegate)
+    {
+        super(delegate);
+
+        this.element.classList.add(&quot;open-resource-dialog&quot;);
+
+        let fieldElement = this.element.appendChild(document.createElement(&quot;div&quot;));
+        fieldElement.classList.add(&quot;field&quot;);
+
+        this._inputElement = fieldElement.appendChild(document.createElement(&quot;input&quot;));
+        this._inputElement.type = &quot;text&quot;;
+        this._inputElement.placeholder = WebInspector.UIString(&quot;File or Resource&quot;);
+        this._inputElement.spellcheck = false;
+
+        this._clearIconElement = fieldElement.appendChild(document.createElement(&quot;img&quot;));
+
+        this._inputElement.addEventListener(&quot;input&quot;, this._handleInputEvent.bind(this));
+        this._inputElement.addEventListener(&quot;keydown&quot;, this._handleKeydownEvent.bind(this));
+        this._inputElement.addEventListener(&quot;keyup&quot;, this._handleKeyupEvent.bind(this));
+        this._inputElement.addEventListener(&quot;blur&quot;, this._handleBlurEvent.bind(this));
+        this._clearIconElement.addEventListener(&quot;mousedown&quot;, this._handleMousedownEvent.bind(this));
+        this._clearIconElement.addEventListener(&quot;click&quot;, this._handleClickEvent.bind(this));
+
+        this._treeOutline = new WebInspector.TreeOutline(document.createElement(&quot;ol&quot;));
+        this._treeOutline.disclosureButtons = false;
+        this._treeOutline.large = true;
+
+        this._treeOutline.element.addEventListener(&quot;focus&quot;, () =&gt; {this._inputElement.focus();});
+
+        this.element.appendChild(this._treeOutline.element);
+
+        this._resources = [];
+        this._filteredResources = [];
+    }
+
+    // Protected
+
+    _populateResourceTreeOutline()
+    {
+        function createTreeElement(representedObject)
+        {
+            let treeElement = null;
+
+            if (representedObject instanceof WebInspector.SourceMapResource)
+                treeElement = new WebInspector.SourceMapResourceTreeElement(representedObject);
+            else if (representedObject instanceof WebInspector.Resource)
+                treeElement = new WebInspector.ResourceTreeElement(representedObject);
+            else if (representedObject instanceof WebInspector.Script)
+                treeElement = new WebInspector.ScriptTreeElement(representedObject);
+
+            return treeElement;
+        }
+
+        for (let resource of this._filteredResources) {
+            let treeElement = createTreeElement(resource);
+            if (!treeElement)
+                continue;
+
+            if (this._treeOutline.findTreeElement(resource))
+                continue;
+
+            this._treeOutline.appendChild(treeElement);
+        }
+
+        if (this._treeOutline.children.length)
+            this._treeOutline.children[0].select(true);
+    }
+
+    didPresentDialog()
+    {
+        this._inputElement.focus();
+        this._clear();
+
+        let frames = [WebInspector.frameResourceManager.mainFrame];
+        while (frames.length) {
+            let frame = frames.shift();
+            for (let resource of frame.resources) {
+                if (!this.representedObjectIsValid(resource))
+                    continue;
+
+                this._resources.push(resource);
+            }
+
+            frames = frames.concat(frame.childFrames);
+        }
+    }
+
+    // Private
+
+    _handleInputEvent(event)
+    {
+        let force = this._inputElement.value !== &quot;&quot;;
+        this.element.classList.toggle(WebInspector.OpenResourceDialog.NonEmptyClassName, force);
+    }
+
+    _handleKeydownEvent(event)
+    {
+        if (event.keyCode === WebInspector.KeyboardShortcut.Key.Escape.keyCode) {
+            if (this._inputElement.value === &quot;&quot;)
+                this.dismiss();
+            else
+                this._clear();
+
+            event.preventDefault();
+        } else if (event.keyCode === WebInspector.KeyboardShortcut.Key.Enter.keyCode) {
+            if (this._treeOutline.selectedTreeElement) {
+                this.dismiss(this._treeOutline.selectedTreeElement.representedObject);
+                return;
+            }
+
+            this._inputElement.select();
+        } else if (event.keyCode === WebInspector.KeyboardShortcut.Key.Up.keyCode || event.keyCode === WebInspector.KeyboardShortcut.Key.Down.keyCode) {
+            let treeElement = this._treeOutline.selectedTreeElement;
+            if (!treeElement)
+                return;
+
+            let adjacentSiblingProperty = event.keyCode === WebInspector.KeyboardShortcut.Key.Up.keyCode ? &quot;previousSibling&quot; : &quot;nextSibling&quot;;
+            treeElement = treeElement[adjacentSiblingProperty];
+            if (treeElement)
+                treeElement.revealAndSelect(true, false, true, true);
+
+            event.preventDefault();
+        }
+    }
+
+    _handleKeyupEvent(event)
+    {
+        if (event.keyCode === WebInspector.KeyboardShortcut.Key.Up.keyCode || event.keyCode === WebInspector.KeyboardShortcut.Key.Down.keyCode)
+            return;
+
+        this._updateFilter();
+    }
+
+    _handleBlurEvent(event)
+    {
+        this.dismiss();
+    }
+
+    _handleMousedownEvent(event)
+    {
+        this._inputElement.select();
+
+        // This ensures we don't get a &quot;blur&quot; event triggered for the text field
+        // which would end up dimissing the dialog, which is not the intent.
+        event.preventDefault();
+    }
+
+    _handleClickEvent(event)
+    {
+        this._clear();
+    }
+
+    _clear()
+    {
+        this._inputElement.value = &quot;&quot;;
+        this.element.classList.remove(WebInspector.OpenResourceDialog.NonEmptyClassName);
+        this._updateFilter();
+    }
+
+    _updateFilter()
+    {
+        this._filteredResources = [];
+        this._treeOutline.hidden = true;
+        this._treeOutline.removeChildren();
+
+        let filterText = this._inputElement.value.trim();
+        if (!filterText)
+            return;
+
+        let escapedFilterText = filterText.escapeForRegExp();
+        let r0 = new RegExp(&quot;^&quot; + escapedFilterText, &quot;i&quot;);
+        let r1 = simpleGlobStringToRegExp(filterText, &quot;i&quot;);
+        let r2 = new RegExp(&quot;^&quot; + escapedFilterText.toUpperCase().split(&quot;&quot;).join(&quot;.*?&quot;));
+        let filters = [r0, r1, r2];
+
+        for (let resource of this._resources) {
+            for (let i = 0; i &lt; filters.length; ++i) {
+                if (!filters[i].test(resource.displayName))
+                    continue;
+
+                resource.__weight = filters.length - i;
+                this._filteredResources.push(resource);
+                break;
+            }
+        }
+
+        // Sort filtered resources by weight, then alphabetically.
+        this._filteredResources.sort((a, b) =&gt; {
+            if (a.__weight === b.__weight)
+                return a.displayName.localeCompare(b.displayName);
+
+            return b.__weight - a.__weight;
+        });
+
+        this._populateResourceTreeOutline();
+        if (this._treeOutline.children.length)
+            this._treeOutline.hidden = false;
+    }
+};
+
+WebInspector.OpenResourceDialog.NonEmptyClassName = &quot;non-empty&quot;;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsResourceTreeElementjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTreeElement.js (197960 => 197961)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTreeElement.js        2016-03-10 23:09:30 UTC (rev 197960)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTreeElement.js        2016-03-10 23:18:55 UTC (rev 197961)
</span><span class="lines">@@ -83,7 +83,8 @@
</span><span class="cx"> 
</span><span class="cx">     get filterableData()
</span><span class="cx">     {
</span><del>-        return {text: [this._resource.url]};
</del><ins>+        let urlComponents = this._resource.urlComponents;
+        return {text: [urlComponents.lastPathComponent, urlComponents.path, this._resource.url]};
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ondblclick()
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSourceCodeTextEditorjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js (197960 => 197961)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js        2016-03-10 23:09:30 UTC (rev 197960)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js        2016-03-10 23:18:55 UTC (rev 197961)
</span><span class="lines">@@ -216,28 +216,24 @@
</span><span class="cx"> 
</span><span class="cx">     showGoToLineDialog()
</span><span class="cx">     {
</span><del>-        if (!this._goToLineDialog) {
-            this._goToLineDialog = new WebInspector.GoToLineDialog;
-            this._goToLineDialog.delegate = this;
-        }
</del><ins>+        if (!this._goToLineDialog)
+            this._goToLineDialog = new WebInspector.GoToLineDialog(this);
</ins><span class="cx"> 
</span><span class="cx">         this._goToLineDialog.present(this.element);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    isGoToLineDialogValueValid(goToLineDialog, lineNumber)
</del><ins>+    isDialogRepresentedObjectValid(goToLineDialog, lineNumber)
</ins><span class="cx">     {
</span><span class="cx">         return !isNaN(lineNumber) &amp;&amp; lineNumber &gt; 0 &amp;&amp; lineNumber &lt;= this.lineCount;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    goToLineDialogValueWasValidated(goToLineDialog, lineNumber)
</del><ins>+    dialogWasDismissed(goToLineDialog)
</ins><span class="cx">     {
</span><del>-        var position = new WebInspector.SourceCodePosition(lineNumber - 1, 0);
-        var range = new WebInspector.TextRange(lineNumber - 1, 0, lineNumber, 0);
-        this.revealPosition(position, range, false, true);
-    }
</del><ins>+        let lineNumber = goToLineDialog.representedObject;
+        let position = new WebInspector.SourceCodePosition(lineNumber - 1, 0);
+        let range = new WebInspector.TextRange(lineNumber - 1, 0, lineNumber, 0);
</ins><span class="cx"> 
</span><del>-    goToLineDialogWasDismissed()
-    {
</del><ins>+        this.revealPosition(position, range, false, true);
</ins><span class="cx">         this.focus();
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTreeOutlinecss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.css (197960 => 197961)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.css        2016-03-10 23:09:30 UTC (rev 197960)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.css        2016-03-10 23:18:55 UTC (rev 197961)
</span><span class="lines">@@ -182,7 +182,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .tree-outline.large .item .titles {
</span><del>-    top: 5px;
</del><ins>+    top: 10px;
</ins><span class="cx">     line-height: 11px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -191,10 +191,6 @@
</span><span class="cx">     border-bottom: 1px solid hsl(47, 82%, 60%);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.tree-outline.large .item .titles.no-subtitle {
-    top: 10px;
-}
-
</del><span class="cx"> .tree-outline .item .title::after {
</span><span class="cx">     content: &quot;\A&quot;; /* Newline */
</span><span class="cx">     white-space: pre;
</span></span></pre>
</div>
</div>

</body>
</html>