OLD | NEW |
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, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2008 Apple Inc. All rights reserved. | 4 * Copyright (C) 2008 Apple Inc. All rights reserved. |
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> | 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> |
6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> | 6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 177 |
178 ASSERT(!SVGElementRareData::rareDataMap().contains(this)); | 178 ASSERT(!SVGElementRareData::rareDataMap().contains(this)); |
179 SVGElementRareData* data = new SVGElementRareData; | 179 SVGElementRareData* data = new SVGElementRareData; |
180 SVGElementRareData::rareDataMap().set(this, data); | 180 SVGElementRareData::rareDataMap().set(this, data); |
181 setHasSVGRareData(); | 181 setHasSVGRareData(); |
182 return data; | 182 return data; |
183 } | 183 } |
184 | 184 |
185 bool SVGElement::isOutermostSVGSVGElement() const | 185 bool SVGElement::isOutermostSVGSVGElement() const |
186 { | 186 { |
187 if (!hasTagName(SVGNames::svgTag)) | 187 if (!isSVGSVGElement(*this)) |
188 return false; | 188 return false; |
189 | 189 |
190 // Element may not be in the document, pretend we're outermost for viewport(
), getCTM(), etc. | 190 // Element may not be in the document, pretend we're outermost for viewport(
), getCTM(), etc. |
191 if (!parentNode()) | 191 if (!parentNode()) |
192 return true; | 192 return true; |
193 | 193 |
194 // We act like an outermost SVG element, if we're a direct child of a <forei
gnObject> element. | 194 // We act like an outermost SVG element, if we're a direct child of a <forei
gnObject> element. |
195 if (parentNode()->hasTagName(SVGNames::foreignObjectTag)) | 195 if (isSVGForeignObjectElement(*parentNode())) |
196 return true; | 196 return true; |
197 | 197 |
198 // If we're living in a shadow tree, we're a <svg> element that got created
as replacement | 198 // If we're living in a shadow tree, we're a <svg> element that got created
as replacement |
199 // for a <symbol> element or a cloned <svg> element in the referenced tree.
In that case | 199 // for a <symbol> element or a cloned <svg> element in the referenced tree.
In that case |
200 // we're always an inner <svg> element. | 200 // we're always an inner <svg> element. |
201 if (isInShadowTree() && parentOrShadowHostElement() && parentOrShadowHostEle
ment()->isSVGElement()) | 201 if (isInShadowTree() && parentOrShadowHostElement() && parentOrShadowHostEle
ment()->isSVGElement()) |
202 return false; | 202 return false; |
203 | 203 |
204 // This is true whenever this is the outermost SVG, even if there are HTML e
lements outside it | 204 // This is true whenever this is the outermost SVG, even if there are HTML e
lements outside it |
205 return !parentNode()->isSVGElement(); | 205 return !parentNode()->isSVGElement(); |
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 animatableAttributes.add(SVGNames::zAttr); | 1133 animatableAttributes.add(SVGNames::zAttr); |
1134 } | 1134 } |
1135 | 1135 |
1136 if (name == classAttr) | 1136 if (name == classAttr) |
1137 return true; | 1137 return true; |
1138 | 1138 |
1139 return animatableAttributes.contains(name); | 1139 return animatableAttributes.contains(name); |
1140 } | 1140 } |
1141 #endif | 1141 #endif |
1142 } | 1142 } |
OLD | NEW |