Changeset 51139 in webkit
- Timestamp:
- Nov 18, 2009 2:41:31 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r51137 r51139 1 2009-11-18 Mikhail Naganov <mnaganov@chromium.org> 2 3 Reviewed by Timothy Hatcher. 4 5 Fix profile tree nodes loss after focus / restore actions. 6 7 Focusing on a node is currently implemented via nodes reattaching 8 with some caching involved. It seems that not all code was updated 9 to handle this scenario correctly. 10 11 https://bugs.webkit.org/show_bug.cgi?id=31553 12 13 * inspector/front-end/BottomUpProfileDataGridTree.js: 14 (WebInspector.BottomUpProfileDataGridNode): 15 (WebInspector.BottomUpProfileDataGridNode.prototype._restore): 16 (WebInspector.BottomUpProfileDataGridNode.prototype._sharedPopulate): 17 (WebInspector.BottomUpProfileDataGridNode.prototype._willHaveChildren): 18 * inspector/front-end/DataGrid.js: 19 (WebInspector.DataGrid.prototype.insertChild): 20 (WebInspector.DataGridNode.prototype._detach): 21 (WebInspector.DataGridNode.prototype.savePosition): 22 (WebInspector.DataGridNode.prototype.restorePosition): 23 * inspector/front-end/TopDownProfileDataGridTree.js: 24 (WebInspector.TopDownProfileDataGridTree.prototype.focus): 25 (WebInspector.TopDownProfileDataGridTree.prototype.restore): 26 1 27 2009-11-18 Carol Szabo <carol.szabo@nokia.com> 2 28 -
trunk/WebCore/inspector/front-end/BottomUpProfileDataGridTree.js
r49891 r51139 32 32 WebInspector.BottomUpProfileDataGridNode = function(/*ProfileView*/ profileView, /*ProfileNode*/ profileNode, /*BottomUpProfileDataGridTree*/ owningTree) 33 33 { 34 // In bottom up mode, our parents are our children since we display an inverted tree. 35 // However, we don't want to show the very top parent since it is redundant. 36 var hasChildren = !!(profileNode.parent && profileNode.parent.parent); 37 38 WebInspector.ProfileDataGridNode.call(this, profileView, profileNode, owningTree, hasChildren); 34 WebInspector.ProfileDataGridNode.call(this, profileView, profileNode, owningTree, this._willHaveChildren(profileNode)); 39 35 40 36 this._remainingNodeInfos = []; … … 77 73 if (child) 78 74 this._merge(child, true); 75 }, 76 77 _restore: function() 78 { 79 WebInspector.ProfileDataGridNode.prototype._restore(); 80 81 if (!this.children.length) 82 this.hasChildren = this._willHaveChildren(); 79 83 }, 80 84 … … 129 133 130 134 delete this._remainingNodeInfos; 135 }, 136 137 _willHaveChildren: function(profileNode) 138 { 139 profileNode = profileNode || this.profileNode; 140 // In bottom up mode, our parents are our children since we display an inverted tree. 141 // However, we don't want to show the very top parent since it is redundant. 142 return !!(profileNode.parent && profileNode.parent.parent); 131 143 } 132 144 } -
trunk/WebCore/inspector/front-end/DataGrid.js
r51119 r51139 386 386 delete child._revealed; 387 387 delete child._attached; 388 child._shouldRefreshChildren = true; 388 389 389 390 var current = child.children[0]; … … 393 394 delete current._revealed; 394 395 delete current._attached; 396 current._shouldRefreshChildren = true; 395 397 current = current.traverseNextNode(false, child, true); 396 398 } … … 1151 1153 for (var i = 0; i < this.children.length; ++i) 1152 1154 this.children[i]._detach(); 1155 }, 1156 1157 savePosition: function() 1158 { 1159 if (this._savedPosition) 1160 return; 1161 1162 if (!this.parent) 1163 throw("savePosition: Node must have a parent."); 1164 this._savedPosition = { 1165 parent: this.parent, 1166 index: this.parent.children.indexOf(this) 1167 }; 1168 }, 1169 1170 restorePosition: function() 1171 { 1172 if (!this._savedPosition) 1173 return; 1174 1175 if (this.parent !== this._savedPosition.parent) 1176 this._savedPosition.parent.insertChild(this, this._savedPosition.index); 1177 1178 delete this._savedPosition; 1153 1179 } 1154 1180 } -
trunk/WebCore/inspector/front-end/TopDownProfileDataGridTree.js
r49891 r51139 83 83 84 84 this._save(); 85 profileDataGrideNode.savePosition(); 85 86 86 87 this.children = [profileDataGrideNode]; … … 103 104 }, 104 105 106 restore: function() 107 { 108 if (!this._savedChildren) 109 return; 110 111 this.children[0].restorePosition(); 112 113 WebInspector.ProfileDataGridTree.prototype.restore.call(this); 114 }, 115 105 116 _merge: WebInspector.TopDownProfileDataGridNode.prototype._merge, 106 117
Note: See TracChangeset
for help on using the changeset viewer.