Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: Source/core/dom/shadow/ComposedTreeWalker.cpp

Issue 171773008: Rename childNodeCount() / childNode() methods for clarity (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Further renaming for consistency Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/RangeBoundaryPoint.h ('k') | Source/core/editing/ApplyStyleCommand.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 66
67 Node* ComposedTreeWalker::traverseNode(const Node* node, TraversalDirection dire ction) 67 Node* ComposedTreeWalker::traverseNode(const Node* node, TraversalDirection dire ction)
68 { 68 {
69 ASSERT(node); 69 ASSERT(node);
70 if (!isActiveInsertionPoint(*node)) 70 if (!isActiveInsertionPoint(*node))
71 return const_cast<Node*>(node); 71 return const_cast<Node*>(node);
72 const InsertionPoint* insertionPoint = toInsertionPoint(node); 72 const InsertionPoint* insertionPoint = toInsertionPoint(node);
73 if (Node* found = traverseDistributedNodes(direction == TraversalDirectionFo rward ? insertionPoint->first() : insertionPoint->last(), insertionPoint, direct ion)) 73 if (Node* found = traverseDistributedNodes(direction == TraversalDirectionFo rward ? insertionPoint->first() : insertionPoint->last(), insertionPoint, direct ion))
74 return found; 74 return found;
75 ASSERT(node->hasTagName(HTMLNames::shadowTag) || (node->hasTagName(HTMLNames ::contentTag) && !node->hasChildNodes())); 75 ASSERT(node->hasTagName(HTMLNames::shadowTag) || (node->hasTagName(HTMLNames ::contentTag) && !node->hasChildren()));
76 return 0; 76 return 0;
77 } 77 }
78 78
79 Node* ComposedTreeWalker::traverseDistributedNodes(const Node* node, const Inser tionPoint* insertionPoint, TraversalDirection direction) 79 Node* ComposedTreeWalker::traverseDistributedNodes(const Node* node, const Inser tionPoint* insertionPoint, TraversalDirection direction)
80 { 80 {
81 for (const Node* next = node; next; next = (direction == TraversalDirectionF orward ? insertionPoint->nextTo(next) : insertionPoint->previousTo(next))) { 81 for (const Node* next = node; next; next = (direction == TraversalDirectionF orward ? insertionPoint->nextTo(next) : insertionPoint->previousTo(next))) {
82 if (Node* found = traverseNode(next, direction)) 82 if (Node* found = traverseNode(next, direction))
83 return found; 83 return found;
84 } 84 }
85 return 0; 85 return 0;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 ShadowRoot* shadowRoot = toShadowRoot(parent); 156 ShadowRoot* shadowRoot = toShadowRoot(parent);
157 ASSERT(!shadowRoot->shadowInsertionPointOfYoungerShadowRoot()); 157 ASSERT(!shadowRoot->shadowInsertionPointOfYoungerShadowRoot());
158 if (!shadowRoot->isYoungest()) 158 if (!shadowRoot->isYoungest())
159 return 0; 159 return 0;
160 if (details) 160 if (details)
161 details->didTraverseShadowRoot(shadowRoot); 161 details->didTraverseShadowRoot(shadowRoot);
162 return shadowRoot->host(); 162 return shadowRoot->host();
163 } 163 }
164 164
165 } // namespace 165 } // namespace
OLDNEW
« no previous file with comments | « Source/core/dom/RangeBoundaryPoint.h ('k') | Source/core/editing/ApplyStyleCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698