OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2008 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) 2014 Google, Inc. | 4 * Copyright (C) 2014 Google, Inc. |
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 * |
11 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 * Library General Public License for more details. | 14 * Library General Public License for more details. |
15 * | 15 * |
16 * You should have received a copy of the GNU Library General Public License | 16 * You should have received a copy of the GNU Library General Public License |
17 * along with this library; see the file COPYING.LIB. If not, write to | 17 * along with this library; see the file COPYING.LIB. If not, write to |
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
19 * Boston, MA 02110-1301, USA. | 19 * Boston, MA 02110-1301, USA. |
20 */ | 20 */ |
21 | 21 |
22 #include "config.h" | 22 #include "config.h" |
23 | 23 |
24 #include "core/svg/SVGGraphicsElement.h" | 24 #include "core/svg/SVGGraphicsElement.h" |
25 | 25 |
26 #include "core/SVGNames.h" | 26 #include "core/SVGNames.h" |
27 #include "core/css/resolver/StyleResolver.h" | 27 #include "core/css/resolver/StyleResolver.h" |
28 #include "core/rendering/svg/RenderSVGPath.h" | 28 #include "core/rendering/svg/RenderSVGPath.h" |
29 #include "core/rendering/svg/RenderSVGResource.h" | |
30 #include "core/rendering/svg/SVGPathData.h" | 29 #include "core/rendering/svg/SVGPathData.h" |
31 #include "core/svg/SVGElementRareData.h" | 30 #include "core/svg/SVGElementRareData.h" |
32 #include "platform/transforms/AffineTransform.h" | 31 #include "platform/transforms/AffineTransform.h" |
33 | 32 |
34 namespace blink { | 33 namespace blink { |
35 | 34 |
36 SVGGraphicsElement::SVGGraphicsElement(const QualifiedName& tagName, Document& d
ocument, ConstructionType constructionType) | 35 SVGGraphicsElement::SVGGraphicsElement(const QualifiedName& tagName, Document& d
ocument, ConstructionType constructionType) |
37 : SVGElement(tagName, document, constructionType) | 36 : SVGElement(tagName, document, constructionType) |
38 , SVGTests(this) | 37 , SVGTests(this) |
39 , m_transform(SVGAnimatedTransformList::create(this, SVGNames::transformAttr
, SVGTransformList::create())) | 38 , m_transform(SVGAnimatedTransformList::create(this, SVGNames::transformAttr
, SVGTransformList::create())) |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 lazyReattachIfAttached(); | 195 lazyReattachIfAttached(); |
197 return; | 196 return; |
198 } | 197 } |
199 | 198 |
200 RenderObject* object = renderer(); | 199 RenderObject* object = renderer(); |
201 if (!object) | 200 if (!object) |
202 return; | 201 return; |
203 | 202 |
204 if (attrName == SVGNames::transformAttr) { | 203 if (attrName == SVGNames::transformAttr) { |
205 object->setNeedsTransformUpdate(); | 204 object->setNeedsTransformUpdate(); |
206 RenderSVGResource::markForLayoutAndParentResourceInvalidation(object); | 205 markForLayoutAndParentResourceInvalidation(object); |
207 return; | 206 return; |
208 } | 207 } |
209 | 208 |
210 ASSERT_NOT_REACHED(); | 209 ASSERT_NOT_REACHED(); |
211 } | 210 } |
212 | 211 |
213 SVGElement* SVGGraphicsElement::nearestViewportElement() const | 212 SVGElement* SVGGraphicsElement::nearestViewportElement() const |
214 { | 213 { |
215 for (Element* current = parentOrShadowHostElement(); current; current = curr
ent->parentOrShadowHostElement()) { | 214 for (Element* current = parentOrShadowHostElement(); current; current = curr
ent->parentOrShadowHostElement()) { |
216 if (isViewportElement(*current)) | 215 if (isViewportElement(*current)) |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 } | 252 } |
254 | 253 |
255 void SVGGraphicsElement::toClipPath(Path& path) | 254 void SVGGraphicsElement::toClipPath(Path& path) |
256 { | 255 { |
257 updatePathFromGraphicsElement(this, path); | 256 updatePathFromGraphicsElement(this, path); |
258 // FIXME: How do we know the element has done a layout? | 257 // FIXME: How do we know the element has done a layout? |
259 path.transform(animatedLocalTransform()); | 258 path.transform(animatedLocalTransform()); |
260 } | 259 } |
261 | 260 |
262 } | 261 } |
OLD | NEW |