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

Unified Diff: Source/core/rendering/svg/RenderSVGResourcePattern.cpp

Issue 171663005: Consistently use ElementTraversal API when looking for an Element (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceMasker.cpp ('k') | Source/core/svg/SVGAnimateMotionElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGResourcePattern.cpp
diff --git a/Source/core/rendering/svg/RenderSVGResourcePattern.cpp b/Source/core/rendering/svg/RenderSVGResourcePattern.cpp
index 353e4541f7a961400fa9a3a5364e614a5bff54df..fa9d6969fc8c7747071092a88cad6ca52b0cab19 100644
--- a/Source/core/rendering/svg/RenderSVGResourcePattern.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourcePattern.cpp
@@ -266,12 +266,12 @@ PassOwnPtr<ImageBuffer> RenderSVGResourcePattern::createTileImage(const PatternA
contentTransformation = tileImageTransform;
// Draw the content into the ImageBuffer.
- for (Node* node = attributes.patternContentElement()->firstChild(); node; node = node->nextSibling()) {
- if (!node->isSVGElement() || !node->renderer())
+ for (Element* element = ElementTraversal::firstWithin(*attributes.patternContentElement()); element; element = ElementTraversal::nextSibling(*element)) {
+ if (!element->isSVGElement() || !element->renderer())
continue;
- if (node->renderer()->needsLayout())
+ if (element->renderer()->needsLayout())
return nullptr;
- SVGRenderingContext::renderSubtree(tileImage->context(), node->renderer(), contentTransformation);
+ SVGRenderingContext::renderSubtree(tileImage->context(), element->renderer(), contentTransformation);
}
return tileImage.release();
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceMasker.cpp ('k') | Source/core/svg/SVGAnimateMotionElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698