<!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>[188453] releases/WebKitGTK/webkit-2.10</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/188453">188453</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-08-14 03:40:34 -0700 (Fri, 14 Aug 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/188407">r188407</a> - Web Inspector: Watch Expressions
https://bugs.webkit.org/show_bug.cgi?id=147904
Reviewed by Brian Burg.
Source/WebInspectorUI:
* UserInterface/Protocol/RemoteObject.js:
(WebInspector.RemoteObject):
A RemoteObject's description string is optional, but we always
assume it exists and is a string, so default to the empty string.
* UserInterface/Controllers/RuntimeManager.js:
(WebInspector.RuntimeManager.prototype.evaluateInInspectedWindow.evalCallback):
Include the object group in the DidEvaluate event.
(WebInspector.RemoteObject.fakeRemoteObject):
(WebInspector.RemoteObject.prototype.getDisplayablePropertyDescriptors):
(WebInspector.RemoteObject.prototype.deprecatedGetDisplayableProperties.get return):
(WebInspector.RemoteObject.prototype.deprecatedGetDisplayableProperties):
(WebInspector.RemoteObject.prototype._isFakeObject):
(WebInspector.RemoteObject.prototype._getPropertyDescriptors):
(WebInspector.RemoteObject.prototype._deprecatedGetProperties):
Support a fake RemoteObject. We use this fake RemoteObject to
back a ObjectTreeView where we add custom Properties which are of the form
"Expressions => RemoteObject" instead of "Object Property => RemoteObject".
Ensure a fake remote object is not used in unexpected ways.
* UserInterface/Views/Popover.js:
(WebInspector.Popover.prototype.update):
Default a popover update to animate, but allow not animating.
(WebInspector.Popover.prototype.handleEvent):
Vend a class that other content can use so that the Popover won't
dismiss if content with that class is scrolled. For example, a
completions list may be showing over a popover, if that scrolls
it should not dismiss the popover.
* UserInterface/Views/CompletionSuggestionsView.js:
(WebInspector.CompletionSuggestionsView):
Adopt the Popover ignore class so a popover won't dismiss if the
completion suggestions view is scrolled.
* UserInterface/Views/ObjectTreeBaseTreeElement.js:
(WebInspector.ObjectTreeBaseTreeElement.prototype.createGetterElement.get return):
(WebInspector.ObjectTreeBaseTreeElement.prototype.createGetterElement):
Allow modifying the context menu on an ObjectTreeView by looking for a delegate
on the TreeOutline.
* UserInterface/Views/ScopeChainDetailsSidebarPanel.css: Added.
(.details-section.watch-expressions .options > *):
(.details-section.watch-expressions .options > *:active):
(.details-section.watch-expressions .options > .watch-expression-add):
(.details-section.watch-expressions .options > .watch-expression-clear):
(.details-section.watch-expressions .options > .watch-expression-refresh):
(.popover .watch-expression):
(.watch-expression-editor):
(.watch-expression-editor > .CodeMirror):
(.watch-expression-editor > .CodeMirror-scroll):
Styles for the new Watch Expressions section, buttons, popover, and editor.
* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
(WebInspector.ScopeChainDetailsSidebarPanel):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype.inspect):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype.refresh):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateCallFramesSection):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateWatchExpressionsSection):
Because we update the UI after a delay, to allow ObjectTreeView's to asynchronously
expand and fetch their list of properties, we convert updating the watch expression
and call frame sections asynchronously and return a promise. This lets us visually
update the UI after both sections have updated.
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._addWatchExpression):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._removeWatchExpression):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._clearAllWatchExpressions):
Modify the saved list of watch expressions.
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._addWatchExpressionButtonClicked.presentPopoverOverTargetElement):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._addWatchExpressionButtonClicked.this._codeMirror.addKeyMap):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._addWatchExpressionButtonClicked):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype.willDismissPopover):
Handle presenting and dismissing the add watch expression popover.
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._refreshAllWatchExpressionsButtonClicked):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._clearAllWatchExpressionsButtonClicked):
Other button handlers.
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._mainResourceDidChange):
Refresh the sidebar on navigation, as the watch expressions may change value (`location.href`).
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeElementAddContextMenuItems):
Add our own context menu items to watch expression ObjectTreeView tree elements to
allow removing a watch expression.
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._propertyPathIdentifierForTreeElement):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeAddHandler):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeExpandHandler):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeCollapseHandler):
Convert code to use `let`.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Main.html:
Misc. changes.
LayoutTests:
* inspector/model/remote-object-fake-object-expected.txt: Added.
* inspector/model/remote-object-fake-object.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebInspectorUIChangeLog">releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebInspectorUILocalizationsenlprojlocalizedStringsjs">releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebInspectorUIUserInterfaceControllersRuntimeManagerjs">releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Controllers/RuntimeManager.js</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebInspectorUIUserInterfaceMainhtml">releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Main.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebInspectorUIUserInterfaceProtocolRemoteObjectjs">releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebInspectorUIUserInterfaceViewsCompletionSuggestionsViewjs">releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Views/CompletionSuggestionsView.js</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebInspectorUIUserInterfaceViewsObjectTreeBaseTreeElementjs">releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Views/ObjectTreeBaseTreeElement.js</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebInspectorUIUserInterfaceViewsPopoverjs">releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Views/Popover.js</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebInspectorUIUserInterfaceViewsScopeChainDetailsSidebarPaneljs">releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsinspectormodelremoteobjectfakeobjectexpectedtxt">releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/model/remote-object-fake-object-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsinspectormodelremoteobjectfakeobjecthtml">releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/model/remote-object-fake-object.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebInspectorUIUserInterfaceViewsScopeChainDetailsSidebarPanelcss">releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.css</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit210LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog (188452 => 188453)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog        2015-08-14 10:38:42 UTC (rev 188452)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog        2015-08-14 10:40:34 UTC (rev 188453)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2015-08-13 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Watch Expressions
+ https://bugs.webkit.org/show_bug.cgi?id=147904
+
+ Reviewed by Brian Burg.
+
+ * inspector/model/remote-object-fake-object-expected.txt: Added.
+ * inspector/model/remote-object-fake-object.html: Added.
+
</ins><span class="cx"> 2015-08-13 Brian Burg <bburg@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: refactor ProtocolTest to be an InjectedTestHarness subclass
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsinspectormodelremoteobjectfakeobjectexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/model/remote-object-fake-object-expected.txt (0 => 188453)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/model/remote-object-fake-object-expected.txt         (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/model/remote-object-fake-object-expected.txt        2015-08-14 10:40:34 UTC (rev 188453)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+PASS: A fake remote object should have object type.
+PASS: Each fake remote object instance should be unique.
+PASS: A fake remote object should have an empty list of own properties.
+PASS: A fake remote object should have an empty list of displayable properties.
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsinspectormodelremoteobjectfakeobjecthtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/model/remote-object-fake-object.html (0 => 188453)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/model/remote-object-fake-object.html         (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/model/remote-object-fake-object.html        2015-08-14 10:40:34 UTC (rev 188453)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script>
+function test()
+{
+ let fakeObject = WebInspector.RemoteObject.createFakeRemoteObject();
+
+ InspectorTest.assert(fakeObject instanceof WebInspector.RemoteObject);
+ InspectorTest.assert(fakeObject.objectId === WebInspector.RemoteObject.FakeRemoteObjectId);
+ InspectorTest.expectThat(fakeObject.type === "object" && !fakeObject.subtype, "A fake remote object should have object type.");
+ InspectorTest.expectThat(fakeObject !== WebInspector.RemoteObject.createFakeRemoteObject(), "Each fake remote object instance should be unique.");
+
+ fakeObject.getOwnPropertyDescriptors(function(properties) {
+ InspectorTest.expectThat(Array.isArray(properties) && !properties.length, "A fake remote object should have an empty list of own properties.");
+ });
+
+ fakeObject.getDisplayablePropertyDescriptors(function(properties) {
+ InspectorTest.expectThat(Array.isArray(properties) && !properties.length, "A fake remote object should have an empty list of displayable properties.");
+ InspectorTest.completeTest();
+ });
+}
+</script>
+</head>
+<body onload="runTest()">
+</body>
+</html>
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/ChangeLog (188452 => 188453)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/ChangeLog        2015-08-14 10:38:42 UTC (rev 188452)
+++ releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/ChangeLog        2015-08-14 10:40:34 UTC (rev 188453)
</span><span class="lines">@@ -1,5 +1,109 @@
</span><span class="cx"> 2015-08-13 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><ins>+ Web Inspector: Watch Expressions
+ https://bugs.webkit.org/show_bug.cgi?id=147904
+
+ Reviewed by Brian Burg.
+
+ * UserInterface/Protocol/RemoteObject.js:
+ (WebInspector.RemoteObject):
+ A RemoteObject's description string is optional, but we always
+ assume it exists and is a string, so default to the empty string.
+
+ * UserInterface/Controllers/RuntimeManager.js:
+ (WebInspector.RuntimeManager.prototype.evaluateInInspectedWindow.evalCallback):
+ Include the object group in the DidEvaluate event.
+
+ (WebInspector.RemoteObject.fakeRemoteObject):
+ (WebInspector.RemoteObject.prototype.getDisplayablePropertyDescriptors):
+ (WebInspector.RemoteObject.prototype.deprecatedGetDisplayableProperties.get return):
+ (WebInspector.RemoteObject.prototype.deprecatedGetDisplayableProperties):
+ (WebInspector.RemoteObject.prototype._isFakeObject):
+ (WebInspector.RemoteObject.prototype._getPropertyDescriptors):
+ (WebInspector.RemoteObject.prototype._deprecatedGetProperties):
+ Support a fake RemoteObject. We use this fake RemoteObject to
+ back a ObjectTreeView where we add custom Properties which are of the form
+ "Expressions => RemoteObject" instead of "Object Property => RemoteObject".
+ Ensure a fake remote object is not used in unexpected ways.
+
+ * UserInterface/Views/Popover.js:
+ (WebInspector.Popover.prototype.update):
+ Default a popover update to animate, but allow not animating.
+
+ (WebInspector.Popover.prototype.handleEvent):
+ Vend a class that other content can use so that the Popover won't
+ dismiss if content with that class is scrolled. For example, a
+ completions list may be showing over a popover, if that scrolls
+ it should not dismiss the popover.
+
+ * UserInterface/Views/CompletionSuggestionsView.js:
+ (WebInspector.CompletionSuggestionsView):
+ Adopt the Popover ignore class so a popover won't dismiss if the
+ completion suggestions view is scrolled.
+
+ * UserInterface/Views/ObjectTreeBaseTreeElement.js:
+ (WebInspector.ObjectTreeBaseTreeElement.prototype.createGetterElement.get return):
+ (WebInspector.ObjectTreeBaseTreeElement.prototype.createGetterElement):
+ Allow modifying the context menu on an ObjectTreeView by looking for a delegate
+ on the TreeOutline.
+
+ * UserInterface/Views/ScopeChainDetailsSidebarPanel.css: Added.
+ (.details-section.watch-expressions .options > *):
+ (.details-section.watch-expressions .options > *:active):
+ (.details-section.watch-expressions .options > .watch-expression-add):
+ (.details-section.watch-expressions .options > .watch-expression-clear):
+ (.details-section.watch-expressions .options > .watch-expression-refresh):
+ (.popover .watch-expression):
+ (.watch-expression-editor):
+ (.watch-expression-editor > .CodeMirror):
+ (.watch-expression-editor > .CodeMirror-scroll):
+ Styles for the new Watch Expressions section, buttons, popover, and editor.
+
+ * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
+ (WebInspector.ScopeChainDetailsSidebarPanel):
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype.inspect):
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype.refresh):
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateCallFramesSection):
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateWatchExpressionsSection):
+ Because we update the UI after a delay, to allow ObjectTreeView's to asynchronously
+ expand and fetch their list of properties, we convert updating the watch expression
+ and call frame sections asynchronously and return a promise. This lets us visually
+ update the UI after both sections have updated.
+
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype._addWatchExpression):
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype._removeWatchExpression):
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype._clearAllWatchExpressions):
+ Modify the saved list of watch expressions.
+
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype._addWatchExpressionButtonClicked.presentPopoverOverTargetElement):
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype._addWatchExpressionButtonClicked.this._codeMirror.addKeyMap):
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype._addWatchExpressionButtonClicked):
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype.willDismissPopover):
+ Handle presenting and dismissing the add watch expression popover.
+
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype._refreshAllWatchExpressionsButtonClicked):
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype._clearAllWatchExpressionsButtonClicked):
+ Other button handlers.
+
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype._mainResourceDidChange):
+ Refresh the sidebar on navigation, as the watch expressions may change value (`location.href`).
+
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeElementAddContextMenuItems):
+ Add our own context menu items to watch expression ObjectTreeView tree elements to
+ allow removing a watch expression.
+
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype._propertyPathIdentifierForTreeElement):
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeAddHandler):
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeExpandHandler):
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeCollapseHandler):
+ Convert code to use `let`.
+
+ * Localizations/en.lproj/localizedStrings.js:
+ * UserInterface/Main.html:
+ Misc. changes.
+
+2015-08-13 Joseph Pecoraro <pecoraro@apple.com>
+
</ins><span class="cx"> Web Inspector: A {Map, WeakMap, Set, WeakSet} object contains itself will hang the console
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=147966
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (188452 => 188453)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-08-14 10:38:42 UTC (rev 188452)
+++ releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-08-14 10:40:34 UTC (rev 188453)
</span><span class="lines">@@ -45,6 +45,8 @@
</span><span class="cx"> localizedStrings["Add Breakpoint"] = "Add Breakpoint";
</span><span class="cx"> localizedStrings["Add New"] = "Add New";
</span><span class="cx"> localizedStrings["Add New Probe Expression"] = "Add New Probe Expression";
</span><ins>+localizedStrings["Add New Watch Expression"] = "Add New Watch Expression";
+localizedStrings["Add Watch Expression"] = "Add Watch Expression";
</ins><span class="cx"> localizedStrings["Add new breakpoint action after this action"] = "Add new breakpoint action after this action";
</span><span class="cx"> localizedStrings["Additions"] = "Additions";
</span><span class="cx"> localizedStrings["All"] = "All";
</span><span class="lines">@@ -91,6 +93,7 @@
</span><span class="cx"> localizedStrings["Checked"] = "Checked";
</span><span class="cx"> localizedStrings["Child Layers"] = "Child Layers";
</span><span class="cx"> localizedStrings["Children"] = "Children";
</span><ins>+localizedStrings["Clear All Watch Expressions"] = "Clear All Watch Expressions";
</ins><span class="cx"> localizedStrings["Clear Log"] = "Clear Log";
</span><span class="cx"> localizedStrings["Clear Log on Navigation"] = "Clear Log on Navigation";
</span><span class="cx"> localizedStrings["Clear Timeline"] = "Clear Timeline";
</span><span class="lines">@@ -359,6 +362,7 @@
</span><span class="cx"> localizedStrings["No Results Found"] = "No Results Found";
</span><span class="cx"> localizedStrings["No Search Results"] = "No Search Results";
</span><span class="cx"> localizedStrings["No Units"] = "No Units";
</span><ins>+localizedStrings["No Watch Expressions"] = "No Watch Expressions";
</ins><span class="cx"> localizedStrings["No exact ARIA role match."] = "No exact ARIA role match.";
</span><span class="cx"> localizedStrings["No message"] = "No message";
</span><span class="cx"> localizedStrings["No properties."] = "No properties.";
</span><span class="lines">@@ -408,10 +412,12 @@
</span><span class="cx"> localizedStrings["Reference Issue"] = "Reference Issue";
</span><span class="cx"> localizedStrings["Reflection"] = "Reflection";
</span><span class="cx"> localizedStrings["Refresh"] = "Refresh";
</span><ins>+localizedStrings["Refresh All Watch Expressions"] = "Refresh All Watch Expressions";
</ins><span class="cx"> localizedStrings["Region Flow"] = "Region Flow";
</span><span class="cx"> localizedStrings["Region announced in its entirety."] = "Region announced in its entirety.";
</span><span class="cx"> localizedStrings["Reload page (%s)\nReload ignoring cache (%s)"] = "Reload page (%s)\nReload ignoring cache (%s)";
</span><span class="cx"> localizedStrings["Removals"] = "Removals";
</span><ins>+localizedStrings["Remove Watch Expression"] = "Remove Watch Expression";
</ins><span class="cx"> localizedStrings["Remove this breakpoint action"] = "Remove this breakpoint action";
</span><span class="cx"> localizedStrings["Rendering Frames"] = "Rendering Frames";
</span><span class="cx"> localizedStrings["Repeating Linear Gradient"] = "Repeating Linear Gradient";
</span><span class="lines">@@ -540,6 +546,7 @@
</span><span class="cx"> localizedStrings["Value"] = "Value";
</span><span class="cx"> localizedStrings["Warning: "] = "Warning: ";
</span><span class="cx"> localizedStrings["Warnings"] = "Warnings";
</span><ins>+localizedStrings["Watch Expressions"] = "Watch Expressions";
</ins><span class="cx"> localizedStrings["Web Inspector"] = "Web Inspector";
</span><span class="cx"> localizedStrings["Width"] = "Width";
</span><span class="cx"> localizedStrings["With Object Properties"] = "With Object Properties";
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebInspectorUIUserInterfaceControllersRuntimeManagerjs"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Controllers/RuntimeManager.js (188452 => 188453)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Controllers/RuntimeManager.js        2015-08-14 10:38:42 UTC (rev 188452)
+++ releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Controllers/RuntimeManager.js        2015-08-14 10:40:34 UTC (rev 188453)
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx">
</span><span class="cx"> function evalCallback(error, result, wasThrown, savedResultIndex)
</span><span class="cx"> {
</span><del>- this.dispatchEventToListeners(WebInspector.RuntimeManager.Event.DidEvaluate);
</del><ins>+ this.dispatchEventToListeners(WebInspector.RuntimeManager.Event.DidEvaluate, {objectGroup});
</ins><span class="cx">
</span><span class="cx"> if (error) {
</span><span class="cx"> console.error(error);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebInspectorUIUserInterfaceMainhtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Main.html (188452 => 188453)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Main.html        2015-08-14 10:38:42 UTC (rev 188452)
+++ releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Main.html        2015-08-14 10:40:34 UTC (rev 188453)
</span><span class="lines">@@ -128,6 +128,7 @@
</span><span class="cx"> <link rel="stylesheet" href="Views/ResourceTreeElement.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/RulesStyleDetailsPanel.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/ScopeBar.css">
</span><ins>+ <link rel="stylesheet" href="Views/ScopeChainDetailsSidebarPanel.css">
</ins><span class="cx"> <link rel="stylesheet" href="Views/ScopeRadioButtonNavigationItem.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/ScriptContentView.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/ScriptTimelineOverviewGraph.css">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebInspectorUIUserInterfaceProtocolRemoteObjectjs"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js (188452 => 188453)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js        2015-08-14 10:38:42 UTC (rev 188452)
+++ releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js        2015-08-14 10:40:34 UTC (rev 188453)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx"> console.assert(!value);
</span><span class="cx">
</span><span class="cx"> this._objectId = objectId;
</span><del>- this._description = description;
</del><ins>+ this._description = description || "";
</ins><span class="cx"> this._hasChildren = type !== "symbol";
</span><span class="cx"> this._size = size;
</span><span class="cx"> this._classPrototype = classPrototype;
</span><span class="lines">@@ -69,6 +69,11 @@
</span><span class="cx">
</span><span class="cx"> // Static
</span><span class="cx">
</span><ins>+ static createFakeRemoteObject()
+ {
+ return new WebInspector.RemoteObject(WebInspector.RemoteObject.FakeRemoteObjectId, "object");
+ }
+
</ins><span class="cx"> static fromPrimitiveValue(value)
</span><span class="cx"> {
</span><span class="cx"> return new WebInspector.RemoteObject(undefined, typeof value, undefined, value, undefined, undefined, undefined, undefined);
</span><span class="lines">@@ -219,7 +224,7 @@
</span><span class="cx">
</span><span class="cx"> getDisplayablePropertyDescriptors(callback)
</span><span class="cx"> {
</span><del>- if (!this._objectId || this._isSymbol()) {
</del><ins>+ if (!this._objectId || this._isSymbol() || this._isFakeObject()) {
</ins><span class="cx"> callback([]);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -266,7 +271,7 @@
</span><span class="cx">
</span><span class="cx"> deprecatedGetDisplayableProperties(callback)
</span><span class="cx"> {
</span><del>- if (!this._objectId || this._isSymbol()) {
</del><ins>+ if (!this._objectId || this._isSymbol() || this._isFakeObject()) {
</ins><span class="cx"> callback([]);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -301,7 +306,7 @@
</span><span class="cx">
</span><span class="cx"> setPropertyValue(name, value, callback)
</span><span class="cx"> {
</span><del>- if (!this._objectId || this._isSymbol()) {
</del><ins>+ if (!this._objectId || this._isSymbol() || this._isFakeObject()) {
</ins><span class="cx"> callback("Can't set a property of non-object.");
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -457,7 +462,7 @@
</span><span class="cx">
</span><span class="cx"> release()
</span><span class="cx"> {
</span><del>- if (this._objectId)
</del><ins>+ if (this._objectId && !this._isFakeObject())
</ins><span class="cx"> RuntimeAgent.releaseObject(this._objectId);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -510,6 +515,11 @@
</span><span class="cx">
</span><span class="cx"> // Private
</span><span class="cx">
</span><ins>+ _isFakeObject()
+ {
+ return this._objectId === WebInspector.RemoteObject.FakeRemoteObjectId;
+ }
+
</ins><span class="cx"> _isSymbol()
</span><span class="cx"> {
</span><span class="cx"> return this._type === "symbol";
</span><span class="lines">@@ -527,7 +537,7 @@
</span><span class="cx">
</span><span class="cx"> _getPropertyDescriptors(ownProperties, callback)
</span><span class="cx"> {
</span><del>- if (!this._objectId || this._isSymbol()) {
</del><ins>+ if (!this._objectId || this._isSymbol() || this._isFakeObject()) {
</ins><span class="cx"> callback([]);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -571,7 +581,7 @@
</span><span class="cx"> // FIXME: Phase out these deprecated functions. They return DeprecatedRemoteObjectProperty instead of PropertyDescriptors.
</span><span class="cx"> _deprecatedGetProperties(ownProperties, callback)
</span><span class="cx"> {
</span><del>- if (!this._objectId || this._isSymbol()) {
</del><ins>+ if (!this._objectId || this._isSymbol() || this._isFakeObject()) {
</ins><span class="cx"> callback([]);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -612,6 +622,8 @@
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+WebInspector.RemoteObject.FakeRemoteObjectId = "fake-remote-object";
+
</ins><span class="cx"> WebInspector.RemoteObject.SourceCodeLocationPromise = {
</span><span class="cx"> NoSourceFound: "remote-object-source-code-location-promise-no-source-found",
</span><span class="cx"> MissingObjectId: "remote-object-source-code-location-promise-missing-object-id"
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebInspectorUIUserInterfaceViewsCompletionSuggestionsViewjs"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Views/CompletionSuggestionsView.js (188452 => 188453)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Views/CompletionSuggestionsView.js        2015-08-14 10:38:42 UTC (rev 188452)
+++ releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Views/CompletionSuggestionsView.js        2015-08-14 10:40:34 UTC (rev 188453)
</span><span class="lines">@@ -34,10 +34,10 @@
</span><span class="cx"> this._selectedIndex = NaN;
</span><span class="cx">
</span><span class="cx"> this._element = document.createElement("div");
</span><del>- this._element.className = "completion-suggestions";
</del><ins>+ this._element.classList.add("completion-suggestions", WebInspector.Popover.IgnoreAutoDismissClassName);
</ins><span class="cx">
</span><span class="cx"> this._containerElement = document.createElement("div");
</span><del>- this._containerElement.className = "completion-suggestions-container";
</del><ins>+ this._containerElement.classList.add("completion-suggestions-container");
</ins><span class="cx"> this._containerElement.addEventListener("mousedown", this._mouseDown.bind(this));
</span><span class="cx"> this._containerElement.addEventListener("mouseup", this._mouseUp.bind(this));
</span><span class="cx"> this._containerElement.addEventListener("click", this._itemClicked.bind(this));
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebInspectorUIUserInterfaceViewsObjectTreeBaseTreeElementjs"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Views/ObjectTreeBaseTreeElement.js (188452 => 188453)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Views/ObjectTreeBaseTreeElement.js        2015-08-14 10:38:42 UTC (rev 188452)
+++ releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Views/ObjectTreeBaseTreeElement.js        2015-08-14 10:40:34 UTC (rev 188453)
</span><span class="lines">@@ -182,12 +182,21 @@
</span><span class="cx">
</span><span class="cx"> _contextMenuHandler(event)
</span><span class="cx"> {
</span><ins>+ var contextMenu = new WebInspector.ContextMenu(event);
+
+ if (typeof this.treeOutline.objectTreeElementAddContextMenuItems === "function") {
+ this.treeOutline.objectTreeElementAddContextMenuItems(this, contextMenu);
+ if (!contextMenu.isEmpty())
+ contextMenu.appendSeparator();
+ }
+
</ins><span class="cx"> var resolvedValue = this.resolvedValue();
</span><del>- if (!resolvedValue)
</del><ins>+ if (!resolvedValue) {
+ if (!contextMenu.isEmpty())
+ contextMenu.show();
</ins><span class="cx"> return;
</span><ins>+ }
</ins><span class="cx">
</span><del>- var contextMenu = new WebInspector.ContextMenu(event);
-
</del><span class="cx"> if (this._property && this._property.symbol)
</span><span class="cx"> contextMenu.appendItem(WebInspector.UIString("Log Symbol"), this._logSymbolProperty.bind(this));
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebInspectorUIUserInterfaceViewsPopoverjs"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Views/Popover.js (188452 => 188453)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Views/Popover.js        2015-08-14 10:38:42 UTC (rev 188452)
+++ releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Views/Popover.js        2015-08-14 10:40:34 UTC (rev 188453)
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx"> this._update(true);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- update()
</del><ins>+ update(shouldAnimate = true)
</ins><span class="cx"> {
</span><span class="cx"> if (!this.visible)
</span><span class="cx"> return;
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx"> var previouslyFocusedElement = document.activeElement;
</span><span class="cx">
</span><span class="cx"> this._contentNeedsUpdate = true;
</span><del>- this._update(true);
</del><ins>+ this._update(shouldAnimate);
</ins><span class="cx">
</span><span class="cx"> if (previouslyFocusedElement)
</span><span class="cx"> previouslyFocusedElement.focus();
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx"> switch (event.type) {
</span><span class="cx"> case "mousedown":
</span><span class="cx"> case "scroll":
</span><del>- if (!this._element.contains(event.target))
</del><ins>+ if (!this._element.contains(event.target) && !event.target.enclosingNodeOrSelfWithClass(WebInspector.Popover.IgnoreAutoDismissClassName))
</ins><span class="cx"> this.dismiss();
</span><span class="cx"> break;
</span><span class="cx"> case "transitionend":
</span><span class="lines">@@ -555,3 +555,4 @@
</span><span class="cx"> WebInspector.Popover.ContentPadding = 5;
</span><span class="cx"> WebInspector.Popover.AnchorSize = new WebInspector.Size(22, 11);
</span><span class="cx"> WebInspector.Popover.ShadowEdgeInsets = new WebInspector.EdgeInsets(WebInspector.Popover.ShadowPadding);
</span><ins>+WebInspector.Popover.IgnoreAutoDismissClassName = "popover-ignore-auto-dismiss";
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebInspectorUIUserInterfaceViewsScopeChainDetailsSidebarPanelcss"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.css (0 => 188453)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.css         (rev 0)
+++ releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.css        2015-08-14 10:40:34 UTC (rev 188453)
</span><span class="lines">@@ -0,0 +1,71 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+.details-section.watch-expressions .options > * {
+ float: right;
+ margin-top: 1px;
+ margin-left: 5px;
+ height: 13px;
+}
+
+.details-section.watch-expressions .options > *:active {
+ opacity: 0.7;
+}
+
+.details-section.watch-expressions .options > .watch-expression-add {
+ content: url(../Images/Plus.svg);
+}
+
+.details-section.watch-expressions .options > .watch-expression-clear {
+ content: url(../Images/NavigationItemTrash.svg);
+}
+
+.details-section.watch-expressions .options > .watch-expression-refresh {
+ content: url(../Images/ReloadFull.svg);
+}
+
+.popover .watch-expression {
+ padding: 5px;
+ margin: 2px;
+}
+
+.watch-expression-editor {
+ width: 200px;
+ margin-top: 5px;
+ padding: 4px 0 2px 0;
+ -webkit-appearance: textfield;
+ border: 1px solid hsl(0, 0%, 78%);
+ background: white;
+}
+
+.watch-expression-editor > .CodeMirror {
+ width: calc(100% - 2px);
+ height: auto;
+}
+
+.watch-expression-editor > .CodeMirror-scroll {
+ width: calc(100% - 2px);
+ overflow: hidden;
+}
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebInspectorUIUserInterfaceViewsScopeChainDetailsSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js (188452 => 188453)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js        2015-08-14 10:38:42 UTC (rev 188452)
+++ releases/WebKitGTK/webkit-2.10/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js        2015-08-14 10:40:34 UTC (rev 188453)
</span><span class="lines">@@ -31,8 +31,40 @@
</span><span class="cx">
</span><span class="cx"> this._callFrame = null;
</span><span class="cx">
</span><ins>+ this._watchExpressionsSetting = new WebInspector.Setting("watch-expressions", []);
+
+ this._watchExpressionOptionsElement = document.createElement("div");
+ this._watchExpressionOptionsElement.classList.add("options");
+
+ let refreshAllWatchExpressionButton = this._watchExpressionOptionsElement.appendChild(document.createElement("img"));
+ refreshAllWatchExpressionButton.classList.add("watch-expression-refresh");
+ refreshAllWatchExpressionButton.setAttribute("role", "button");
+ refreshAllWatchExpressionButton.title = WebInspector.UIString("Refresh All Watch Expressions");
+ refreshAllWatchExpressionButton.addEventListener("click", this._refreshAllWatchExpressionsButtonClicked.bind(this));
+
+ let clearAllWatchExpressionButton = this._watchExpressionOptionsElement.appendChild(document.createElement("img"));
+ clearAllWatchExpressionButton.classList.add("watch-expression-clear");
+ clearAllWatchExpressionButton.setAttribute("role", "button");
+ clearAllWatchExpressionButton.title = WebInspector.UIString("Clear All Watch Expressions");
+ clearAllWatchExpressionButton.addEventListener("click", this._clearAllWatchExpressionsButtonClicked.bind(this));
+
+ let addWatchExpressionButton = this._watchExpressionOptionsElement.appendChild(document.createElement("img"));
+ addWatchExpressionButton.classList.add("watch-expression-add");
+ addWatchExpressionButton.title = WebInspector.UIString("Add Watch Expression");
+ addWatchExpressionButton.setAttribute("role", "button");
+ addWatchExpressionButton.addEventListener("click", this._addWatchExpressionButtonClicked.bind(this));
+
+ this._watchExpressionsSectionGroup = new WebInspector.DetailsSectionGroup;
+ this._watchExpressionsSection = new WebInspector.DetailsSection("watch-expressions", WebInspector.UIString("Watch Expressions"), [this._watchExpressionsSectionGroup], this._watchExpressionOptionsElement);
+ this.contentElement.appendChild(this._watchExpressionsSection.element);
+
+ this.needsRefresh();
+
</ins><span class="cx"> // Update on console prompt eval as objects in the scope chain may have changed.
</span><del>- WebInspector.runtimeManager.addEventListener(WebInspector.RuntimeManager.Event.DidEvaluate, this.needsRefresh, this);
</del><ins>+ WebInspector.runtimeManager.addEventListener(WebInspector.RuntimeManager.Event.DidEvaluate, this._didEvaluateExpression, this);
+
+ // Update watch expressions on navigations.
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Public
</span><span class="lines">@@ -55,7 +87,7 @@
</span><span class="cx">
</span><span class="cx"> this.callFrame = callFrameToInspect;
</span><span class="cx">
</span><del>- return !!this.callFrame;
</del><ins>+ return true;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> get callFrame()
</span><span class="lines">@@ -75,25 +107,69 @@
</span><span class="cx">
</span><span class="cx"> refresh()
</span><span class="cx"> {
</span><del>- var callFrame = this.callFrame;
</del><ins>+ let callFrame = this._callFrame;
+
+ Promise.all([this._generateWatchExpressionsSection(), this._generateCallFramesSection()]).then(function(sections) {
+ let [watchExpressionsSection, callFrameSections] = sections;
+
+ function delayedWork()
+ {
+ // Clear the timeout so we don't update the interface twice.
+ clearTimeout(timeout);
+
+ if (watchExpressionsSection)
+ this._watchExpressionsSectionGroup.rows = [watchExpressionsSection];
+ else {
+ let emptyRow = new WebInspector.DetailsSectionRow(WebInspector.UIString("No Watch Expressions"));
+ this._watchExpressionsSectionGroup.rows = [emptyRow];
+ emptyRow.showEmptyMessage();
+ }
+
+ this.contentElement.removeChildren();
+ this.contentElement.appendChild(this._watchExpressionsSection.element);
+
+ // Bail if the call frame changed while we were waiting for the async response.
+ if (this._callFrame !== callFrame)
+ return;
+
+ if (!callFrameSections)
+ return;
+
+ for (let callFrameSection of callFrameSections)
+ this.contentElement.appendChild(callFrameSection.element);
+ }
+
+ // We need a timeout in place in case there are long running, pending backend dispatches. This can happen
+ // if the debugger is paused in code that was executed from the console. The console will be waiting for
+ // the result of the execution and without a timeout we would never update the scope variables.
+ let delay = WebInspector.ScopeChainDetailsSidebarPanel._autoExpandProperties.size === 0 ? 50 : 250;
+ let timeout = setTimeout(delayedWork.bind(this), delay);
+
+ // Since ObjectTreeView populates asynchronously, we want to wait to replace the existing content
+ // until after all the pending asynchronous requests are completed. This prevents severe flashing while stepping.
+ InspectorBackend.runAfterPendingDispatches(delayedWork.bind(this));
+ }.bind(this)).catch(function(e) { console.error(e); });
+ }
+
+ _generateCallFramesSection()
+ {
+ let callFrame = this._callFrame;
</ins><span class="cx"> if (!callFrame)
</span><del>- return;
</del><ins>+ return Promise.resolve(null);
</ins><span class="cx">
</span><del>- var detailsSections = [];
- var foundLocalScope = false;
</del><ins>+ let detailsSections = [];
+ let foundLocalScope = false;
</ins><span class="cx">
</span><del>- var sectionCountByType = {};
</del><ins>+ let sectionCountByType = {};
</ins><span class="cx"> for (var type in WebInspector.ScopeChainNode.Type)
</span><span class="cx"> sectionCountByType[WebInspector.ScopeChainNode.Type[type]] = 0;
</span><span class="cx">
</span><del>- var scopeChain = callFrame.scopeChain;
- for (var i = 0; i < scopeChain.length; ++i) {
- var scope = scopeChain[i];
</del><ins>+ let scopeChain = callFrame.scopeChain;
+ for (let scope of scopeChain) {
+ let title = null;
+ let extraPropertyDescriptor = null;
+ let collapsedByDefault = false;
</ins><span class="cx">
</span><del>- var title = null;
- var extraPropertyDescriptor = null;
- var collapsedByDefault = false;
-
</del><span class="cx"> ++sectionCountByType[scope.type];
</span><span class="cx">
</span><span class="cx"> switch (scope.type) {
</span><span class="lines">@@ -133,57 +209,212 @@
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- var detailsSectionIdentifier = scope.type + "-" + sectionCountByType[scope.type];
</del><ins>+ let detailsSectionIdentifier = scope.type + "-" + sectionCountByType[scope.type];
</ins><span class="cx">
</span><del>- var scopePropertyPath = WebInspector.PropertyPath.emptyPropertyPathForScope(scope.object);
- var objectTree = new WebInspector.ObjectTreeView(scope.object, WebInspector.ObjectTreeView.Mode.Properties, scopePropertyPath);
</del><ins>+ let scopePropertyPath = WebInspector.PropertyPath.emptyPropertyPathForScope(scope.object);
+ let objectTree = new WebInspector.ObjectTreeView(scope.object, WebInspector.ObjectTreeView.Mode.Properties, scopePropertyPath);
</ins><span class="cx">
</span><span class="cx"> objectTree.showOnlyProperties();
</span><span class="cx">
</span><span class="cx"> if (extraPropertyDescriptor)
</span><span class="cx"> objectTree.appendExtraPropertyDescriptor(extraPropertyDescriptor);
</span><span class="cx">
</span><del>- var treeOutline = objectTree.treeOutline;
</del><ins>+ let treeOutline = objectTree.treeOutline;
</ins><span class="cx"> treeOutline.onadd = this._objectTreeAddHandler.bind(this, detailsSectionIdentifier);
</span><span class="cx"> treeOutline.onexpand = this._objectTreeExpandHandler.bind(this, detailsSectionIdentifier);
</span><span class="cx"> treeOutline.oncollapse = this._objectTreeCollapseHandler.bind(this, detailsSectionIdentifier);
</span><span class="cx">
</span><del>- var detailsSection = new WebInspector.DetailsSection(detailsSectionIdentifier, title, null, null, collapsedByDefault);
</del><ins>+ let detailsSection = new WebInspector.DetailsSection(detailsSectionIdentifier, title, null, null, collapsedByDefault);
</ins><span class="cx"> detailsSection.groups[0].rows = [new WebInspector.DetailsSectionPropertiesRow(objectTree)];
</span><span class="cx"> detailsSections.push(detailsSection);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function delayedWork()
</del><ins>+ return Promise.resolve(detailsSections);
+ }
+
+ _generateWatchExpressionsSection()
+ {
+ let watchExpressions = this._watchExpressionsSetting.value;
+ if (!watchExpressions.length) {
+ if (this._usedWatchExpressionsObjectGroup) {
+ this._usedWatchExpressionsObjectGroup = false;
+ RuntimeAgent.releaseObjectGroup(WebInspector.ScopeChainDetailsSidebarPanel.WatchExpressionsObjectGroupName);
+ }
+ return Promise.resolve(null);
+ }
+
+ RuntimeAgent.releaseObjectGroup(WebInspector.ScopeChainDetailsSidebarPanel.WatchExpressionsObjectGroupName);
+ this._usedWatchExpressionsObjectGroup = true;
+
+ let watchExpressionsRemoteObject = WebInspector.RemoteObject.createFakeRemoteObject();
+ let fakePropertyPath = WebInspector.PropertyPath.emptyPropertyPathForScope(watchExpressionsRemoteObject);
+ let objectTree = new WebInspector.ObjectTreeView(watchExpressionsRemoteObject, WebInspector.ObjectTreeView.Mode.Properties, fakePropertyPath);
+ objectTree.showOnlyProperties();
+
+ let treeOutline = objectTree.treeOutline;
+ const watchExpressionSectionIdentifier = "watch-expressions";
+ treeOutline.onadd = this._objectTreeAddHandler.bind(this, watchExpressionSectionIdentifier);
+ treeOutline.onexpand = this._objectTreeExpandHandler.bind(this, watchExpressionSectionIdentifier);
+ treeOutline.oncollapse = this._objectTreeCollapseHandler.bind(this, watchExpressionSectionIdentifier);
+ treeOutline.objectTreeElementAddContextMenuItems = this._objectTreeElementAddContextMenuItems.bind(this);
+
+ let promises = [];
+ for (let expression of watchExpressions) {
+ promises.push(new Promise(function(resolve, reject) {
+ WebInspector.runtimeManager.evaluateInInspectedWindow(expression, WebInspector.ScopeChainDetailsSidebarPanel.WatchExpressionsObjectGroupName, false, true, false, true, false, function(object, wasThrown) {
+ let propertyDescriptor = new WebInspector.PropertyDescriptor({name: expression, value: object}, undefined, undefined, wasThrown);
+ objectTree.appendExtraPropertyDescriptor(propertyDescriptor);
+ resolve(propertyDescriptor);
+ });
+ }));
+ }
+
+ return Promise.all(promises).then(function() {
+ return Promise.resolve(new WebInspector.DetailsSectionPropertiesRow(objectTree));
+ });
+ }
+
+ _addWatchExpression(expression)
+ {
+ let watchExpressions = this._watchExpressionsSetting.value.slice(0);
+ watchExpressions.push(expression);
+ this._watchExpressionsSetting.value = watchExpressions;
+
+ this.needsRefresh();
+ }
+
+ _removeWatchExpression(expression)
+ {
+ let watchExpressions = this._watchExpressionsSetting.value.slice(0);
+ watchExpressions.remove(expression, true);
+ this._watchExpressionsSetting.value = watchExpressions;
+
+ this.needsRefresh();
+ }
+
+ _clearAllWatchExpressions()
+ {
+ this._watchExpressionsSetting.value = [];
+
+ this.needsRefresh();
+ }
+
+ _addWatchExpressionButtonClicked(event)
+ {
+ function presentPopoverOverTargetElement()
</ins><span class="cx"> {
</span><del>- // Clear the timeout so we don't update the interface twice.
- clearTimeout(timeout);
</del><ins>+ let target = WebInspector.Rect.rectFromClientRect(event.target.getBoundingClientRect());
+ popover.present(target, [WebInspector.RectEdge.MAX_Y, WebInspector.RectEdge.MIN_Y, WebInspector.RectEdge.MAX_X]);
+ }
</ins><span class="cx">
</span><del>- // Bail if the call frame changed while we were waiting for the async response.
- if (this.callFrame !== callFrame)
- return;
</del><ins>+ let popover = new WebInspector.Popover(this);
+ let content = document.createElement("div");
+ content.classList.add("watch-expression");
+ content.appendChild(document.createElement("div")).textContent = WebInspector.UIString("Add New Watch Expression");
</ins><span class="cx">
</span><del>- this.contentElement.removeChildren();
- for (var i = 0; i < detailsSections.length; ++i)
- this.contentElement.appendChild(detailsSections[i].element);
</del><ins>+ let editorElement = content.appendChild(document.createElement("div"));
+ editorElement.classList.add("watch-expression-editor", WebInspector.SyntaxHighlightedStyleClassName);
+
+ this._codeMirror = CodeMirror(editorElement, {
+ lineWrapping: true,
+ mode: "text/javascript",
+ indentWithTabs: true,
+ indentUnit: 4,
+ matchBrackets: true,
+ value: "",
+ });
+
+ this._popoverCommitted = false;
+
+ this._codeMirror.addKeyMap({
+ "Enter": function() { this._popoverCommitted = true; popover.dismiss(); }.bind(this),
+ });
+
+ let completionController = new WebInspector.CodeMirrorCompletionController(this._codeMirror);
+ completionController.addExtendedCompletionProvider("javascript", WebInspector.javaScriptRuntimeCompletionProvider);
+
+ // Resize the popover as best we can when the CodeMirror editor changes size.
+ let previousHeight = 0;
+ this._codeMirror.on("changes", function(cm, event) {
+ let height = cm.getScrollInfo().height;
+ if (previousHeight !== height) {
+ previousHeight = height;
+ popover.update(false);
+ }
+ });
+
+ // Reposition the popover when the window resizes.
+ this._windowResizeListener = presentPopoverOverTargetElement;
+ window.addEventListener("resize", this._windowResizeListener);
+
+ popover.content = content;
+ presentPopoverOverTargetElement();
+
+ // CodeMirror needs a refresh after the popover displays, to layout, otherwise it doesn't appear.
+ setTimeout(function() {
+ this._codeMirror.refresh();
+ this._codeMirror.focus();
+ popover.update();
+ }.bind(this), 0);
+ }
+
+ willDismissPopover(popover)
+ {
+ if (this._popoverCommitted) {
+ let expression = this._codeMirror.getValue().trim();
+ if (expression)
+ this._addWatchExpression(expression);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- // We need a timeout in place in case there are long running, pending backend dispatches. This can happen
- // if the debugger is paused in code that was executed from the console. The console will be waiting for
- // the result of the execution and without a timeout we would never update the scope variables.
- var delay = WebInspector.ScopeChainDetailsSidebarPanel._autoExpandProperties.size === 0 ? 50 : 250;
- var timeout = setTimeout(delayedWork.bind(this), delay);
</del><ins>+ window.removeEventListener("resize", this._windowResizeListener);
+ this._windowResizeListener = null;
+ this._codeMirror = null;
+ }
</ins><span class="cx">
</span><del>- // Since ObjectTreeView populates asynchronously, we want to wait to replace the existing content
- // until after all the pending asynchronous requests are completed. This prevents severe flashing while stepping.
- InspectorBackend.runAfterPendingDispatches(delayedWork.bind(this));
</del><ins>+ _refreshAllWatchExpressionsButtonClicked(event)
+ {
+ this.needsRefresh();
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+ _clearAllWatchExpressionsButtonClicked(event)
+ {
+ this._clearAllWatchExpressions();
+ }
+
+ _didEvaluateExpression(event)
+ {
+ if (event.data.objectGroup === WebInspector.ScopeChainDetailsSidebarPanel.WatchExpressionsObjectGroupName)
+ return;
+
+ this.needsRefresh();
+ }
+
+ _mainResourceDidChange(event)
+ {
+ if (!event.target.isMainFrame())
+ return;
+
+ this.needsRefresh();
+ }
+
+ _objectTreeElementAddContextMenuItems(objectTreeElement, contextMenu)
+ {
+ // Only add our watch expression context menus to the top level ObjectTree elements.
+ if (objectTreeElement.parent !== objectTreeElement.treeOutline)
+ return;
+
+ contextMenu.appendItem(WebInspector.UIString("Remove Watch Expression"), function() {
+ let expression = objectTreeElement.property.name;
+ this._removeWatchExpression(expression);
+ }.bind(this));
+ }
+
</ins><span class="cx"> _propertyPathIdentifierForTreeElement(identifier, objectPropertyTreeElement)
</span><span class="cx"> {
</span><span class="cx"> if (!objectPropertyTreeElement.property)
</span><span class="cx"> return null;
</span><span class="cx">
</span><del>- var propertyPath = objectPropertyTreeElement.thisPropertyPath();
</del><ins>+ let propertyPath = objectPropertyTreeElement.thisPropertyPath();
</ins><span class="cx"> if (propertyPath.isFullPathImpossible())
</span><span class="cx"> return null;
</span><span class="cx">
</span><span class="lines">@@ -192,7 +423,7 @@
</span><span class="cx">
</span><span class="cx"> _objectTreeAddHandler(identifier, treeElement)
</span><span class="cx"> {
</span><del>- var propertyPathIdentifier = this._propertyPathIdentifierForTreeElement(identifier, treeElement);
</del><ins>+ let propertyPathIdentifier = this._propertyPathIdentifierForTreeElement(identifier, treeElement);
</ins><span class="cx"> if (!propertyPathIdentifier)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -202,7 +433,7 @@
</span><span class="cx">
</span><span class="cx"> _objectTreeExpandHandler(identifier, treeElement)
</span><span class="cx"> {
</span><del>- var propertyPathIdentifier = this._propertyPathIdentifierForTreeElement(identifier, treeElement);
</del><ins>+ let propertyPathIdentifier = this._propertyPathIdentifierForTreeElement(identifier, treeElement);
</ins><span class="cx"> if (!propertyPathIdentifier)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -211,7 +442,7 @@
</span><span class="cx">
</span><span class="cx"> _objectTreeCollapseHandler(identifier, treeElement)
</span><span class="cx"> {
</span><del>- var propertyPathIdentifier = this._propertyPathIdentifierForTreeElement(identifier, treeElement);
</del><ins>+ let propertyPathIdentifier = this._propertyPathIdentifierForTreeElement(identifier, treeElement);
</ins><span class="cx"> if (!propertyPathIdentifier)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -220,3 +451,4 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> WebInspector.ScopeChainDetailsSidebarPanel._autoExpandProperties = new Set;
</span><ins>+WebInspector.ScopeChainDetailsSidebarPanel.WatchExpressionsObjectGroupName = "watch-expressions";
</ins></span></pre>
</div>
</div>
</body>
</html>