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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGPatternElement.cpp

Issue 1885453002: Rename Node::treeScope() to Node::treeScopeOrDocument() Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde .org> 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde .org>
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 void SVGPatternElement::collectPatternAttributes(PatternAttributes& attributes) const 151 void SVGPatternElement::collectPatternAttributes(PatternAttributes& attributes) const
152 { 152 {
153 HeapHashSet<Member<const SVGPatternElement>> processedPatterns; 153 HeapHashSet<Member<const SVGPatternElement>> processedPatterns;
154 const SVGPatternElement* current = this; 154 const SVGPatternElement* current = this;
155 155
156 while (true) { 156 while (true) {
157 setPatternAttributes(current, attributes); 157 setPatternAttributes(current, attributes);
158 processedPatterns.add(current); 158 processedPatterns.add(current);
159 159
160 // Respect xlink:href, take attributes from referenced element 160 // Respect xlink:href, take attributes from referenced element
161 Node* refNode = SVGURIReference::targetElementFromIRIString(current->hre fString(), treeScope()); 161 Node* refNode = SVGURIReference::targetElementFromIRIString(current->hre fString(), treeScopeOrDocument());
162 162
163 // Only consider attached SVG pattern elements. 163 // Only consider attached SVG pattern elements.
164 if (!isSVGPatternElement(refNode) || !refNode->layoutObject()) 164 if (!isSVGPatternElement(refNode) || !refNode->layoutObject())
165 break; 165 break;
166 166
167 current = toSVGPatternElement(refNode); 167 current = toSVGPatternElement(refNode);
168 168
169 // Cycle detection 169 // Cycle detection
170 if (processedPatterns.contains(current)) 170 if (processedPatterns.contains(current))
171 break; 171 break;
172 } 172 }
173 } 173 }
174 174
175 AffineTransform SVGPatternElement::localCoordinateSpaceTransform(SVGElement::CTM Scope) const 175 AffineTransform SVGPatternElement::localCoordinateSpaceTransform(SVGElement::CTM Scope) const
176 { 176 {
177 AffineTransform matrix; 177 AffineTransform matrix;
178 m_patternTransform->currentValue()->concatenate(matrix); 178 m_patternTransform->currentValue()->concatenate(matrix);
179 return matrix; 179 return matrix;
180 } 180 }
181 181
182 bool SVGPatternElement::selfHasRelativeLengths() const 182 bool SVGPatternElement::selfHasRelativeLengths() const
183 { 183 {
184 return m_x->currentValue()->isRelative() 184 return m_x->currentValue()->isRelative()
185 || m_y->currentValue()->isRelative() 185 || m_y->currentValue()->isRelative()
186 || m_width->currentValue()->isRelative() 186 || m_width->currentValue()->isRelative()
187 || m_height->currentValue()->isRelative(); 187 || m_height->currentValue()->isRelative();
188 } 188 }
189 189
190 } // namespace blink 190 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698