Changeset 161677 in webkit
- Timestamp:
- Jan 10, 2014 2:13:07 PM (10 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r161674 r161677 1 2014-01-10 Timothy Hatcher <timothy@apple.com> 2 3 Clean up some areas of TreeOutline. 4 5 https://bugs.webkit.org/show_bug.cgi?id=123924 6 7 Reviewed by Joseph Pecoraro. 8 9 * UserInterface/TreeOutline.js: 10 (TreeOutline.prototype.appendChild): Don't force create _childrenListNode, it will be created 11 when the tree element is expanded. Only attach if _childrenListNode already exists. 12 (TreeOutline.prototype.insertChild): Ditto. 13 (TreeOutline.prototype.getCachedTreeElement): Check the value of __treeElementIdentifier 14 not just the existence of the property. It should never be null/undefined/0, but be safe. 15 (TreeOutline.prototype.findTreeElement): Null check isAncestor, it isn't required. 16 1 17 2014-01-10 Timothy Hatcher <timothy@apple.com> 2 18 -
trunk/Source/WebInspectorUI/UserInterface/TreeOutline.js
r160025 r161677 92 92 child.expanded = child.treeOutline._treeElementsExpandedState[child.identifier]; 93 93 94 if (!this._childrenListNode) { 95 this._childrenListNode = this.treeOutline._childrenListNode.ownerDocument.createElement("ol"); 96 this._childrenListNode.parentTreeElement = this; 97 this._childrenListNode.classList.add("children"); 98 if (this.hidden) 99 this._childrenListNode.classList.add("hidden"); 100 } 101 102 child._attach(); 94 if (this._childrenListNode) 95 child._attach(); 103 96 104 97 if (this.treeOutline.onadd) … … 148 141 child.expanded = child.treeOutline._treeElementsExpandedState[child.identifier]; 149 142 150 if (!this._childrenListNode) { 151 this._childrenListNode = this.treeOutline._childrenListNode.ownerDocument.createElement("ol"); 152 this._childrenListNode.parentTreeElement = this; 153 this._childrenListNode.classList.add("children"); 154 if (this.hidden) 155 this._childrenListNode.classList.add("hidden"); 156 } 157 158 child._attach(); 143 if (this._childrenListNode) 144 child._attach(); 159 145 160 146 if (this.treeOutline.onadd) … … 294 280 return null; 295 281 296 if ( "__treeElementIdentifier" in representedObject) {282 if (representedObject.__treeElementIdentifier) { 297 283 // If this representedObject has a tree element identifier, and it is a known TreeElement 298 284 // in our tree we can just return that tree element. … … 322 308 for (var i = 0; i < this.children.length; ++i) { 323 309 item = this.children[i]; 324 if (item.representedObject === representedObject || isAncestor(item.representedObject, representedObject)) {310 if (item.representedObject === representedObject || (isAncestor && isAncestor(item.representedObject, representedObject))) { 325 311 found = true; 326 312 break;
Note: See TracChangeset
for help on using the changeset viewer.