[webkit-reviews] review denied: [Bug 61727] Add a utility function which dumps a tree for the Node, including a document of a frame. : [Attachment 95392] Addressed the review comments.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon May 30 21:08:50 PDT 2011
Ryosuke Niwa <rniwa at webkit.org> has denied Hayato Ito <hayato at chromium.org>'s
request for review:
Bug 61727: Add a utility function which dumps a tree for the Node, including a
document of a frame.
https://bugs.webkit.org/show_bug.cgi?id=61727
Attachment 95392: Addressed the review comments.
https://bugs.webkit.org/attachment.cgi?id=95392&action=review
------- Additional Comments from Ryosuke Niwa <rniwa at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=95392&action=review
> Source/WebCore/ChangeLog:8
> + https://bugs.webkit.org/show_bug.cgi?id=61727
Missing bug title. Also, the bug URL + bug title need to appear before the
description.
> Source/WebCore/dom/Node.cpp:2411
> + const Node* node = this;
> + while (node->parentOrHostOrFrameOwner())
> + node = node->parentOrHostOrFrameOwner();
> + const Node* rootNode = node;
Can you declare rootNode before the loop and walk up the tree using rootNode
instead of node?
That way, you can declare node in the for loop as in:
for (Node* node = rootNode; node; node = node->traverseNextNodeAcrossFrame())
> Source/WebCore/dom/Node.cpp:2413
> + if (node == markedNode)
You can just compare node with this here instead of declaring markedNode.
> Source/WebCore/dom/Node.cpp:2418
> + fprintf(stderr, "%s", indent.utf8().data());
Come to think of it, there's no reason to use fprintf here. You can just do
fputs(indent.utf8().data(), stderr).
> Source/WebCore/dom/Node.h:722
> + // In addition to parentOrHost, also up to a FrameOwnerElement of the
current frame.
> + ContainerNode* parentOrHostOrFrameOwner() const;
> + // Like traversalNextNode, but traverses also into a document of a frame
element.
Again, these comments don't add any values.
More information about the webkit-reviews
mailing list