Changeset 89021 in webkit
- Timestamp:
- Jun 16, 2011 2:12:14 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r89020 r89021 1 2011-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 1 17 2011-06-16 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 18 -
trunk/Source/WebCore/dom/Node.cpp
r88476 r89021 2365 2365 } 2366 2366 2367 static Node* traverseNextNodeAcrossFrame(Node* node) 2368 { 2367 static 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(); 2369 2373 if (node->isFrameOwnerElement()) 2370 return static_cast<HTMLFrameOwnerElement*>(node)->contentDocument();2374 showSubTreeAcrossFrame(static_cast<HTMLFrameOwnerElement*>(node)->contentDocument(), markedNode, indent + "\t"); 2371 2375 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"); 2382 2379 } 2383 2380 … … 2387 2384 while (parentOrHostOrFrameOwner(rootNode)) 2388 2385 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, ""); 2398 2387 } 2399 2388
Note: See TracChangeset
for help on using the changeset viewer.