[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373
eric at webkit.org
eric at webkit.org
Wed Apr 7 23:47:37 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit 724dd4867536eaa9fb22fb8f5bac0c7d387ffec8
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Nov 18 22:41:31 2009 +0000
2009-11-18 Mikhail Naganov <mnaganov at chromium.org>
Reviewed by Timothy Hatcher.
Fix profile tree nodes loss after focus / restore actions.
Focusing on a node is currently implemented via nodes reattaching
with some caching involved. It seems that not all code was updated
to handle this scenario correctly.
https://bugs.webkit.org/show_bug.cgi?id=31553
* inspector/front-end/BottomUpProfileDataGridTree.js:
(WebInspector.BottomUpProfileDataGridNode):
(WebInspector.BottomUpProfileDataGridNode.prototype._restore):
(WebInspector.BottomUpProfileDataGridNode.prototype._sharedPopulate):
(WebInspector.BottomUpProfileDataGridNode.prototype._willHaveChildren):
* inspector/front-end/DataGrid.js:
(WebInspector.DataGrid.prototype.insertChild):
(WebInspector.DataGridNode.prototype._detach):
(WebInspector.DataGridNode.prototype.savePosition):
(WebInspector.DataGridNode.prototype.restorePosition):
* inspector/front-end/TopDownProfileDataGridTree.js:
(WebInspector.TopDownProfileDataGridTree.prototype.focus):
(WebInspector.TopDownProfileDataGridTree.prototype.restore):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51139 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index fe492bc..0951207 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,29 @@
+2009-11-18 Mikhail Naganov <mnaganov at chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Fix profile tree nodes loss after focus / restore actions.
+
+ Focusing on a node is currently implemented via nodes reattaching
+ with some caching involved. It seems that not all code was updated
+ to handle this scenario correctly.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31553
+
+ * inspector/front-end/BottomUpProfileDataGridTree.js:
+ (WebInspector.BottomUpProfileDataGridNode):
+ (WebInspector.BottomUpProfileDataGridNode.prototype._restore):
+ (WebInspector.BottomUpProfileDataGridNode.prototype._sharedPopulate):
+ (WebInspector.BottomUpProfileDataGridNode.prototype._willHaveChildren):
+ * inspector/front-end/DataGrid.js:
+ (WebInspector.DataGrid.prototype.insertChild):
+ (WebInspector.DataGridNode.prototype._detach):
+ (WebInspector.DataGridNode.prototype.savePosition):
+ (WebInspector.DataGridNode.prototype.restorePosition):
+ * inspector/front-end/TopDownProfileDataGridTree.js:
+ (WebInspector.TopDownProfileDataGridTree.prototype.focus):
+ (WebInspector.TopDownProfileDataGridTree.prototype.restore):
+
2009-11-18 Carol Szabo <carol.szabo at nokia.com>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebCore/inspector/front-end/BottomUpProfileDataGridTree.js b/WebCore/inspector/front-end/BottomUpProfileDataGridTree.js
index 41a8a3a..5aaae0c 100644
--- a/WebCore/inspector/front-end/BottomUpProfileDataGridTree.js
+++ b/WebCore/inspector/front-end/BottomUpProfileDataGridTree.js
@@ -31,11 +31,7 @@
WebInspector.BottomUpProfileDataGridNode = function(/*ProfileView*/ profileView, /*ProfileNode*/ profileNode, /*BottomUpProfileDataGridTree*/ owningTree)
{
- // In bottom up mode, our parents are our children since we display an inverted tree.
- // However, we don't want to show the very top parent since it is redundant.
- var hasChildren = !!(profileNode.parent && profileNode.parent.parent);
-
- WebInspector.ProfileDataGridNode.call(this, profileView, profileNode, owningTree, hasChildren);
+ WebInspector.ProfileDataGridNode.call(this, profileView, profileNode, owningTree, this._willHaveChildren(profileNode));
this._remainingNodeInfos = [];
}
@@ -78,6 +74,14 @@ WebInspector.BottomUpProfileDataGridNode.prototype = {
this._merge(child, true);
},
+ _restore: function()
+ {
+ WebInspector.ProfileDataGridNode.prototype._restore();
+
+ if (!this.children.length)
+ this.hasChildren = this._willHaveChildren();
+ },
+
_merge: function(/*ProfileDataGridNode*/ child, /*Boolean*/ shouldAbsorb)
{
this.selfTime -= child.selfTime;
@@ -128,6 +132,14 @@ WebInspector.BottomUpProfileDataGridNode.prototype = {
}
delete this._remainingNodeInfos;
+ },
+
+ _willHaveChildren: function(profileNode)
+ {
+ profileNode = profileNode || this.profileNode;
+ // In bottom up mode, our parents are our children since we display an inverted tree.
+ // However, we don't want to show the very top parent since it is redundant.
+ return !!(profileNode.parent && profileNode.parent.parent);
}
}
diff --git a/WebCore/inspector/front-end/DataGrid.js b/WebCore/inspector/front-end/DataGrid.js
index 73ee482..7b58c8e 100644
--- a/WebCore/inspector/front-end/DataGrid.js
+++ b/WebCore/inspector/front-end/DataGrid.js
@@ -385,6 +385,7 @@ WebInspector.DataGrid.prototype = {
delete child._depth;
delete child._revealed;
delete child._attached;
+ child._shouldRefreshChildren = true;
var current = child.children[0];
while (current) {
@@ -392,6 +393,7 @@ WebInspector.DataGrid.prototype = {
delete current._depth;
delete current._revealed;
delete current._attached;
+ current._shouldRefreshChildren = true;
current = current.traverseNextNode(false, child, true);
}
@@ -1150,6 +1152,30 @@ WebInspector.DataGridNode.prototype = {
for (var i = 0; i < this.children.length; ++i)
this.children[i]._detach();
+ },
+
+ savePosition: function()
+ {
+ if (this._savedPosition)
+ return;
+
+ if (!this.parent)
+ throw("savePosition: Node must have a parent.");
+ this._savedPosition = {
+ parent: this.parent,
+ index: this.parent.children.indexOf(this)
+ };
+ },
+
+ restorePosition: function()
+ {
+ if (!this._savedPosition)
+ return;
+
+ if (this.parent !== this._savedPosition.parent)
+ this._savedPosition.parent.insertChild(this, this._savedPosition.index);
+
+ delete this._savedPosition;
}
}
diff --git a/WebCore/inspector/front-end/TopDownProfileDataGridTree.js b/WebCore/inspector/front-end/TopDownProfileDataGridTree.js
index 1b07883..bfcc25e 100644
--- a/WebCore/inspector/front-end/TopDownProfileDataGridTree.js
+++ b/WebCore/inspector/front-end/TopDownProfileDataGridTree.js
@@ -82,6 +82,7 @@ WebInspector.TopDownProfileDataGridTree.prototype = {
return;
this._save();
+ profileDataGrideNode.savePosition();
this.children = [profileDataGrideNode];
this.totalTime = profileDataGrideNode.totalTime;
@@ -102,6 +103,16 @@ WebInspector.TopDownProfileDataGridTree.prototype = {
this.sort(this.lastComparator, true);
},
+ restore: function()
+ {
+ if (!this._savedChildren)
+ return;
+
+ this.children[0].restorePosition();
+
+ WebInspector.ProfileDataGridTree.prototype.restore.call(this);
+ },
+
_merge: WebInspector.TopDownProfileDataGridNode.prototype._merge,
_sharedPopulate: WebInspector.TopDownProfileDataGridNode.prototype._sharedPopulate
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list