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

Side by Side Diff: Source/core/svg/SVGLocatable.cpp

Issue 18278003: Introduce isSVGFontElement() and isSVGImageElement(), and use them (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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
« no previous file with comments | « Source/core/svg/SVGImageElement.cpp ('k') | Source/core/svg/SVGVKernElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGImageElement.cpp ('k') | Source/core/svg/SVGVKernElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698