<!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>[184736] 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/184736">184736</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2015-05-21 16:33:42 -0700 (Thu, 21 May 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: Improve the UI of the type profiler popover
https://bugs.webkit.org/show_bug.cgi?id=140737
Reviewed by Timothy Hatcher.
Display TypeDescriptions in a Tree similiar to ObjectTrees.
Currently the only information we have in a TypeDescription
is the property names, and not their types, so all we can
display in the tree are names.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Controllers/TypeTokenAnnotator.js:
(WebInspector.TypeTokenAnnotator.prototype._insertTypeToken):
* UserInterface/Main.html:
* UserInterface/Models/ScriptSyntaxTree.js:
(WebInspector.ScriptSyntaxTree.prototype.updateTypes):
* UserInterface/Models/StructureDescription.js: Added.
(WebInspector.StructureDescription):
(WebInspector.StructureDescription.fromPayload):
(WebInspector.StructureDescription.prototype.get fields):
(WebInspector.StructureDescription.prototype.get optionalFields):
(WebInspector.StructureDescription.prototype.get constructorName):
(WebInspector.StructureDescription.prototype.get prototypeStructure):
(WebInspector.StructureDescription.prototype.get imprecise):
* UserInterface/Models/TypeDescription.js: Added.
(WebInspector.TypeDescription):
(WebInspector.TypeDescription.fromPayload):
(WebInspector.TypeDescription.prototype.get leastCommonAncestor):
(WebInspector.TypeDescription.prototype.get typeSet):
(WebInspector.TypeDescription.prototype.get structures):
(WebInspector.TypeDescription.prototype.get valid):
(WebInspector.TypeDescription.prototype.get truncated):
* UserInterface/Models/TypeSet.js:
(WebInspector.TypeSet):
(WebInspector.TypeSet.prototype.get primitiveTypeNames):
* UserInterface/Views/ObjectTreeView.js:
(WebInspector.ObjectTreeView.prototype._updateChildren):
* UserInterface/Views/Section.css: Removed.
* UserInterface/Views/Section.js: Removed.
* UserInterface/Views/SourceCodeTextEditor.css:
(.popover .expandable):
* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor):
(WebInspector.SourceCodeTextEditor.prototype.showPopoverForTypes):
(WebInspector.SourceCodeTextEditor.prototype._populateWithScriptContent):
(WebInspector.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptTypeInformation.handler):
(WebInspector.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptTypeInformation):
(WebInspector.SourceCodeTextEditor.prototype._showPopoverForObject):
* UserInterface/Views/TypePropertiesSection.js: Removed.
* UserInterface/Views/TypeTokenView.js:
(WebInspector.TypeTokenView):
(WebInspector.TypeTokenView.titleForPopover):
(WebInspector.TypeTokenView.prototype.update):
(WebInspector.TypeTokenView.prototype._setUpMouseoverHandlers):
(WebInspector.TypeTokenView.prototype._shouldShowPopover):
(WebInspector.TypeTokenView.prototype._displayTypeName):
* UserInterface/Views/TypeTreeElement.css: Added.
(.type-tree-element):
(.type-tree-element > .titles):
(.type-tree-element > .disclosure-button):
(.type-tree-element.parent > .disclosure-button):
(.type-tree-element.parent.expanded > .disclosure-button):
(.type-tree-element > .icon):
(.type-tree-element.prototype):
(.type-tree-element.prototype:focus):
(.type-tree-element.prototype + ol):
* UserInterface/Views/TypeTreeElement.js: Added.
(WebInspector.TypeTreeElement):
(WebInspector.TypeTreeElement.prototype.get name):
(WebInspector.TypeTreeElement.prototype.get isPrototype):
(WebInspector.TypeTreeElement.prototype.onpopulate):
(WebInspector.TypeTreeElement.prototype.onexpand):
* UserInterface/Views/TypeTreeView.css: Renamed from Source/WebInspectorUI/UserInterface/Views/PropertiesSection.js.
(.type-tree):
(.type-tree-outline):
(.type-tree-outline li):
(.type-tree-outline ol):
(.type-tree-outline ol.expanded):
(.type-tree-outline li .empty-message):
* UserInterface/Views/TypeTreeView.js: Added.
(WebInspector.TypeTreeView):
(WebInspector.TypeTreeView.prototype.get typeDescription):
(WebInspector.TypeTreeView.prototype.get element):
(WebInspector.TypeTreeView.prototype.get treeOutline):
(WebInspector.TypeTreeView.prototype._populate):</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="#trunkSourceWebInspectorUIUserInterfaceControllersTypeTokenAnnotatorjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/TypeTokenAnnotator.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceMainhtml">trunk/Source/WebInspectorUI/UserInterface/Main.html</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsScriptSyntaxTreejs">trunk/Source/WebInspectorUI/UserInterface/Models/ScriptSyntaxTree.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsTypeSetjs">trunk/Source/WebInspectorUI/UserInterface/Models/TypeSet.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsObjectTreeViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSourceCodeTextEditorcss">trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSourceCodeTextEditorjs">trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTypeTokenViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/TypeTokenView.js</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsStructureDescriptionjs">trunk/Source/WebInspectorUI/UserInterface/Models/StructureDescription.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsTypeDescriptionjs">trunk/Source/WebInspectorUI/UserInterface/Models/TypeDescription.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTypeTreeElementcss">trunk/Source/WebInspectorUI/UserInterface/Views/TypeTreeElement.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTypeTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/TypeTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTypeTreeViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/TypeTreeView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTypeTreeViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/TypeTreeView.js</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsPropertiesSectionjs">trunk/Source/WebInspectorUI/UserInterface/Views/PropertiesSection.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSectioncss">trunk/Source/WebInspectorUI/UserInterface/Views/Section.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSectionjs">trunk/Source/WebInspectorUI/UserInterface/Views/Section.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTypePropertiesSectionjs">trunk/Source/WebInspectorUI/UserInterface/Views/TypePropertiesSection.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (184735 => 184736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-05-21 23:30:15 UTC (rev 184735)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-05-21 23:33:42 UTC (rev 184736)
</span><span class="lines">@@ -1,3 +1,91 @@
</span><ins>+2015-05-21 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Improve the UI of the type profiler popover
+ https://bugs.webkit.org/show_bug.cgi?id=140737
+
+ Reviewed by Timothy Hatcher.
+
+ Display TypeDescriptions in a Tree similiar to ObjectTrees.
+ Currently the only information we have in a TypeDescription
+ is the property names, and not their types, so all we can
+ display in the tree are names.
+
+ * Localizations/en.lproj/localizedStrings.js:
+ * UserInterface/Controllers/TypeTokenAnnotator.js:
+ (WebInspector.TypeTokenAnnotator.prototype._insertTypeToken):
+ * UserInterface/Main.html:
+ * UserInterface/Models/ScriptSyntaxTree.js:
+ (WebInspector.ScriptSyntaxTree.prototype.updateTypes):
+ * UserInterface/Models/StructureDescription.js: Added.
+ (WebInspector.StructureDescription):
+ (WebInspector.StructureDescription.fromPayload):
+ (WebInspector.StructureDescription.prototype.get fields):
+ (WebInspector.StructureDescription.prototype.get optionalFields):
+ (WebInspector.StructureDescription.prototype.get constructorName):
+ (WebInspector.StructureDescription.prototype.get prototypeStructure):
+ (WebInspector.StructureDescription.prototype.get imprecise):
+ * UserInterface/Models/TypeDescription.js: Added.
+ (WebInspector.TypeDescription):
+ (WebInspector.TypeDescription.fromPayload):
+ (WebInspector.TypeDescription.prototype.get leastCommonAncestor):
+ (WebInspector.TypeDescription.prototype.get typeSet):
+ (WebInspector.TypeDescription.prototype.get structures):
+ (WebInspector.TypeDescription.prototype.get valid):
+ (WebInspector.TypeDescription.prototype.get truncated):
+ * UserInterface/Models/TypeSet.js:
+ (WebInspector.TypeSet):
+ (WebInspector.TypeSet.prototype.get primitiveTypeNames):
+ * UserInterface/Views/ObjectTreeView.js:
+ (WebInspector.ObjectTreeView.prototype._updateChildren):
+ * UserInterface/Views/Section.css: Removed.
+ * UserInterface/Views/Section.js: Removed.
+ * UserInterface/Views/SourceCodeTextEditor.css:
+ (.popover .expandable):
+ * UserInterface/Views/SourceCodeTextEditor.js:
+ (WebInspector.SourceCodeTextEditor):
+ (WebInspector.SourceCodeTextEditor.prototype.showPopoverForTypes):
+ (WebInspector.SourceCodeTextEditor.prototype._populateWithScriptContent):
+ (WebInspector.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptTypeInformation.handler):
+ (WebInspector.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptTypeInformation):
+ (WebInspector.SourceCodeTextEditor.prototype._showPopoverForObject):
+ * UserInterface/Views/TypePropertiesSection.js: Removed.
+ * UserInterface/Views/TypeTokenView.js:
+ (WebInspector.TypeTokenView):
+ (WebInspector.TypeTokenView.titleForPopover):
+ (WebInspector.TypeTokenView.prototype.update):
+ (WebInspector.TypeTokenView.prototype._setUpMouseoverHandlers):
+ (WebInspector.TypeTokenView.prototype._shouldShowPopover):
+ (WebInspector.TypeTokenView.prototype._displayTypeName):
+ * UserInterface/Views/TypeTreeElement.css: Added.
+ (.type-tree-element):
+ (.type-tree-element > .titles):
+ (.type-tree-element > .disclosure-button):
+ (.type-tree-element.parent > .disclosure-button):
+ (.type-tree-element.parent.expanded > .disclosure-button):
+ (.type-tree-element > .icon):
+ (.type-tree-element.prototype):
+ (.type-tree-element.prototype:focus):
+ (.type-tree-element.prototype + ol):
+ * UserInterface/Views/TypeTreeElement.js: Added.
+ (WebInspector.TypeTreeElement):
+ (WebInspector.TypeTreeElement.prototype.get name):
+ (WebInspector.TypeTreeElement.prototype.get isPrototype):
+ (WebInspector.TypeTreeElement.prototype.onpopulate):
+ (WebInspector.TypeTreeElement.prototype.onexpand):
+ * UserInterface/Views/TypeTreeView.css: Renamed from Source/WebInspectorUI/UserInterface/Views/PropertiesSection.js.
+ (.type-tree):
+ (.type-tree-outline):
+ (.type-tree-outline li):
+ (.type-tree-outline ol):
+ (.type-tree-outline ol.expanded):
+ (.type-tree-outline li .empty-message):
+ * UserInterface/Views/TypeTreeView.js: Added.
+ (WebInspector.TypeTreeView):
+ (WebInspector.TypeTreeView.prototype.get typeDescription):
+ (WebInspector.TypeTreeView.prototype.get element):
+ (WebInspector.TypeTreeView.prototype.get treeOutline):
+ (WebInspector.TypeTreeView.prototype._populate):
+
</ins><span class="cx"> 2015-05-20 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: Fix WebInspector.StackTrace style
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (184735 => 184736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-05-21 23:30:15 UTC (rev 184735)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-05-21 23:33:42 UTC (rev 184736)
</span><span class="lines">@@ -337,6 +337,7 @@
</span><span class="cx"> localizedStrings["No Search Results"] = "No Search Results";
</span><span class="cx"> localizedStrings["No exact ARIA role match."] = "No exact ARIA role match.";
</span><span class="cx"> localizedStrings["No message"] = "No message";
</span><ins>+localizedStrings["No properties."] = "No properties.";
</ins><span class="cx"> localizedStrings["Node"] = "Node";
</span><span class="cx"> localizedStrings["Not found"] = "Not found";
</span><span class="cx"> localizedStrings["Online"] = "Online";
</span><span class="lines">@@ -368,7 +369,6 @@
</span><span class="cx"> localizedStrings["Probes"] = "Probes";
</span><span class="cx"> localizedStrings["Processing Instruction"] = "Processing Instruction";
</span><span class="cx"> localizedStrings["Properties"] = "Properties";
</span><del>-localizedStrings["Prototype"] = "Prototype";
</del><span class="cx"> localizedStrings["Query Parameters"] = "Query Parameters";
</span><span class="cx"> localizedStrings["Query String"] = "Query String";
</span><span class="cx"> localizedStrings["Radial Gradient"] = "Radial Gradient";
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersTypeTokenAnnotatorjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/TypeTokenAnnotator.js (184735 => 184736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/TypeTokenAnnotator.js        2015-05-21 23:30:15 UTC (rev 184735)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/TypeTokenAnnotator.js        2015-05-21 23:33:42 UTC (rev 184736)
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx"> _insertTypeToken(node)
</span><span class="cx"> {
</span><span class="cx"> if (node.type === WebInspector.ScriptSyntaxTree.NodeType.Identifier) {
</span><del>- if (!node.attachments.__typeToken && node.attachments.types && node.attachments.types.isValid)
</del><ins>+ if (!node.attachments.__typeToken && node.attachments.types && node.attachments.types.valid)
</ins><span class="cx"> this._insertToken(node.range[0], node, false, WebInspector.TypeTokenView.TitleType.Variable, node.name);
</span><span class="cx">
</span><span class="cx"> if (node.attachments.__typeToken)
</span><span class="lines">@@ -99,13 +99,13 @@
</span><span class="cx"> console.assert(node.type === WebInspector.ScriptSyntaxTree.NodeType.FunctionDeclaration || node.type === WebInspector.ScriptSyntaxTree.NodeType.FunctionExpression);
</span><span class="cx">
</span><span class="cx"> var functionReturnType = node.attachments.returnTypes;
</span><del>- if (!functionReturnType || !functionReturnType.isValid)
</del><ins>+ if (!functionReturnType || !functionReturnType.valid)
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> // If a function does not have an explicit return statement with an argument (i.e, "return x;" instead of "return;")
</span><span class="cx"> // then don't show a return type unless we think it's a constructor.
</span><span class="cx"> var scriptSyntaxTree = this._script._scriptSyntaxTree;
</span><del>- if (!node.attachments.__typeToken && (scriptSyntaxTree.containsNonEmptyReturnStatement(node.body) || !WebInspector.TypeSet.fromPayload(functionReturnType).isContainedIn(WebInspector.TypeSet.TypeBit.Undefined))) {
</del><ins>+ if (!node.attachments.__typeToken && (scriptSyntaxTree.containsNonEmptyReturnStatement(node.body) || !WebInspector.TypeSet.fromPayload(functionReturnType.typeSet).isContainedIn(WebInspector.TypeSet.TypeBit.Undefined))) {
</ins><span class="cx"> var functionName = node.id ? node.id.name : null;
</span><span class="cx"> var offset = node.isGetterOrSetter ? node.getterOrSetterRange[0] : node.range[0];
</span><span class="cx"> this._insertToken(offset, node, true, WebInspector.TypeTokenView.TitleType.ReturnStatement, functionName);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceMainhtml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (184735 => 184736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Main.html        2015-05-21 23:30:15 UTC (rev 184735)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html        2015-05-21 23:33:42 UTC (rev 184736)
</span><span class="lines">@@ -129,7 +129,6 @@
</span><span class="cx"> <link rel="stylesheet" href="Views/SearchBar.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/SearchIcons.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/SearchSidebarPanel.css">
</span><del>- <link rel="stylesheet" href="Views/Section.css">
</del><span class="cx"> <link rel="stylesheet" href="Views/Sidebar.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/SidebarPanel.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/Slider.css">
</span><span class="lines">@@ -153,6 +152,8 @@
</span><span class="cx"> <link rel="stylesheet" href="Views/Toolbar.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/TreeElementStatusButton.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/TypeTokenView.css">
</span><ins>+ <link rel="stylesheet" href="Views/TypeTreeElement.css">
+ <link rel="stylesheet" href="Views/TypeTreeView.css">
</ins><span class="cx">
</span><span class="cx"> <link rel="stylesheet" href="Controllers/CodeMirrorCompletionController.css">
</span><span class="cx"> <link rel="stylesheet" href="Controllers/CodeMirrorDragToAdjustNumberController.css">
</span><span class="lines">@@ -300,10 +301,12 @@
</span><span class="cx"> <script src="Models/SourceMap.js"></script>
</span><span class="cx"> <script src="Models/SourceMapResource.js"></script>
</span><span class="cx"> <script src="Models/StackTrace.js"></script>
</span><ins>+ <script src="Models/StructureDescription.js"></script>
</ins><span class="cx"> <script src="Models/TextMarker.js"></script>
</span><span class="cx"> <script src="Models/TextRange.js"></script>
</span><span class="cx"> <script src="Models/TimelineMarker.js"></script>
</span><span class="cx"> <script src="Models/TimelineRecording.js"></script>
</span><ins>+ <script src="Models/TypeDescription.js"></script>
</ins><span class="cx"> <script src="Models/TypeSet.js"></script>
</span><span class="cx"> <script src="Models/UnitBezier.js"></script>
</span><span class="cx">
</span><span class="lines">@@ -314,7 +317,6 @@
</span><span class="cx"> <script src="Views/DetailsSectionRow.js"></script>
</span><span class="cx"> <script src="Views/HierarchicalPathComponent.js"></script>
</span><span class="cx"> <script src="Views/NavigationItem.js"></script>
</span><del>- <script src="Views/Section.js"></script>
</del><span class="cx"> <script src="Views/SidebarPanel.js"></script>
</span><span class="cx"> <script src="Views/StyleDetailsPanel.js"></script>
</span><span class="cx"> <script src="Views/TabBar.js"></script>
</span><span class="lines">@@ -330,7 +332,6 @@
</span><span class="cx"> <script src="Views/DetailsSidebarPanel.js"></script>
</span><span class="cx"> <script src="Views/GeneralTreeElement.js"></script>
</span><span class="cx"> <script src="Views/NavigationSidebarPanel.js"></script>
</span><del>- <script src="Views/PropertiesSection.js"></script>
</del><span class="cx"> <script src="Views/ResourceContentView.js"></script>
</span><span class="cx"> <script src="Views/TabContentView.js"></script>
</span><span class="cx"> <script src="Views/TimelineDataGrid.js"></script>
</span><span class="lines">@@ -519,8 +520,9 @@
</span><span class="cx"> <script src="Views/Toolbar.js"></script>
</span><span class="cx"> <script src="Views/TreeElementStatusButton.js"></script>
</span><span class="cx"> <script src="Views/TreeOutlineDataGridSynchronizer.js"></script>
</span><del>- <script src="Views/TypePropertiesSection.js"></script>
</del><span class="cx"> <script src="Views/TypeTokenView.js"></script>
</span><ins>+ <script src="Views/TypeTreeElement.js"></script>
+ <script src="Views/TypeTreeView.js"></script>
</ins><span class="cx">
</span><span class="cx"> <script src="Controllers/Annotator.js"></script>
</span><span class="cx"> <script src="Controllers/CodeMirrorEditingController.js"></script>
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsScriptSyntaxTreejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/ScriptSyntaxTree.js (184735 => 184736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ScriptSyntaxTree.js        2015-05-21 23:30:15 UTC (rev 184735)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ScriptSyntaxTree.js        2015-05-21 23:33:42 UTC (rev 184736)
</span><span class="lines">@@ -204,7 +204,7 @@
</span><span class="cx">
</span><span class="cx"> for (var i = 0; i < typeInformationArray.length; i++) {
</span><span class="cx"> var node = allRequestNodes[i];
</span><del>- var typeInformation = typeInformationArray[i];
</del><ins>+ var typeInformation = WebInspector.TypeDescription.fromPayload(typeInformationArray[i]);
</ins><span class="cx"> if (allRequests[i].typeInformationDescriptor === WebInspector.ScriptSyntaxTree.TypeProfilerSearchDescriptor.FunctionReturn)
</span><span class="cx"> node.attachments.returnTypes = typeInformation;
</span><span class="cx"> else
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsStructureDescriptionjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Models/StructureDescription.js (0 => 184736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/StructureDescription.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/StructureDescription.js        2015-05-21 23:33:42 UTC (rev 184736)
</span><span class="lines">@@ -0,0 +1,81 @@
</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.
+ */
+
+WebInspector.StructureDescription = class StructureDescription extends WebInspector.Object
+{
+ constructor(fields, optionalFields, constructorName, prototypeStructure, imprecise)
+ {
+ super();
+
+ console.assert(!fields || fields.every(function(x) { return typeof x === "string"; }));
+ console.assert(!optionalFields || optionalFields.every(function(x) { return typeof x === "string"; }));
+ console.assert(!constructorName || typeof constructorName === "string");
+ console.assert(!prototypeStructure || prototypeStructure instanceof WebInspector.StructureDescription);
+
+ this._fields = fields || null;
+ this._optionalFields = optionalFields || null;
+ this._constructorName = constructorName || "";
+ this._prototypeStructure = prototypeStructure || null;
+ this._imprecise = imprecise || false;
+ }
+
+ // Static
+
+ // Runtime.StructureDescription.
+ static fromPayload(payload)
+ {
+ if (payload.prototypeStructure)
+ payload.prototypeStructure = WebInspector.StructureDescription.fromPayload(payload.prototypeStructure);
+
+ return new WebInspector.StructureDescription(payload.fields, payload.optionalFields, payload.constructorName, payload.prototypeStructure, payload.imprecise);
+ }
+
+ // Public
+
+ get fields()
+ {
+ return this._fields;
+ }
+
+ get optionalFields()
+ {
+ return this._optionalFields;
+ }
+
+ get constructorName()
+ {
+ return this._constructorName;
+ }
+
+ get prototypeStructure()
+ {
+ return this._prototypeStructure;
+ }
+
+ get imprecise()
+ {
+ return this._imprecise;
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsTypeDescriptionjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Models/TypeDescription.js (0 => 184736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/TypeDescription.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/TypeDescription.js        2015-05-21 23:33:42 UTC (rev 184736)
</span><span class="lines">@@ -0,0 +1,85 @@
</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.
+ */
+
+WebInspector.TypeDescription = class TypeDescription extends WebInspector.Object
+{
+ constructor(leastCommonAncestor, typeSet, structures, valid, truncated)
+ {
+ super();
+
+ console.assert(!leastCommonAncestor || typeof leastCommonAncestor === "string");
+ console.assert(!typeSet || typeSet instanceof WebInspector.TypeSet);
+ console.assert(!structures || structures.every(function(x) { return x instanceof WebInspector.StructureDescription; }));
+
+ this._leastCommonAncestor = leastCommonAncestor || null;
+ this._typeSet = typeSet || null;
+ this._structures = structures || null;
+ this._valid = valid || false;
+ this._truncated = truncated || false;
+ }
+
+ // Static
+
+ // Runtime.TypeDescription.
+ static fromPayload(payload)
+ {
+ var typeSet = undefined;
+ if (payload.typeSet)
+ typeSet = WebInspector.TypeSet.fromPayload(payload.typeSet);
+
+ var structures = undefined;
+ if (payload.structures)
+ structures = payload.structures.map(function(x) { return WebInspector.StructureDescription.fromPayload(x); });
+
+ return new WebInspector.TypeDescription(payload.leastCommonAncestor, typeSet, structures, payload.isValid, payload.isTruncated);
+ }
+
+ // Public
+
+ get leastCommonAncestor()
+ {
+ return this._leastCommonAncestor;
+ }
+
+ get typeSet()
+ {
+ return this._typeSet;
+ }
+
+ get structures()
+ {
+ return this._structures;
+ }
+
+ get valid()
+ {
+ return this._valid;
+ }
+
+ get truncated()
+ {
+ return this._truncated;
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsTypeSetjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/TypeSet.js (184735 => 184736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/TypeSet.js        2015-05-21 23:30:15 UTC (rev 184735)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/TypeSet.js        2015-05-21 23:33:42 UTC (rev 184736)
</span><span class="lines">@@ -26,13 +26,12 @@
</span><span class="cx">
</span><span class="cx"> WebInspector.TypeSet = class TypeSet extends WebInspector.Object
</span><span class="cx"> {
</span><del>- constructor(runtimeTypeDescriptionPayload)
</del><ins>+ constructor(typeSet)
</ins><span class="cx"> {
</span><span class="cx"> super();
</span><span class="cx">
</span><del>- this._types = runtimeTypeDescriptionPayload;
</del><ins>+ console.assert(typeSet);
</ins><span class="cx">
</span><del>- var typeSet = this._types.typeSet;
</del><span class="cx"> var bitString = 0x0;
</span><span class="cx"> if (typeSet.isFunction)
</span><span class="cx"> bitString |= WebInspector.TypeSet.TypeBit.Function;
</span><span class="lines">@@ -52,10 +51,10 @@
</span><span class="cx"> bitString |= WebInspector.TypeSet.TypeBit.Object;
</span><span class="cx"> if (typeSet.isSymbol)
</span><span class="cx"> bitString |= WebInspector.TypeSet.TypeBit.Symbol;
</span><del>-
</del><span class="cx"> console.assert(bitString);
</span><del>- this._bitString = bitString;
</del><span class="cx">
</span><ins>+ this._typeSet = typeSet;
+ this._bitString = bitString;
</ins><span class="cx"> this._primitiveTypeNames = null;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -94,7 +93,7 @@
</span><span class="cx"> return this._primitiveTypeNames;
</span><span class="cx">
</span><span class="cx"> this._primitiveTypeNames = [];
</span><del>- var typeSet = this._types.typeSet;
</del><ins>+ var typeSet = this._typeSet;
</ins><span class="cx"> if (typeSet.isUndefined)
</span><span class="cx"> this._primitiveTypeNames.push("Undefined");
</span><span class="cx"> if (typeSet.isNull)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsObjectTreeViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js (184735 => 184736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js        2015-05-21 23:30:15 UTC (rev 184735)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js        2015-05-21 23:33:42 UTC (rev 184736)
</span><span class="lines">@@ -255,6 +255,8 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> handler.call(this, list, this._propertyPath);
</span><ins>+
+ this.dispatchEventToListeners(WebInspector.ObjectTreeView.Event.Updated);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> _updateEntries(entries, propertyPath)
</span><span class="lines">@@ -368,3 +370,7 @@
</span><span class="cx"> PrototypeAPI: Symbol("object-tree-prototype-api"), // API view on a live object instance, so getters can be invoked.
</span><span class="cx"> ClassAPI: Symbol("object-tree-class-api"), // API view without an object instance, can not invoke getters.
</span><span class="cx"> };
</span><ins>+
+WebInspector.ObjectTreeView.Event = {
+ Updated: "object-tree-updated",
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsPropertiesSectionjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Views/PropertiesSection.js (184735 => 184736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/PropertiesSection.js        2015-05-21 23:30:15 UTC (rev 184735)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/PropertiesSection.js        2015-05-21 23:33:42 UTC (rev 184736)
</span><span class="lines">@@ -1,39 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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.PropertiesSection = function(title, subtitle)
-{
- this.propertiesElement = document.createElement("ol");
- this.propertiesElement.className = "properties properties-tree";
- this.propertiesElement.tabIndex = 0;
- this.propertiesTreeOutline = new WebInspector.TreeOutline(this.propertiesElement);
- this.propertiesTreeOutline.section = this;
-
- WebInspector.Section.call(this, title, subtitle);
-
- this.element.appendChild(this.propertiesElement);
-};
-
-WebInspector.PropertiesSection.prototype.__proto__ = WebInspector.Section.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSectioncss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Views/Section.css (184735 => 184736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/Section.css        2015-05-21 23:30:15 UTC (rev 184735)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Section.css        2015-05-21 23:33:42 UTC (rev 184736)
</span><span class="lines">@@ -1,195 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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.
- */
-
-.section {
- position: relative;
-}
-
-.section .header {
- color: black;
- padding: 0 8px 0 18px;
- min-height: 18px;
- white-space: nowrap;
- background-origin: padding;
- background-clip: padding;
-}
-
-.section .header .title::before {
- width: 8px;
- height: 8px;
-
- margin-right: 4px;
- margin-left: -8px;
-
- background-image: -webkit-canvas(disclosure-triangle-tiny-closed-normal);
- background-size: 8px 8px;
- background-repeat: no-repeat;
-
- content: " ";
- display: inline-block;
-}
-
-.section.expanded .header .title::before {
- background-image: -webkit-canvas(disclosure-triangle-tiny-open-normal);
-}
-
-.section .header .title, .event-bar .header .title {
- font-weight: normal;
- word-wrap: break-word;
- white-space: normal;
- line-height: 18px; /* @FIXME: Don't hardcode line-height. */
-}
-
-.section .header .title.blank-title {
- font-style: italic;
-}
-
-.section .header label, .event-bar .header label {
- display: none;
-}
-
-.section.expanded .header label, .event-bar.expanded .header label {
- display: inline;
-}
-
-.section .header .subtitle, .event-bar .header .subtitle {
- float: right;
- margin-left: 5px;
- max-width: 55%;
- text-overflow: ellipsis;
- overflow: hidden;
-}
-
-.section .header .subtitle a {
- color: inherit;
-}
-
-.section .properties, .event-bar .event-properties {
- display: none;
-}
-
-.section.expanded .properties, .event-bar.expanded .event-properties {
- display: block;
- padding-left: 16px;
-}
-
-.section.expanded.no-header .properties {
- padding-left: 0;
-}
-
-.section.no-affect .properties li {
- opacity: 0.5;
-}
-
-.section.no-affect .properties li.editing {
- opacity: 1.0;
-}
-
-.properties-tree {
- margin: 0;
- padding: 0 6px 2px;
- list-style: none;
- min-height: 18px;
- outline: none;
-}
-
-.properties-tree li {
- margin-left: 12px;
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- -webkit-user-select: text;
- cursor: default;
-}
-
-.properties-tree li.parent {
- margin-left: 1px;
-}
-
-.properties-tree li.parent::before {
- float: left;
-
- content: "";
-
- background-image: -webkit-canvas(disclosure-triangle-tiny-closed-normal);
- background-size: 8px 8px;
- background-repeat: no-repeat;
-
- width: 8px;
- height: 8px;
-
- margin-top: 2px;
- padding-right: 2px;
-}
-
-.properties-tree li.parent.expanded::before {
- background-image: -webkit-canvas(disclosure-triangle-tiny-open-normal);
-}
-
-.properties-tree li .info {
- padding-top: 4px;
- padding-bottom: 3px;
-}
-
-.properties-tree ol {
- display: none;
- margin: 0;
- -webkit-padding-start: 12px;
- list-style: none;
-}
-
-.properties-tree ol.expanded {
- display: block;
-}
-
-.section .properties li.editing-sub-part {
- padding: 3px 6px 8px 18px;
- margin: -3px -6px -8px -6px;
- text-overflow: clip;
-}
-
-.section .properties .name, .event-properties .name {
- color: rgb(136, 19, 145);
-}
-
-.section .properties .dimmed {
- opacity: 0.6;
-}
-
-.section .properties .value.error {
- color: red;
-}
-
-.section .properties .number, .event-properties .number {
- color: blue;
-}
-
-.section .properties .keyword, .event-properties .keyword {
- color: rgb(136, 19, 79);
-}
-
-.section .properties .color, .event-properties .color {
- color: rgb(118, 15, 21);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSectionjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Views/Section.js (184735 => 184736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/Section.js        2015-05-21 23:30:15 UTC (rev 184735)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Section.js        2015-05-21 23:33:42 UTC (rev 184736)
</span><span class="lines">@@ -1,216 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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.Section = function(title, subtitle)
-{
- // FIXME: Convert this to a WebInspector.Object subclass, and call super().
- // WebInspector.Object.call(this);
-
- this.element = document.createElement("div");
- this.element.className = "section";
- this.element._section = this;
-
- if (typeof title === "string" || title instanceof Node || typeof subtitle === "string") {
- this.headerElement = document.createElement("div");
- this.headerElement.className = "header";
-
- this.titleElement = document.createElement("div");
- this.titleElement.className = "title";
-
- this.subtitleElement = document.createElement("div");
- this.subtitleElement.className = "subtitle";
-
- this.headerElement.appendChild(this.subtitleElement);
- this.headerElement.appendChild(this.titleElement);
-
- this.headerElement.addEventListener("click", this.handleClick.bind(this), false);
- this.element.appendChild(this.headerElement);
-
- this.title = title;
- this.subtitle = subtitle;
- } else
- this.element.classList.add("no-header");
-
- this._expanded = false;
-
- if (!this.headerElement)
- this.expand();
-};
-
-WebInspector.Section.Event = {
- VisibleContentDidChange: "section-visible-content-did-change"
-};
-
-WebInspector.Section.prototype = {
- get title()
- {
- return this._title;
- },
-
- set title(x)
- {
- if (this._title === x)
- return;
- this._title = x;
-
- if (x instanceof Node) {
- this.titleElement.removeChildren();
- this.titleElement.appendChild(x);
- } else
- this.titleElement.textContent = x;
- },
-
- get subtitle()
- {
- return this._subtitle;
- },
-
- set subtitle(x)
- {
- if (this._subtitle === x)
- return;
- this._subtitle = x;
- this.subtitleElement.textContent = x;
- },
-
- get expanded()
- {
- return this._expanded;
- },
-
- set expanded(x)
- {
- if (x)
- this.expand();
- else
- this.collapse();
- },
-
- get populated()
- {
- return this._populated;
- },
-
- set populated(x)
- {
- this._populated = x;
- if (!x && this._expanded) {
- this.onpopulate();
- this._populated = true;
- }
- },
-
- onpopulate: function()
- {
- // Overriden by subclasses.
- },
-
- get firstSibling()
- {
- var parent = this.element.parentElement;
- if (!parent)
- return null;
-
- var childElement = parent.firstChild;
- while (childElement) {
- if (childElement._section)
- return childElement._section;
- childElement = childElement.nextSibling;
- }
-
- return null;
- },
-
- get lastSibling()
- {
- var parent = this.element.parentElement;
- if (!parent)
- return null;
-
- var childElement = parent.lastChild;
- while (childElement) {
- if (childElement._section)
- return childElement._section;
- childElement = childElement.previousSibling;
- }
-
- return null;
- },
-
- get nextSibling()
- {
- var curElement = this.element;
- do {
- curElement = curElement.nextSibling;
- } while (curElement && !curElement._section);
-
- return curElement ? curElement._section : null;
- },
-
- get previousSibling()
- {
- var curElement = this.element;
- do {
- curElement = curElement.previousSibling;
- } while (curElement && !curElement._section);
-
- return curElement ? curElement._section : null;
- },
-
- expand: function()
- {
- if (this._expanded)
- return;
- this._expanded = true;
- this.element.classList.add("expanded");
-
- if (!this._populated) {
- this.onpopulate();
- this._populated = true;
- } else
- this.dispatchEventToListeners(WebInspector.Section.Event.VisibleContentDidChange);
- },
-
- collapse: function()
- {
- if (!this._expanded)
- return;
- this._expanded = false;
- this.element.classList.remove("expanded");
- },
-
- toggleExpanded: function()
- {
- this.expanded = !this.expanded;
- },
-
- handleClick: function(e)
- {
- this.toggleExpanded();
- e.stopPropagation();
- }
-};
-
-WebInspector.Section.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSourceCodeTextEditorcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.css (184735 => 184736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.css        2015-05-21 23:30:15 UTC (rev 184735)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.css        2015-05-21 23:33:42 UTC (rev 184736)
</span><span class="lines">@@ -136,6 +136,9 @@
</span><span class="cx"> .popover .expandable {
</span><span class="cx"> min-width: 300px;
</span><span class="cx"> min-height: 250px;
</span><ins>+
+ max-width: 350px;
+ max-height: 450px;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> .popover .debugger-popover-content > .title {
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSourceCodeTextEditorjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js (184735 => 184736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js        2015-05-21 23:30:15 UTC (rev 184735)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js        2015-05-21 23:33:42 UTC (rev 184736)
</span><span class="lines">@@ -269,7 +269,7 @@
</span><span class="cx"> return newActivatedState;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- showPopoverForTypes(types, bounds, title)
</del><ins>+ showPopoverForTypes(typeDescription, bounds, title)
</ins><span class="cx"> {
</span><span class="cx"> var content = document.createElement("div");
</span><span class="cx"> content.className = "object expandable";
</span><span class="lines">@@ -279,11 +279,12 @@
</span><span class="cx"> titleElement.textContent = title;
</span><span class="cx"> content.appendChild(titleElement);
</span><span class="cx">
</span><del>- var section = new WebInspector.TypePropertiesSection(types);
- section.expanded = true;
- section.element.classList.add("body");
- content.appendChild(section.element);
</del><ins>+ var bodyElement = content.appendChild(document.createElement("div"));
+ bodyElement.className = "body";
</ins><span class="cx">
</span><ins>+ var typeTreeView = new WebInspector.TypeTreeView(typeDescription);
+ bodyElement.appendChild(typeTreeView.element);
+
</ins><span class="cx"> this._showPopover(content, bounds);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1417,10 +1418,11 @@
</span><span class="cx"> console.assert(allTypes.length === 1);
</span><span class="cx"> if (!allTypes.length)
</span><span class="cx"> return;
</span><del>- var types = allTypes[0];
- if (types.isValid) {
</del><ins>+
+ var typeDescription = WebInspector.TypeDescription.fromPayload(allTypes[0]);
+ if (typeDescription.valid) {
</ins><span class="cx"> var popoverTitle = WebInspector.TypeTokenView.titleForPopover(WebInspector.TypeTokenView.TitleType.Variable, candidate.expression);
</span><del>- this.showPopoverForTypes(types, null, popoverTitle);
</del><ins>+ this.showPopoverForTypes(typeDescription, null, popoverTitle);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1509,7 +1511,13 @@
</span><span class="cx"> bodyElement.className = "body";
</span><span class="cx"> bodyElement.appendChild(objectTree.element);
</span><span class="cx">
</span><del>- this._showPopover(content);
</del><ins>+ // Show the popover once we have the first set of properties for the object.
+ var candidate = this.tokenTrackingController.candidate;
+ objectTree.addEventListener(WebInspector.ObjectTreeView.Event.Updated, function() {
+ if (candidate === this.tokenTrackingController.candidate)
+ this._showPopover(content);
+ objectTree.removeEventListener(null, null, this);
+ }, this);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> _showPopoverWithFormattedValue(remoteObject)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTypePropertiesSectionjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Views/TypePropertiesSection.js (184735 => 184736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TypePropertiesSection.js        2015-05-21 23:30:15 UTC (rev 184735)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TypePropertiesSection.js        2015-05-21 23:33:42 UTC (rev 184736)
</span><span class="lines">@@ -1,184 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014-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.
- */
-
-WebInspector.TypePropertiesSection = function(types, title, subtitle)
-{
- this.emptyPlaceholder = WebInspector.UIString("No Properties");
- this.types = types;
- this._typeSet = WebInspector.TypeSet.fromPayload(this.types);
-
- WebInspector.PropertiesSection.call(this, title, subtitle);
-};
-
-WebInspector.TypePropertiesSection.prototype = {
- constructor: WebInspector.TypePropertiesSection,
- __proto__: WebInspector.PropertiesSection.prototype,
-
- onpopulate: function()
- {
- this.propertiesTreeOutline.removeChildren();
-
- var primitiveTypeNames = this._typeSet.primitiveTypeNames;
- var structures = this.types.structures;
- var properties = [];
- for (var struct of structures) {
- properties.push({
- name: struct.constructorName,
- structure: struct
- });
- }
- for (var primitiveName of primitiveTypeNames) {
- properties.push({
- name: primitiveName,
- structure: null
- });
- }
-
- properties.sort(WebInspector.TypePropertiesSection.PropertyComparator);
-
- if (this.types.isTruncated)
- properties.push({name: "\u2026", structure: null});
-
- for (var property of properties)
- this.propertiesTreeOutline.appendChild(new WebInspector.TypePropertyTreeElement(property));
-
- if (!this.propertiesTreeOutline.children.length) {
- var title = document.createElement("div");
- title.className = "info";
- title.textContent = this.emptyPlaceholder;
- var infoElement = new WebInspector.TreeElement(title, null, false);
- this.propertiesTreeOutline.appendChild(infoElement);
- }
-
- this.dispatchEventToListeners(WebInspector.Section.Event.VisibleContentDidChange);
-
- if (properties.length === 1)
- this.propertiesTreeOutline.children[0].expandRecursively();
- }
-};
-
-// This is mostly identical to ObjectTreeView.compareProperties.
-// But this checks for equality because we can have two objects named the same thing.
-WebInspector.TypePropertiesSection.PropertyComparator = function(propertyA, propertyB)
-{
- var a = propertyA.name;
- var b = propertyB.name;
- if (a.indexOf("__proto__") !== -1)
- return 1;
- if (b.indexOf("__proto__") !== -1)
- return -1;
- if (a === b)
- return 0;
-
- var diff = 0;
- var chunk = /^\d+|^\D+/;
- var chunka, chunkb, anum, bnum;
- while (diff === 0) {
- if (!a && b)
- return -1;
- if (!b && a)
- return 1;
- chunka = a.match(chunk)[0];
- chunkb = b.match(chunk)[0];
- anum = !isNaN(chunka);
- bnum = !isNaN(chunkb);
- if (anum && !bnum)
- return -1;
- if (bnum && !anum)
- return 1;
- if (anum && bnum) {
- diff = chunka - chunkb;
- if (diff === 0 && chunka.length !== chunkb.length) {
- if (!+chunka && !+chunkb) // chunks are strings of all 0s (special case)
- return chunka.length - chunkb.length;
- else
- return chunkb.length - chunka.length;
- }
- } else if (chunka !== chunkb)
- return (chunka < chunkb) ? -1 : 1;
- a = a.substring(chunka.length);
- b = b.substring(chunkb.length);
- }
-
- return diff;
-};
-
-WebInspector.TypePropertyTreeElement = class TypePropertyTreeElement extends WebInspector.TreeElement
-{
- constructor(property)
- {
- var titleElement = document.createElement("span");
- super(titleElement, null, false);
-
- this.property = property;
-
- titleElement.className = "name";
- titleElement.textContent = this.property.name;
-
- this.toggleOnClick = true;
- this.hasChildren = !!this.property.structure;
- }
-
- onpopulate()
- {
- this.removeChildren();
-
- var properties = [];
- for (var fieldName of this.property.structure.fields) {
- properties.push({
- name: fieldName,
- structure: null
- });
- }
-
- properties.sort(WebInspector.TypePropertiesSection.PropertyComparator);
-
- for (var property of properties)
- this.appendChild(new WebInspector.TypePropertyTreeElement(property));
-
- properties = [];
- for (var fieldName of this.property.structure.optionalFields) {
- properties.push({
- name: fieldName + "?",
- structure: null
- });
- }
-
- properties.sort(WebInspector.TypePropertiesSection.PropertyComparator);
-
- if (this.property.structure.isImprecise)
- properties.push({name: "\u2026", structure: null});
-
- if (this.property.structure.prototypeStructure) {
- properties.push({
- name: this.property.structure.prototypeStructure.constructorName + " (" + WebInspector.UIString("Prototype") + ")",
- structure: this.property.structure.prototypeStructure
- });
- }
-
- for (var property of properties)
- this.appendChild(new WebInspector.TypePropertyTreeElement(property));
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTypeTokenViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TypeTokenView.js (184735 => 184736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TypeTokenView.js        2015-05-21 23:30:15 UTC (rev 184735)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TypeTokenView.js        2015-05-21 23:33:42 UTC (rev 184736)
</span><span class="lines">@@ -40,8 +40,9 @@
</span><span class="cx">
</span><span class="cx"> this.element = span;
</span><span class="cx"> this._tokenAnnotator = tokenAnnotator;
</span><del>- this._types = null;
- this._typeSet = null;
</del><ins>+
+ this._typeDescription = null;
+
</ins><span class="cx"> this._colorClass = null;
</span><span class="cx">
</span><span class="cx"> this._popoverTitle = WebInspector.TypeTokenView.titleForPopover(titleType, functionOrVariableName);
</span><span class="lines">@@ -53,26 +54,23 @@
</span><span class="cx">
</span><span class="cx"> static titleForPopover(titleType, functionOrVariableName)
</span><span class="cx"> {
</span><del>- var titleString = null;
</del><span class="cx"> if (titleType === WebInspector.TypeTokenView.TitleType.Variable)
</span><del>- titleString = WebInspector.UIString("Type information for variable: %s").format(functionOrVariableName);
- else {
- if (functionOrVariableName)
- titleString = WebInspector.UIString("Return type for function: %s").format(functionOrVariableName);
- else
- titleString = WebInspector.UIString("Return type for anonymous function");
- }
</del><ins>+ return WebInspector.UIString("Type information for variable: %s").format(functionOrVariableName);
</ins><span class="cx">
</span><del>- return titleString;
</del><ins>+ if (functionOrVariableName)
+ return WebInspector.UIString("Return type for function: %s").format(functionOrVariableName);
+
+ return WebInspector.UIString("Return type for anonymous function");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Public
</span><span class="cx">
</span><del>- update(types)
</del><ins>+ update(typeDescription)
</ins><span class="cx"> {
</span><del>- this._types = types;
- this._typeSet = WebInspector.TypeSet.fromPayload(this._types);
</del><ins>+ console.assert(typeDescription instanceof WebInspector.TypeDescription);
</ins><span class="cx">
</span><ins>+ this._typeDescription = typeDescription;
+
</ins><span class="cx"> var title = this._displayTypeName();
</span><span class="cx"> if (title === this.element.textContent)
</span><span class="cx"> return;
</span><span class="lines">@@ -100,7 +98,7 @@
</span><span class="cx">
</span><span class="cx"> var domRect = this.element.getBoundingClientRect();
</span><span class="cx"> var bounds = new WebInspector.Rect(domRect.left, domRect.top, domRect.width, domRect.height);
</span><del>- this._tokenAnnotator.sourceCodeTextEditor.showPopoverForTypes(this._types, bounds, this._popoverTitle);
</del><ins>+ this._tokenAnnotator.sourceCodeTextEditor.showPopoverForTypes(this._typeDescription, bounds, this._popoverTitle);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (this._shouldShowPopover())
</span><span class="lines">@@ -115,13 +113,13 @@
</span><span class="cx">
</span><span class="cx"> _shouldShowPopover()
</span><span class="cx"> {
</span><del>- if (!this._types.isValid)
</del><ins>+ if (!this._typeDescription.valid)
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (this._typeSet.primitiveTypeNames.length > 1)
</del><ins>+ if (this._typeDescription.typeSet.primitiveTypeNames.length > 1)
</ins><span class="cx"> return true;
</span><span class="cx">
</span><del>- if (this._types.structures && this._types.structures.length)
</del><ins>+ if (this._typeDescription.structures && this._typeDescription.structures.length)
</ins><span class="cx"> return true;
</span><span class="cx">
</span><span class="cx"> return false;
</span><span class="lines">@@ -129,16 +127,16 @@
</span><span class="cx">
</span><span class="cx"> _displayTypeName()
</span><span class="cx"> {
</span><del>- if (!this._types.isValid)
</del><ins>+ if (!this._typeDescription.valid)
</ins><span class="cx"> return "";
</span><span class="cx">
</span><del>- var typeSet = this._typeSet;
</del><ins>+ var typeSet = this._typeDescription.typeSet;
</ins><span class="cx">
</span><del>- if (this._types.leastCommonAncestor && !this._typeSet.primitiveTypeNames.length) {
</del><ins>+ if (this._typeDescription.leastCommonAncestor && !this._typeDescription.typeSet.primitiveTypeNames.length) {
</ins><span class="cx"> if (typeSet.isContainedIn(WebInspector.TypeSet.TypeBit.Object))
</span><del>- return this._types.leastCommonAncestor;
</del><ins>+ return this._typeDescription.leastCommonAncestor;
</ins><span class="cx"> if (typeSet.isContainedIn(WebInspector.TypeSet.TypeBit.Object | WebInspector.TypeSet.NullOrUndefinedTypeBits))
</span><del>- return this._types.leastCommonAncestor + "?";
</del><ins>+ return this._typeDescription.leastCommonAncestor + "?";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // The order of these checks are important.
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTypeTreeElementcss"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/TypeTreeElement.css (0 => 184736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TypeTreeElement.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TypeTreeElement.css        2015-05-21 23:33:42 UTC (rev 184736)
</span><span class="lines">@@ -0,0 +1,88 @@
</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.
+ */
+
+.type-tree-element {
+ margin-top: 1px;
+}
+
+.type-tree-element > .titles {
+ position: relative;
+ line-height: normal;
+ padding-bottom: 1px;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
+ display: inline-block;
+ vertical-align: top;
+}
+
+.type-tree-element > .disclosure-button {
+ display: inline-block;
+ vertical-align: top;
+
+ width: 15px;
+ height: 16px;
+
+ margin-left: -1px;
+ border: 0;
+ background: none;
+ -webkit-appearance: none;
+}
+
+.type-tree-element.parent > .disclosure-button {
+ background-color: transparent;
+ background-image: -webkit-canvas(navigation-sidebar-panel-disclosure-triangle-closed-normal);
+ background-repeat: no-repeat;
+ background-position: center;
+ background-size: 13px 13px;
+}
+
+.type-tree-element.parent.expanded > .disclosure-button {
+ background-image: -webkit-canvas(navigation-sidebar-panel-disclosure-triangle-open-normal);
+}
+
+.type-tree-element > .icon {
+ display: none;
+}
+
+.type-tree-element.prototype {
+ display: inline-block;
+
+ border: 1px solid hsla(0, 0%, 0%, 0.06);
+ background-color: hsla(0, 0%, 0%, 0.03);
+ border-radius: 3px;
+
+ padding: 0 10px 1px 0;
+ margin: 3px 0 2px 0;
+}
+
+.type-tree-element.prototype:hover,
+.type-tree-element.prototype:focus {
+ border-color: hsla(0, 0%, 0%, 0.1);
+}
+
+.type-tree-element.prototype + ol {
+ -webkit-padding-start: 0px;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTypeTreeElementjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/TypeTreeElement.js (0 => 184736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TypeTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TypeTreeElement.js        2015-05-21 23:33:42 UTC (rev 184736)
</span><span class="lines">@@ -0,0 +1,131 @@
</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.
+ */
+
+WebInspector.TypeTreeElement = class TypeTreeElement extends WebInspector.GeneralTreeElement
+{
+ constructor(name, structureDescription, isPrototype)
+ {
+ super(null, null, null, structureDescription || null, false);
+
+ console.assert(!structureDescription || structureDescription instanceof WebInspector.StructureDescription);
+
+ this._name = name;
+ this._structureDescription = structureDescription || null;
+ this._isPrototype = isPrototype;
+
+ this._populated = false;
+ this._autoExpandedChildren = false;
+
+ this.small = true;
+ this.toggleOnClick = true;
+ this.selectable = false;
+ this.tooltipHandledSeparately = true;
+ this.hasChildren = structureDescription;
+
+ var displayName = this._isPrototype ? WebInspector.UIString("%s Prototype").format(name.replace(/Prototype$/, "")) : name;
+ var nameElement = document.createElement("span");
+ nameElement.classList.add("type-name");
+ nameElement.textContent = displayName;
+ this.mainTitle = nameElement;
+
+ this.addClassName("type-tree-element");
+ if (this._isPrototype)
+ this.addClassName("prototype");
+ }
+
+ // Public
+
+ get name()
+ {
+ return this._name;
+ }
+
+ get isPrototype()
+ {
+ return this._isPrototype;
+ }
+
+ // Protected
+
+ onpopulate()
+ {
+ if (this._populated)
+ return;
+
+ this._populated = true;
+
+ var properties = [];
+ for (var name of this._structureDescription.fields) {
+ // FIXME: The backend can send us an empty string. Why? (Symbol?)
+ if (name === "")
+ continue;
+ properties.push({name});
+ }
+ properties.sort(WebInspector.ObjectTreeView.comparePropertyDescriptors);
+
+ var optionalProperties = [];
+ for (var name of this._structureDescription.optionalFields) {
+ // FIXME: The backend can send us an empty string. Why? (Symbol?)
+ if (name === "")
+ continue;
+ optionalProperties.push({name: name + "?"});
+ }
+ optionalProperties.sort(WebInspector.ObjectTreeView.comparePropertyDescriptors);
+
+ for (var property of properties)
+ this.appendChild(new WebInspector.TypeTreeElement(property.name, null));
+ for (var property of optionalProperties)
+ this.appendChild(new WebInspector.TypeTreeElement(property.name, null));
+
+ if (this._structureDescription.imprecise) {
+ var truncatedMessageElement = WebInspector.ObjectTreeView.createEmptyMessageElement("\u2026");
+ this.appendChild(new WebInspector.TreeElement(truncatedMessageElement, null, false));
+ }
+
+ if (!this.children.length) {
+ var emptyMessageElement = WebInspector.ObjectTreeView.createEmptyMessageElement(WebInspector.UIString("No properties."));
+ this.appendChild(new WebInspector.TreeElement(emptyMessageElement, null, false));
+ }
+
+ console.assert(this.children.length > 0);
+
+ var prototypeStructure = this._structureDescription.prototypeStructure;
+ if (prototypeStructure)
+ this.appendChild(new WebInspector.TypeTreeElement(prototypeStructure.constructorName, prototypeStructure, true));
+ }
+
+ onexpand()
+ {
+ if (this._autoExpandedChildren)
+ return;
+
+ this._autoExpandedChildren = true;
+
+ // On first expand, auto-expand children until "Object".
+ var lastChild = this.children[this.children.length - 1];
+ if (lastChild && lastChild.hasChildren && lastChild.isPrototype && lastChild.name !== "Object")
+ lastChild.expand();
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTypeTreeViewcssfromrev184734trunkSourceWebInspectorUIUserInterfaceViewsPropertiesSectionjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TypeTreeView.css (from rev 184734, trunk/Source/WebInspectorUI/UserInterface/Views/PropertiesSection.js) (0 => 184736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TypeTreeView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TypeTreeView.css        2015-05-21 23:33:42 UTC (rev 184736)
</span><span class="lines">@@ -0,0 +1,65 @@
</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.
+ */
+
+.type-tree {
+ position: relative;
+ display: block;
+
+ color: black;
+ font-family: -webkit-system-font, sans-serif;
+ font-size: 12px;
+}
+
+.type-tree-outline {
+ margin: 0;
+ padding: 0 6px 2px;
+ list-style: none;
+ min-height: 18px;
+ outline: none;
+}
+
+.type-tree-outline li {
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ -webkit-user-select: text;
+ cursor: default;
+}
+
+.type-tree-outline ol {
+ display: none;
+ margin: 0;
+ -webkit-padding-start: 16px;
+ list-style: none;
+}
+
+.type-tree-outline ol.expanded {
+ display: block;
+}
+
+.type-tree-outline li .empty-message {
+ color: rgb(60%, 60%, 60%);
+ margin-left: 13px;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTypeTreeViewjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/TypeTreeView.js (0 => 184736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TypeTreeView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TypeTreeView.js        2015-05-21 23:33:42 UTC (rev 184736)
</span><span class="lines">@@ -0,0 +1,92 @@
</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.
+ */
+
+WebInspector.TypeTreeView = class TypeTreeView extends WebInspector.Object
+{
+ constructor(typeDescription)
+ {
+ super();
+
+ console.assert(typeDescription instanceof WebInspector.TypeDescription);
+
+ this._typeDescription = typeDescription;
+
+ this._element = document.createElement("div");
+ this._element.className = "type-tree";
+
+ this._outlineElement = document.createElement("ol");
+ this._outlineElement.className = "type-tree-outline";
+ this._outline = new WebInspector.TreeOutline(this._outlineElement);
+ this._element.appendChild(this._outlineElement);
+
+ this._populate();
+
+ // Auto-expand if there is one sub-type. TypeTreeElement handles further auto-expansion.
+ if (this._outline.children.length === 1)
+ this._outline.children[0].expand();
+ }
+
+ // Public
+
+ get typeDescription()
+ {
+ return this._typeDescription;
+ }
+
+ get element()
+ {
+ return this._element;
+ }
+
+ get treeOutline()
+ {
+ return this._outline;
+ }
+
+ // Private
+
+ _populate()
+ {
+ var types = [];
+ for (var structure of this._typeDescription.structures)
+ types.push({name: structure.constructorName, structure});
+ for (var primitiveName of this._typeDescription.typeSet.primitiveTypeNames)
+ types.push({name: primitiveName});
+ types.sort(WebInspector.ObjectTreeView.comparePropertyDescriptors);
+
+ for (var type of types)
+ this._outline.appendChild(new WebInspector.TypeTreeElement(type.name, type.structure, false));
+
+ if (this._typeDescription.truncated) {
+ var truncatedMessageElement = WebInspector.ObjectTreeView.createEmptyMessageElement("\u2026");
+ this._outline.appendChild(new WebInspector.TreeElement(truncatedMessageElement, null, false));
+ }
+
+ if (!this._outline.children.length) {
+ var errorMessageElement = WebInspector.ObjectTreeView.createEmptyMessageElement(WebInspector.UIString("No properties."));
+ this._outline.appendChild(new WebInspector.TreeElement(errorMessageElement, null, false));
+ }
+ }
+};
</ins></span></pre>
</div>
</div>
</body>
</html>