[webkit-reviews] review granted: [Bug 99254] Make ScrollingTree an actual tree of nodes, and have it reflect the ScrollingStateTree : [Attachment 168564] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Oct 16 10:33:05 PDT 2012
Simon Fraser (smfr) <simon.fraser at apple.com> has granted Beth Dakin
<bdakin at apple.com>'s request for review:
Bug 99254: Make ScrollingTree an actual tree of nodes, and have it reflect the
ScrollingStateTree
https://bugs.webkit.org/show_bug.cgi?id=99254
Attachment 168564: Patch
https://bugs.webkit.org/attachment.cgi?id=168564&action=review
------- Additional Comments from Simon Fraser (smfr) <simon.fraser at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=168564&action=review
I'm starting to get nervous that none of this is covered by LayoutTests, and
we've already had a couple of crashes in this code. I strongly suggest figuring
out how to test this.
> Source/WebCore/page/scrolling/ScrollingTree.cpp:147
> +void ScrollingTree::updateNodesFromStateNode(ScrollingStateNode* stateNode)
I'd call this updateTreeFromStateNode to make it clearer that it consults
stateNode and its children.
> Source/WebCore/page/scrolling/ScrollingTree.cpp:151
> + HashMap<ScrollingNodeID, ScrollingTreeNode*>::const_iterator it =
m_nodeMap.find(stateNode->scrollingNodeID());
You should make a typedef for HashMap<ScrollingNodeID, ScrollingTreeNode*>
> Source/WebCore/page/scrolling/ScrollingTree.cpp:175
> + HashMap<ScrollingNodeID, ScrollingTreeNode*>::const_iterator it
= m_nodeMap.find(stateNode->parent()->scrollingNodeID());
> + if (it != m_nodeMap.end()) {
> + ScrollingTreeNode* parent = it->value;
> + newNode->setParent(parent);
> + parent->appendChild(newNode.release());
> + }
If we don't find the parent, what then? Is that an error? Should it assert?
More information about the webkit-reviews
mailing list