Changeset 89021 in webkit


Ignore:
Timestamp:
Jun 16, 2011 2:12:14 AM (13 years ago)
Author:
hayato@chromium.org
Message:

2011-06-16 Hayato Ito <hayato@chromium.org>

Reviewed by Hajime Morita.

Show child elements of a shadow host in Node::showTreeForThisAcrossFrame.
https://bugs.webkit.org/show_bug.cgi?id=62782

To make an implementation simple, get rid of traverseNextNodeAcrossFrame
and traverse each Node recursively.

No new tests since the function is only available in debug builds.

  • dom/Node.cpp: (WebCore::showSubTreeAcrossFrame): (WebCore::Node::showTreeForThisAcrossFrame):
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r89020 r89021  
     12011-06-16  Hayato Ito  <hayato@chromium.org>
     2
     3        Reviewed by Hajime Morita.
     4
     5        Show child elements of a shadow host in Node::showTreeForThisAcrossFrame.
     6        https://bugs.webkit.org/show_bug.cgi?id=62782
     7
     8        To make an implementation simple, get rid of traverseNextNodeAcrossFrame
     9        and traverse each Node recursively.
     10
     11        No new tests since the function is only available in debug builds.
     12
     13        * dom/Node.cpp:
     14        (WebCore::showSubTreeAcrossFrame):
     15        (WebCore::Node::showTreeForThisAcrossFrame):
     16
    1172011-06-16  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
    218
  • trunk/Source/WebCore/dom/Node.cpp

    r88476 r89021  
    23652365}
    23662366
    2367 static Node* traverseNextNodeAcrossFrame(Node* node)
    2368 {
     2367static void showSubTreeAcrossFrame(Node* node, const Node* markedNode, const String& indent)
     2368{
     2369    if (node == markedNode)
     2370        fputs("*", stderr);
     2371    fputs(indent.utf8().data(), stderr);
     2372    node->showNode();
    23692373    if (node->isFrameOwnerElement())
    2370         return static_cast<HTMLFrameOwnerElement*>(node)->contentDocument();
     2374        showSubTreeAcrossFrame(static_cast<HTMLFrameOwnerElement*>(node)->contentDocument(), markedNode, indent + "\t");
    23712375    if (ShadowRoot* shadow = shadowRoot(node))
    2372         return shadow;
    2373     if (node->firstChild())
    2374         return node->firstChild();
    2375     if (node->nextSibling())
    2376         return node->nextSibling();
    2377     while (node && !node->nextSibling())
    2378         node = parentOrHostOrFrameOwner(node);
    2379     if (node)
    2380         return node->nextSibling();
    2381     return 0;
     2376        showSubTreeAcrossFrame(shadow, markedNode, indent + "\t");
     2377    for (Node* child = node->firstChild(); child; child = child->nextSibling())
     2378        showSubTreeAcrossFrame(child, markedNode, indent + "\t");
    23822379}
    23832380
     
    23872384    while (parentOrHostOrFrameOwner(rootNode))
    23882385        rootNode = parentOrHostOrFrameOwner(rootNode);
    2389     for (Node* node = rootNode; node; node = traverseNextNodeAcrossFrame(node)) {
    2390         if (node == this)
    2391             fputs("*", stderr);
    2392         String indent;
    2393         for (Node* tmpNode = node; tmpNode && tmpNode != rootNode; tmpNode = parentOrHostOrFrameOwner(tmpNode))
    2394             indent += "\t";
    2395         fputs(indent.utf8().data(), stderr);
    2396         node->showNode();
    2397     }
     2386    showSubTreeAcrossFrame(rootNode, this, "");
    23982387}
    23992388
Note: See TracChangeset for help on using the changeset viewer.