| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2009 Google, Inc. All rights reserved. | 4 * Copyright (C) 2009 Google, Inc. All rights reserved. |
| 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 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 10 matching lines...) Expand all Loading... |
| 21 */ | 21 */ |
| 22 | 22 |
| 23 #include "config.h" | 23 #include "config.h" |
| 24 | 24 |
| 25 #include "core/svg/SVGLocatable.h" | 25 #include "core/svg/SVGLocatable.h" |
| 26 | 26 |
| 27 #include "SVGNames.h" | 27 #include "SVGNames.h" |
| 28 #include "core/dom/ExceptionCode.h" | 28 #include "core/dom/ExceptionCode.h" |
| 29 #include "core/rendering/RenderObject.h" | 29 #include "core/rendering/RenderObject.h" |
| 30 #include "core/svg/SVGGraphicsElement.h" | 30 #include "core/svg/SVGGraphicsElement.h" |
| 31 #include "core/svg/SVGImageElement.h" |
| 31 | 32 |
| 32 namespace WebCore { | 33 namespace WebCore { |
| 33 | 34 |
| 34 static bool isViewportElement(Node* node) | 35 static bool isViewportElement(Node* node) |
| 35 { | 36 { |
| 36 return (node->hasTagName(SVGNames::svgTag) | 37 return (node->hasTagName(SVGNames::svgTag) |
| 37 || node->hasTagName(SVGNames::symbolTag) | 38 || node->hasTagName(SVGNames::symbolTag) |
| 38 || node->hasTagName(SVGNames::foreignObjectTag) | 39 || node->hasTagName(SVGNames::foreignObjectTag) |
| 39 || node->hasTagName(SVGNames::imageTag)); | 40 || isSVGImageElement(node)); |
| 40 } | 41 } |
| 41 | 42 |
| 42 SVGElement* SVGLocatable::nearestViewportElement(const SVGElement* element) | 43 SVGElement* SVGLocatable::nearestViewportElement(const SVGElement* element) |
| 43 { | 44 { |
| 44 ASSERT(element); | 45 ASSERT(element); |
| 45 for (Element* current = element->parentOrShadowHostElement(); current; curre
nt = current->parentOrShadowHostElement()) { | 46 for (Element* current = element->parentOrShadowHostElement(); current; curre
nt = current->parentOrShadowHostElement()) { |
| 46 if (isViewportElement(current)) | 47 if (isViewportElement(current)) |
| 47 return toSVGElement(current); | 48 return toSVGElement(current); |
| 48 } | 49 } |
| 49 | 50 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 ec = InvalidStateError; | 109 ec = InvalidStateError; |
| 109 return ctm; | 110 return ctm; |
| 110 } | 111 } |
| 111 ctm = targetCTM.inverse() * ctm; | 112 ctm = targetCTM.inverse() * ctm; |
| 112 } | 113 } |
| 113 | 114 |
| 114 return ctm; | 115 return ctm; |
| 115 } | 116 } |
| 116 | 117 |
| 117 } | 118 } |
| OLD | NEW |