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

Side by Side Diff: Source/core/rendering/svg/RenderSVGResourceClipper.cpp

Issue 412033004: Use Traversal<>::firstChild() instead of firstWithin() when iterating over children (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org>
4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
5 * Copyright (C) 2011 Dirk Schulze <krit@webkit.org> 5 * Copyright (C) 2011 Dirk Schulze <krit@webkit.org>
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 84 }
85 85
86 bool RenderSVGResourceClipper::tryPathOnlyClipping(GraphicsContext* context, 86 bool RenderSVGResourceClipper::tryPathOnlyClipping(GraphicsContext* context,
87 const AffineTransform& animatedLocalTransform, const FloatRect& objectBoundi ngBox) { 87 const AffineTransform& animatedLocalTransform, const FloatRect& objectBoundi ngBox) {
88 // If the current clip-path gets clipped itself, we have to fallback to mask ing. 88 // If the current clip-path gets clipped itself, we have to fallback to mask ing.
89 if (!style()->svgStyle().clipperResource().isEmpty()) 89 if (!style()->svgStyle().clipperResource().isEmpty())
90 return false; 90 return false;
91 WindRule clipRule = RULE_NONZERO; 91 WindRule clipRule = RULE_NONZERO;
92 Path clipPath = Path(); 92 Path clipPath = Path();
93 93
94 for (Element* childElement = ElementTraversal::firstWithin(*element()); chil dElement; childElement = ElementTraversal::nextSibling(*childElement)) { 94 for (Element* childElement = ElementTraversal::firstChild(*element()); child Element; childElement = ElementTraversal::nextSibling(*childElement)) {
95 RenderObject* renderer = childElement->renderer(); 95 RenderObject* renderer = childElement->renderer();
96 if (!renderer) 96 if (!renderer)
97 continue; 97 continue;
98 // Only shapes or paths are supported for direct clipping. We need to fa llback to masking for texts. 98 // Only shapes or paths are supported for direct clipping. We need to fa llback to masking for texts.
99 if (renderer->isSVGText()) 99 if (renderer->isSVGText())
100 return false; 100 return false;
101 if (!childElement->isSVGElement() || !toSVGElement(childElement)->isSVGG raphicsElement()) 101 if (!childElement->isSVGElement() || !toSVGElement(childElement)->isSVGG raphicsElement())
102 continue; 102 continue;
103 SVGGraphicsElement* styled = toSVGGraphicsElement(childElement); 103 SVGGraphicsElement* styled = toSVGGraphicsElement(childElement);
104 RenderStyle* style = renderer->style(); 104 RenderStyle* style = renderer->style();
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 AffineTransform transform; 373 AffineTransform transform;
374 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); 374 transform.translate(objectBoundingBox.x(), objectBoundingBox.y());
375 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h eight()); 375 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h eight());
376 return transform.mapRect(m_clipBoundaries); 376 return transform.mapRect(m_clipBoundaries);
377 } 377 }
378 378
379 return m_clipBoundaries; 379 return m_clipBoundaries;
380 } 380 }
381 381
382 } 382 }
OLDNEW
« no previous file with comments | « Source/core/html/track/vtt/VTTRegion.cpp ('k') | Source/core/rendering/svg/RenderSVGResourceMasker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698