<!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>[181704] 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/181704">181704</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2015-03-18 11:30:47 -0700 (Wed, 18 Mar 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: Scopes sidebar should use new ObjectTreeView and not ObjectPropertiesSection
https://bugs.webkit.org/show_bug.cgi?id=142808
Reviewed by Timothy Hatcher.
* UserInterface/Models/PropertyPath.js:
(WebInspector.PropertyPath):
(WebInspector.PropertyPath.emptyPropertyPathForScope):
Allow a special property empty path for "Scopes". This way for a
"<scopeObject>.property" we can show just the tooltip "property".
* UserInterface/Views/ObjectTreeView.css:
(.object-tree.properties-only > :matches(.title, .object-preview)):
(.object-tree.properties-only .object-tree-outline):
(.object-tree.properties-only .object-tree-property .property-name):
Tweak styles for only properties view, which won't have a top-level
preview and doesn't fade out enumerable properties.
* UserInterface/Views/ObjectTreeView.js:
(WebInspector.ObjectTreeView.prototype.get treeOutline):
Access the TreeOutline.
(WebInspector.ObjectTreeView.prototype.showOnlyProperties):
Properties only view modifies the display slightly.
(WebInspector.ObjectTreeView.prototype.appendExtraPropertyDescriptor):
(WebInspector.ObjectTreeView.prototype._updateProperties):
Allow the client to add its own property descriptors to display
as a property in this ObjectTreeView.
* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
(WebInspector.ScopeChainDetailsSidebarPanel.prototype.refresh):
Switch to using an ObjectTreeView.
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._propertyPathIdentifierForTreeElement):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeAddHandler):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeExpandHandler):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeCollapseHandler):
Keep track of what properties were expanded so we can auto-expand
them again when the sidebar refreshes.
* UserInterface/Main.html:
* UserInterface/Views/ScopeVariableTreeElement.js: Removed.
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj:
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters:
Remove the now unused ScopeVariableTreeElement.js.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceMainhtml">trunk/Source/WebInspectorUI/UserInterface/Main.html</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsPropertyPathjs">trunk/Source/WebInspectorUI/UserInterface/Models/PropertyPath.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsObjectTreeViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsObjectTreeViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsScopeChainDetailsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIWebInspectorUIvcxprojWebInspectorUIvcxproj">trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.vcxproj</a></li>
<li><a href="#trunkSourceWebInspectorUIWebInspectorUIvcxprojWebInspectorUIvcxprojfilters">trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsScopeVariableTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/ScopeVariableTreeElement.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (181703 => 181704)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-03-18 18:12:39 UTC (rev 181703)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-03-18 18:30:47 UTC (rev 181704)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2015-03-18 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Scopes sidebar should use new ObjectTreeView and not ObjectPropertiesSection
+ https://bugs.webkit.org/show_bug.cgi?id=142808
+
+ Reviewed by Timothy Hatcher.
+
+ * UserInterface/Models/PropertyPath.js:
+ (WebInspector.PropertyPath):
+ (WebInspector.PropertyPath.emptyPropertyPathForScope):
+ Allow a special property empty path for "Scopes". This way for a
+ "<scopeObject>.property" we can show just the tooltip "property".
+
+ * UserInterface/Views/ObjectTreeView.css:
+ (.object-tree.properties-only > :matches(.title, .object-preview)):
+ (.object-tree.properties-only .object-tree-outline):
+ (.object-tree.properties-only .object-tree-property .property-name):
+ Tweak styles for only properties view, which won't have a top-level
+ preview and doesn't fade out enumerable properties.
+
+ * UserInterface/Views/ObjectTreeView.js:
+ (WebInspector.ObjectTreeView.prototype.get treeOutline):
+ Access the TreeOutline.
+
+ (WebInspector.ObjectTreeView.prototype.showOnlyProperties):
+ Properties only view modifies the display slightly.
+
+ (WebInspector.ObjectTreeView.prototype.appendExtraPropertyDescriptor):
+ (WebInspector.ObjectTreeView.prototype._updateProperties):
+ Allow the client to add its own property descriptors to display
+ as a property in this ObjectTreeView.
+
+ * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype.refresh):
+ Switch to using an ObjectTreeView.
+
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype._propertyPathIdentifierForTreeElement):
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeAddHandler):
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeExpandHandler):
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeCollapseHandler):
+ Keep track of what properties were expanded so we can auto-expand
+ them again when the sidebar refreshes.
+
+ * UserInterface/Main.html:
+ * UserInterface/Views/ScopeVariableTreeElement.js: Removed.
+ * WebInspectorUI.vcxproj/WebInspectorUI.vcxproj:
+ * WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters:
+ Remove the now unused ScopeVariableTreeElement.js.
+
</ins><span class="cx"> 2015-03-17 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: Debugger Sidebar Icons Misaligned
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceMainhtml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (181703 => 181704)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Main.html        2015-03-18 18:12:39 UTC (rev 181703)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html        2015-03-18 18:30:47 UTC (rev 181704)
</span><span class="lines">@@ -455,7 +455,6 @@
</span><span class="cx"> <script src="Views/ScopeBar.js"></script>
</span><span class="cx"> <script src="Views/ScopeBarItem.js"></script>
</span><span class="cx"> <script src="Views/ScopeChainDetailsSidebarPanel.js"></script>
</span><del>- <script src="Views/ScopeVariableTreeElement.js"></script>
</del><span class="cx"> <script src="Views/ScriptContentView.js"></script>
</span><span class="cx"> <script src="Views/ScriptTimelineDataGrid.js"></script>
</span><span class="cx"> <script src="Views/ScriptTimelineDataGridNode.js"></script>
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsPropertyPathjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/PropertyPath.js (181703 => 181704)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/PropertyPath.js        2015-03-18 18:12:39 UTC (rev 181703)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/PropertyPath.js        2015-03-18 18:30:47 UTC (rev 181704)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx"> throw new Error("Attempted to append to a PropertyPath with null object.");
</span><span class="cx">
</span><span class="cx"> this._object = object;
</span><del>- this._pathComponent = pathComponent || null;
</del><ins>+ this._pathComponent = typeof pathComponent === "string" ? pathComponent : null;
</ins><span class="cx"> this._parent = parent || null;
</span><span class="cx"> this._isPrototype = isPrototype || false;
</span><span class="cx"> };
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx"> MapKey: "@mapkey",
</span><span class="cx"> MapValue: "@mapvalue",
</span><span class="cx"> SetIndex: "@setindex",
</span><ins>+ EmptyPathComponentForScope: "",
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> WebInspector.PropertyPath.Type = {
</span><span class="lines">@@ -57,6 +58,11 @@
</span><span class="cx"> Setter: "setter",
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+WebInspector.PropertyPath.emptyPropertyPathForScope = function(object)
+{
+ return new WebInspector.PropertyPath(object, WebInspector.PropertyPath.SpecialPathComponent.EmptyPathComponentForScope);
+}
+
</ins><span class="cx"> WebInspector.PropertyPath.prototype = {
</span><span class="cx"> constructor: WebInspector.PropertyPath,
</span><span class="cx"> __proto__: WebInspector.Object.prototype,
</span><span class="lines">@@ -148,6 +154,11 @@
</span><span class="cx"> return !this._parent;
</span><span class="cx"> },
</span><span class="cx">
</span><ins>+ isScope()
+ {
+ return this._pathComponent === WebInspector.PropertyPath.SpecialPathComponent.EmptyPathComponentForScope;
+ },
+
</ins><span class="cx"> isPathComponentImpossible()
</span><span class="cx"> {
</span><span class="cx"> return this._pathComponent && this._pathComponent.startsWith("@");
</span><span class="lines">@@ -167,6 +178,10 @@
</span><span class="cx"> appendPropertyName(object, propertyName)
</span><span class="cx"> {
</span><span class="cx"> var isPrototype = propertyName === "__proto__";
</span><ins>+
+ if (this.isScope())
+ return new WebInspector.PropertyPath(object, propertyName, this, isPrototype);
+
</ins><span class="cx"> var component = this._canPropertyNameBeDotAccess(propertyName) ? "." + propertyName : "[" + doubleQuotedString(propertyName) + "]";
</span><span class="cx"> return new WebInspector.PropertyPath(object, component, this, isPrototype);
</span><span class="cx"> },
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsObjectTreeViewcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css (181703 => 181704)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css        2015-03-18 18:12:39 UTC (rev 181703)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css        2015-03-18 18:30:47 UTC (rev 181704)
</span><span class="lines">@@ -56,6 +56,10 @@
</span><span class="cx"> background-image: -webkit-canvas(navigation-sidebar-panel-disclosure-triangle-open-normal);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.object-tree.properties-only > :matches(.title, .object-preview) {
+ display: none;
+}
+
</ins><span class="cx"> .object-tree.expanded .object-preview {
</span><span class="cx"> font-style: normal;
</span><span class="cx"> }
</span><span class="lines">@@ -81,6 +85,14 @@
</span><span class="cx"> outline: none;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.object-tree.properties-only .object-tree-outline {
+ padding-left: 0;
+}
+
+.object-tree.properties-only .object-tree-property .property-name {
+ opacity: 1;
+}
+
</ins><span class="cx"> .object-tree-outline li {
</span><span class="cx"> white-space: nowrap;
</span><span class="cx"> text-overflow: ellipsis;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsObjectTreeViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js (181703 => 181704)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js        2015-03-18 18:12:39 UTC (rev 181703)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js        2015-03-18 18:30:47 UTC (rev 181704)
</span><span class="lines">@@ -151,6 +151,11 @@
</span><span class="cx"> return this._element;
</span><span class="cx"> },
</span><span class="cx">
</span><ins>+ get treeOutline()
+ {
+ return this._outline;
+ },
+
</ins><span class="cx"> get expanded()
</span><span class="cx"> {
</span><span class="cx"> return this._expanded;
</span><span class="lines">@@ -186,6 +191,13 @@
</span><span class="cx"> this._untrackWeakEntries();
</span><span class="cx"> },
</span><span class="cx">
</span><ins>+ showOnlyProperties()
+ {
+ this._inConsole = false;
+
+ this._element.classList.add("properties-only");
+ },
+
</ins><span class="cx"> appendTitleSuffix(suffixElement)
</span><span class="cx"> {
</span><span class="cx"> if (this._previewView)
</span><span class="lines">@@ -194,6 +206,14 @@
</span><span class="cx"> this._titleElement.appendChild(suffixElement);
</span><span class="cx"> },
</span><span class="cx">
</span><ins>+ appendExtraPropertyDescriptor(propertyDescriptor)
+ {
+ if (!this._extraProperties)
+ this._extraProperties = [];
+
+ this._extraProperties.push(propertyDescriptor);
+ },
+
</ins><span class="cx"> // Protected
</span><span class="cx">
</span><span class="cx"> update()
</span><span class="lines">@@ -243,6 +263,9 @@
</span><span class="cx">
</span><span class="cx"> _updateProperties(properties, propertyPath)
</span><span class="cx"> {
</span><ins>+ if (this._extraProperties)
+ properties = properties.concat(this._extraProperties);
+
</ins><span class="cx"> properties.sort(WebInspector.ObjectTreeView.ComparePropertyDescriptors);
</span><span class="cx">
</span><span class="cx"> var isArray = this._object.isArray();
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsScopeChainDetailsSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js (181703 => 181704)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js        2015-03-18 18:12:39 UTC (rev 181703)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js        2015-03-18 18:30:47 UTC (rev 181704)
</span><span class="lines">@@ -33,13 +33,15 @@
</span><span class="cx"> WebInspector.runtimeManager.addEventListener(WebInspector.RuntimeManager.Event.DidEvaluate, this.needsRefresh, this);
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+WebInspector.ScopeChainDetailsSidebarPanel.autoExpandProperties = new Set;
+
</ins><span class="cx"> WebInspector.ScopeChainDetailsSidebarPanel.prototype = {
</span><span class="cx"> constructor: WebInspector.ScopeChainDetailsSidebarPanel,
</span><span class="cx"> __proto__: WebInspector.DetailsSidebarPanel.prototype,
</span><span class="cx">
</span><span class="cx"> // Public
</span><span class="cx">
</span><del>- inspect: function(objects)
</del><ins>+ inspect(objects)
</ins><span class="cx"> {
</span><span class="cx"> // Convert to a single item array if needed.
</span><span class="cx"> if (!(objects instanceof Array))
</span><span class="lines">@@ -75,7 +77,7 @@
</span><span class="cx"> this.needsRefresh();
</span><span class="cx"> },
</span><span class="cx">
</span><del>- refresh: function()
</del><ins>+ refresh()
</ins><span class="cx"> {
</span><span class="cx"> var callFrame = this.callFrame;
</span><span class="cx"> if (!callFrame)
</span><span class="lines">@@ -93,7 +95,7 @@
</span><span class="cx"> var scope = scopeChain[i];
</span><span class="cx">
</span><span class="cx"> var title = null;
</span><del>- var extraProperties = null;
</del><ins>+ var extraPropertyDescriptor = null;
</ins><span class="cx"> var collapsedByDefault = false;
</span><span class="cx"> var dontHighlightNonEnumerableProperties = true;
</span><span class="cx">
</span><span class="lines">@@ -108,7 +110,7 @@
</span><span class="cx"> title = WebInspector.UIString("Local Variables");
</span><span class="cx">
</span><span class="cx"> if (callFrame.thisObject)
</span><del>- extraProperties = [new WebInspector.RemoteObjectProperty("this", callFrame.thisObject)];
</del><ins>+ extraPropertyDescriptor = new WebInspector.PropertyDescriptor({name: "this", value: callFrame.thisObject});
</ins><span class="cx"> break;
</span><span class="cx">
</span><span class="cx"> case WebInspector.ScopeChainNode.Type.Closure:
</span><span class="lines">@@ -144,12 +146,21 @@
</span><span class="cx">
</span><span class="cx"> var detailsSectionIdentifier = scope.type + "-" + sectionCountByType[scope.type];
</span><span class="cx">
</span><del>- var section = new WebInspector.ObjectPropertiesSection(scope.object, null, null, null, true, extraProperties, WebInspector.ScopeVariableTreeElement);
- section.dontHighlightNonEnumerablePropertiesAtTopLevel = dontHighlightNonEnumerableProperties;
- section.__propertyIdentifierPrefix = detailsSectionIdentifier;
</del><ins>+ var scopePropertyPath = WebInspector.PropertyPath.emptyPropertyPathForScope(scope.object);
+ var objectTree = new WebInspector.ObjectTreeView(scope.object, WebInspector.ObjectTreeView.Mode.Properties, scopePropertyPath);
</ins><span class="cx">
</span><ins>+ objectTree.showOnlyProperties();
+
+ if (extraPropertyDescriptor)
+ objectTree.appendExtraPropertyDescriptor(extraPropertyDescriptor);
+
+ var treeOutline = objectTree.treeOutline;
+ treeOutline.onadd = this._objectTreeAddHandler.bind(this, detailsSectionIdentifier);
+ treeOutline.onexpand = this._objectTreeExpandHandler.bind(this, detailsSectionIdentifier);
+ treeOutline.oncollapse = this._objectTreeCollapseHandler.bind(this, detailsSectionIdentifier);
+
</ins><span class="cx"> var detailsSection = new WebInspector.DetailsSection(detailsSectionIdentifier, title, null, null, collapsedByDefault);
</span><del>- detailsSection.groups[0].rows = [new WebInspector.DetailsSectionPropertiesRow(section)];
</del><ins>+ detailsSection.groups[0].rows = [new WebInspector.DetailsSectionPropertiesRow(objectTree)];
</ins><span class="cx"> detailsSections.push(detailsSection);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -170,10 +181,51 @@
</span><span class="cx"> // We need a timeout in place in case there are long running, pending backend dispatches. This can happen
</span><span class="cx"> // if the debugger is paused in code that was executed from the console. The console will be waiting for
</span><span class="cx"> // the result of the execution and without a timeout we would never update the scope variables.
</span><del>- var timeout = setTimeout(delayedWork.bind(this), 50);
</del><ins>+ var delay = WebInspector.ScopeChainDetailsSidebarPanel.autoExpandProperties.size === 0 ? 50 : 250;
+ var timeout = setTimeout(delayedWork.bind(this), delay);
</ins><span class="cx">
</span><del>- // Since ObjectPropertiesSection populates asynchronously, we want to wait to replace the existing content
</del><ins>+ // Since ObjectTreeView populates asynchronously, we want to wait to replace the existing content
</ins><span class="cx"> // until after all the pending asynchronous requests are completed. This prevents severe flashing while stepping.
</span><span class="cx"> InspectorBackend.runAfterPendingDispatches(delayedWork.bind(this));
</span><ins>+ },
+
+ _propertyPathIdentifierForTreeElement(identifier, objectPropertyTreeElement)
+ {
+ if (!objectPropertyTreeElement.property)
+ return null;
+
+ var propertyPath = objectPropertyTreeElement.thisPropertyPath();
+ if (propertyPath.isFullPathImpossible())
+ return null;
+
+ return identifier + "-" + propertyPath.fullPath;
+ },
+
+ _objectTreeAddHandler(identifier, treeElement)
+ {
+ var propertyPathIdentifier = this._propertyPathIdentifierForTreeElement(identifier, treeElement);
+ if (!propertyPathIdentifier)
+ return;
+
+ if (WebInspector.ScopeChainDetailsSidebarPanel.autoExpandProperties.has(propertyPathIdentifier))
+ treeElement.expand();
+ },
+
+ _objectTreeExpandHandler(identifier, treeElement)
+ {
+ var propertyPathIdentifier = this._propertyPathIdentifierForTreeElement(identifier, treeElement);
+ if (!propertyPathIdentifier)
+ return;
+
+ WebInspector.ScopeChainDetailsSidebarPanel.autoExpandProperties.add(propertyPathIdentifier);
+ },
+
+ _objectTreeCollapseHandler(identifier, treeElement)
+ {
+ var propertyPathIdentifier = this._propertyPathIdentifierForTreeElement(identifier, treeElement);
+ if (!propertyPathIdentifier)
+ return;
+
+ WebInspector.ScopeChainDetailsSidebarPanel.autoExpandProperties.delete(propertyPathIdentifier);
</ins><span class="cx"> }
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsScopeVariableTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Views/ScopeVariableTreeElement.js (181703 => 181704)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ScopeVariableTreeElement.js        2015-03-18 18:12:39 UTC (rev 181703)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScopeVariableTreeElement.js        2015-03-18 18:30:47 UTC (rev 181704)
</span><span class="lines">@@ -1,91 +0,0 @@
</span><del>-/*
- * Copyright (C) 2008, 2013 Apple Inc. All Rights Reserved.
- * Copyright (C) 2011 Google 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. ``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
- * 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.ScopeVariableTreeElement = function(property)
-{
- WebInspector.ObjectPropertyTreeElement.call(this, property);
-};
-
-WebInspector.ScopeVariableTreeElement._expandedProperties = {};
-
-WebInspector.ScopeVariableTreeElement.prototype = {
- constructor: WebInspector.ScopeVariableTreeElement,
-
- // Public
-
- onattach: function()
- {
- WebInspector.ObjectPropertyTreeElement.prototype.onattach.call(this);
-
- if (this.hasChildren && this.constructor._expandedProperties.hasOwnProperty(this.propertyIdentifier))
- this.expand();
- },
-
- onexpand: function()
- {
- this.constructor._expandedProperties[this.propertyIdentifier] = true;
- },
-
- oncollapse: function()
- {
- delete this.constructor._expandedProperties[this.propertyIdentifier];
- },
-
- get propertyIdentifier()
- {
- if ("_propertyIdentifier" in this)
- return this._propertyIdentifier;
-
- var section = this.treeOutline.section;
- this._propertyIdentifier = (section.__propertyIdentifierPrefix ? section.__propertyIdentifierPrefix + "-" : "") + this.propertyPath;
- return this._propertyIdentifier;
- },
-
- get propertyPath()
- {
- if ("_propertyPath" in this)
- return this._propertyPath;
-
- var current = this;
- var result;
-
- do {
- if (current.property) {
- if (result)
- result = current.property.name + "." + result;
- else
- result = current.property.name;
- }
-
- current = current.parent;
- } while (current && !current.root);
-
- this._propertyPath = result;
- return result;
- }
-};
-
-WebInspector.ScopeVariableTreeElement.prototype.__proto__ = WebInspector.ObjectPropertyTreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIWebInspectorUIvcxprojWebInspectorUIvcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.vcxproj (181703 => 181704)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.vcxproj        2015-03-18 18:12:39 UTC (rev 181703)
+++ trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.vcxproj        2015-03-18 18:30:47 UTC (rev 181704)
</span><span class="lines">@@ -760,7 +760,6 @@
</span><span class="cx"> <None Include="..\UserInterface\ScopeBarItem.js" />
</span><span class="cx"> <None Include="..\UserInterface\ScopeChainDetailsSidebarPanel.js" />
</span><span class="cx"> <None Include="..\UserInterface\ScopeChainNode.js" />
</span><del>- <None Include="..\UserInterface\ScopeVariableTreeElement.js" />
</del><span class="cx"> <None Include="..\UserInterface\Script.js" />
</span><span class="cx"> <None Include="..\UserInterface\ScriptContentView.css" />
</span><span class="cx"> <None Include="..\UserInterface\ScriptContentView.js" />
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIWebInspectorUIvcxprojWebInspectorUIvcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters (181703 => 181704)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters        2015-03-18 18:12:39 UTC (rev 181703)
+++ trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters        2015-03-18 18:30:47 UTC (rev 181704)
</span><span class="lines">@@ -852,9 +852,6 @@
</span><span class="cx"> <None Include="..\UserInterface\ScopeChainNode.js">
</span><span class="cx"> <Filter>UserInterface</Filter>
</span><span class="cx"> </None>
</span><del>- <None Include="..\UserInterface\ScopeVariableTreeElement.js">
- <Filter>UserInterface</Filter>
- </None>
</del><span class="cx"> <None Include="..\UserInterface\Script.js">
</span><span class="cx"> <Filter>UserInterface</Filter>
</span><span class="cx"> </None>
</span></span></pre>
</div>
</div>
</body>
</html>