Changeset 181704 in webkit
- Timestamp:
- Mar 18, 2015, 11:30:47 AM (11 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 1 deleted
- 8 edited
-
ChangeLog (modified) (1 diff)
-
UserInterface/Main.html (modified) (1 diff)
-
UserInterface/Models/PropertyPath.js (modified) (5 diffs)
-
UserInterface/Views/ObjectTreeView.css (modified) (2 diffs)
-
UserInterface/Views/ObjectTreeView.js (modified) (4 diffs)
-
UserInterface/Views/ScopeChainDetailsSidebarPanel.js (modified) (7 diffs)
-
UserInterface/Views/ScopeVariableTreeElement.js (deleted)
-
WebInspectorUI.vcxproj/WebInspectorUI.vcxproj (modified) (1 diff)
-
WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r181675 r181704 1 2015-03-18 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Scopes sidebar should use new ObjectTreeView and not ObjectPropertiesSection 4 https://bugs.webkit.org/show_bug.cgi?id=142808 5 6 Reviewed by Timothy Hatcher. 7 8 * UserInterface/Models/PropertyPath.js: 9 (WebInspector.PropertyPath): 10 (WebInspector.PropertyPath.emptyPropertyPathForScope): 11 Allow a special property empty path for "Scopes". This way for a 12 "<scopeObject>.property" we can show just the tooltip "property". 13 14 * UserInterface/Views/ObjectTreeView.css: 15 (.object-tree.properties-only > :matches(.title, .object-preview)): 16 (.object-tree.properties-only .object-tree-outline): 17 (.object-tree.properties-only .object-tree-property .property-name): 18 Tweak styles for only properties view, which won't have a top-level 19 preview and doesn't fade out enumerable properties. 20 21 * UserInterface/Views/ObjectTreeView.js: 22 (WebInspector.ObjectTreeView.prototype.get treeOutline): 23 Access the TreeOutline. 24 25 (WebInspector.ObjectTreeView.prototype.showOnlyProperties): 26 Properties only view modifies the display slightly. 27 28 (WebInspector.ObjectTreeView.prototype.appendExtraPropertyDescriptor): 29 (WebInspector.ObjectTreeView.prototype._updateProperties): 30 Allow the client to add its own property descriptors to display 31 as a property in this ObjectTreeView. 32 33 * UserInterface/Views/ScopeChainDetailsSidebarPanel.js: 34 (WebInspector.ScopeChainDetailsSidebarPanel.prototype.refresh): 35 Switch to using an ObjectTreeView. 36 37 (WebInspector.ScopeChainDetailsSidebarPanel.prototype._propertyPathIdentifierForTreeElement): 38 (WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeAddHandler): 39 (WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeExpandHandler): 40 (WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeCollapseHandler): 41 Keep track of what properties were expanded so we can auto-expand 42 them again when the sidebar refreshes. 43 44 * UserInterface/Main.html: 45 * UserInterface/Views/ScopeVariableTreeElement.js: Removed. 46 * WebInspectorUI.vcxproj/WebInspectorUI.vcxproj: 47 * WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters: 48 Remove the now unused ScopeVariableTreeElement.js. 49 1 50 2015-03-17 Joseph Pecoraro <pecoraro@apple.com> 2 51 -
trunk/Source/WebInspectorUI/UserInterface/Main.html
r181626 r181704 456 456 <script src="Views/ScopeBarItem.js"></script> 457 457 <script src="Views/ScopeChainDetailsSidebarPanel.js"></script> 458 <script src="Views/ScopeVariableTreeElement.js"></script>459 458 <script src="Views/ScriptContentView.js"></script> 460 459 <script src="Views/ScriptTimelineDataGrid.js"></script> -
trunk/Source/WebInspectorUI/UserInterface/Models/PropertyPath.js
r181186 r181704 39 39 40 40 this._object = object; 41 this._pathComponent = pathComponent ||null;41 this._pathComponent = typeof pathComponent === "string" ? pathComponent : null; 42 42 this._parent = parent || null; 43 43 this._isPrototype = isPrototype || false; … … 50 50 MapValue: "@mapvalue", 51 51 SetIndex: "@setindex", 52 EmptyPathComponentForScope: "", 52 53 }; 53 54 … … 57 58 Setter: "setter", 58 59 }; 60 61 WebInspector.PropertyPath.emptyPropertyPathForScope = function(object) 62 { 63 return new WebInspector.PropertyPath(object, WebInspector.PropertyPath.SpecialPathComponent.EmptyPathComponentForScope); 64 } 59 65 60 66 WebInspector.PropertyPath.prototype = { … … 149 155 }, 150 156 157 isScope() 158 { 159 return this._pathComponent === WebInspector.PropertyPath.SpecialPathComponent.EmptyPathComponentForScope; 160 }, 161 151 162 isPathComponentImpossible() 152 163 { … … 168 179 { 169 180 var isPrototype = propertyName === "__proto__"; 181 182 if (this.isScope()) 183 return new WebInspector.PropertyPath(object, propertyName, this, isPrototype); 184 170 185 var component = this._canPropertyNameBeDotAccess(propertyName) ? "." + propertyName : "[" + doubleQuotedString(propertyName) + "]"; 171 186 return new WebInspector.PropertyPath(object, component, this, isPrototype); -
trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css
r180722 r181704 57 57 } 58 58 59 .object-tree.properties-only > :matches(.title, .object-preview) { 60 display: none; 61 } 62 59 63 .object-tree.expanded .object-preview { 60 64 font-style: normal; … … 80 84 min-height: 18px; 81 85 outline: none; 86 } 87 88 .object-tree.properties-only .object-tree-outline { 89 padding-left: 0; 90 } 91 92 .object-tree.properties-only .object-tree-property .property-name { 93 opacity: 1; 82 94 } 83 95 -
trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js
r181612 r181704 152 152 }, 153 153 154 get treeOutline() 155 { 156 return this._outline; 157 }, 158 154 159 get expanded() 155 160 { … … 185 190 186 191 this._untrackWeakEntries(); 192 }, 193 194 showOnlyProperties() 195 { 196 this._inConsole = false; 197 198 this._element.classList.add("properties-only"); 187 199 }, 188 200 … … 193 205 else 194 206 this._titleElement.appendChild(suffixElement); 207 }, 208 209 appendExtraPropertyDescriptor(propertyDescriptor) 210 { 211 if (!this._extraProperties) 212 this._extraProperties = []; 213 214 this._extraProperties.push(propertyDescriptor); 195 215 }, 196 216 … … 244 264 _updateProperties(properties, propertyPath) 245 265 { 266 if (this._extraProperties) 267 properties = properties.concat(this._extraProperties); 268 246 269 properties.sort(WebInspector.ObjectTreeView.ComparePropertyDescriptors); 247 270 -
trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js
r175767 r181704 34 34 }; 35 35 36 WebInspector.ScopeChainDetailsSidebarPanel.autoExpandProperties = new Set; 37 36 38 WebInspector.ScopeChainDetailsSidebarPanel.prototype = { 37 39 constructor: WebInspector.ScopeChainDetailsSidebarPanel, … … 40 42 // Public 41 43 42 inspect : function(objects)44 inspect(objects) 43 45 { 44 46 // Convert to a single item array if needed. … … 76 78 }, 77 79 78 refresh : function()80 refresh() 79 81 { 80 82 var callFrame = this.callFrame; … … 94 96 95 97 var title = null; 96 var extraPropert ies= null;98 var extraPropertyDescriptor = null; 97 99 var collapsedByDefault = false; 98 100 var dontHighlightNonEnumerableProperties = true; … … 109 111 110 112 if (callFrame.thisObject) 111 extraPropert ies = [new WebInspector.RemoteObjectProperty("this", callFrame.thisObject)];113 extraPropertyDescriptor = new WebInspector.PropertyDescriptor({name: "this", value: callFrame.thisObject}); 112 114 break; 113 115 … … 145 147 var detailsSectionIdentifier = scope.type + "-" + sectionCountByType[scope.type]; 146 148 147 var section = new WebInspector.ObjectPropertiesSection(scope.object, null, null, null, true, extraProperties, WebInspector.ScopeVariableTreeElement); 148 section.dontHighlightNonEnumerablePropertiesAtTopLevel = dontHighlightNonEnumerableProperties; 149 section.__propertyIdentifierPrefix = detailsSectionIdentifier; 149 var scopePropertyPath = WebInspector.PropertyPath.emptyPropertyPathForScope(scope.object); 150 var objectTree = new WebInspector.ObjectTreeView(scope.object, WebInspector.ObjectTreeView.Mode.Properties, scopePropertyPath); 151 152 objectTree.showOnlyProperties(); 153 154 if (extraPropertyDescriptor) 155 objectTree.appendExtraPropertyDescriptor(extraPropertyDescriptor); 156 157 var treeOutline = objectTree.treeOutline; 158 treeOutline.onadd = this._objectTreeAddHandler.bind(this, detailsSectionIdentifier); 159 treeOutline.onexpand = this._objectTreeExpandHandler.bind(this, detailsSectionIdentifier); 160 treeOutline.oncollapse = this._objectTreeCollapseHandler.bind(this, detailsSectionIdentifier); 150 161 151 162 var detailsSection = new WebInspector.DetailsSection(detailsSectionIdentifier, title, null, null, collapsedByDefault); 152 detailsSection.groups[0].rows = [new WebInspector.DetailsSectionPropertiesRow( section)];163 detailsSection.groups[0].rows = [new WebInspector.DetailsSectionPropertiesRow(objectTree)]; 153 164 detailsSections.push(detailsSection); 154 165 } … … 171 182 // if the debugger is paused in code that was executed from the console. The console will be waiting for 172 183 // the result of the execution and without a timeout we would never update the scope variables. 173 var timeout = setTimeout(delayedWork.bind(this), 50); 174 175 // Since ObjectPropertiesSection populates asynchronously, we want to wait to replace the existing content 184 var delay = WebInspector.ScopeChainDetailsSidebarPanel.autoExpandProperties.size === 0 ? 50 : 250; 185 var timeout = setTimeout(delayedWork.bind(this), delay); 186 187 // Since ObjectTreeView populates asynchronously, we want to wait to replace the existing content 176 188 // until after all the pending asynchronous requests are completed. This prevents severe flashing while stepping. 177 189 InspectorBackend.runAfterPendingDispatches(delayedWork.bind(this)); 190 }, 191 192 _propertyPathIdentifierForTreeElement(identifier, objectPropertyTreeElement) 193 { 194 if (!objectPropertyTreeElement.property) 195 return null; 196 197 var propertyPath = objectPropertyTreeElement.thisPropertyPath(); 198 if (propertyPath.isFullPathImpossible()) 199 return null; 200 201 return identifier + "-" + propertyPath.fullPath; 202 }, 203 204 _objectTreeAddHandler(identifier, treeElement) 205 { 206 var propertyPathIdentifier = this._propertyPathIdentifierForTreeElement(identifier, treeElement); 207 if (!propertyPathIdentifier) 208 return; 209 210 if (WebInspector.ScopeChainDetailsSidebarPanel.autoExpandProperties.has(propertyPathIdentifier)) 211 treeElement.expand(); 212 }, 213 214 _objectTreeExpandHandler(identifier, treeElement) 215 { 216 var propertyPathIdentifier = this._propertyPathIdentifierForTreeElement(identifier, treeElement); 217 if (!propertyPathIdentifier) 218 return; 219 220 WebInspector.ScopeChainDetailsSidebarPanel.autoExpandProperties.add(propertyPathIdentifier); 221 }, 222 223 _objectTreeCollapseHandler(identifier, treeElement) 224 { 225 var propertyPathIdentifier = this._propertyPathIdentifierForTreeElement(identifier, treeElement); 226 if (!propertyPathIdentifier) 227 return; 228 229 WebInspector.ScopeChainDetailsSidebarPanel.autoExpandProperties.delete(propertyPathIdentifier); 178 230 } 179 231 }; -
trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.vcxproj
r181626 r181704 761 761 <None Include="..\UserInterface\ScopeChainDetailsSidebarPanel.js" /> 762 762 <None Include="..\UserInterface\ScopeChainNode.js" /> 763 <None Include="..\UserInterface\ScopeVariableTreeElement.js" />764 763 <None Include="..\UserInterface\Script.js" /> 765 764 <None Include="..\UserInterface\ScriptContentView.css" /> -
trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters
r181626 r181704 853 853 <Filter>UserInterface</Filter> 854 854 </None> 855 <None Include="..\UserInterface\ScopeVariableTreeElement.js">856 <Filter>UserInterface</Filter>857 </None>858 855 <None Include="..\UserInterface\Script.js"> 859 856 <Filter>UserInterface</Filter>
Note:
See TracChangeset
for help on using the changeset viewer.