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

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

Issue 132233010: [SVG] SVGAnimatedRect migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebsaed Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGGraphicsElement.h ('k') | Source/core/svg/SVGGraphicsElement.idl » ('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, 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 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 SVGElement* SVGGraphicsElement::farthestViewportElement() const 216 SVGElement* SVGGraphicsElement::farthestViewportElement() const
217 { 217 {
218 SVGElement* farthest = 0; 218 SVGElement* farthest = 0;
219 for (Element* current = parentOrShadowHostElement(); current; current = curr ent->parentOrShadowHostElement()) { 219 for (Element* current = parentOrShadowHostElement(); current; current = curr ent->parentOrShadowHostElement()) {
220 if (isViewportElement(current)) 220 if (isViewportElement(current))
221 farthest = toSVGElement(current); 221 farthest = toSVGElement(current);
222 } 222 }
223 return farthest; 223 return farthest;
224 } 224 }
225 225
226 SVGRect SVGGraphicsElement::getBBox() 226 FloatRect SVGGraphicsElement::getBBox()
227 { 227 {
228 document().updateLayoutIgnorePendingStylesheets(); 228 document().updateLayoutIgnorePendingStylesheets();
229 229
230 // FIXME: Eventually we should support getBBox for detached elements. 230 // FIXME: Eventually we should support getBBox for detached elements.
231 if (!renderer()) 231 if (!renderer())
232 return SVGRect(); 232 return FloatRect();
233 233
234 return renderer()->objectBoundingBox(); 234 return renderer()->objectBoundingBox();
235 } 235 }
236 236
237 SVGRect SVGGraphicsElement::getStrokeBBox() 237 PassRefPtr<SVGRectTearOff> SVGGraphicsElement::getBBoxFromJavascript()
238 {
239 return SVGRectTearOff::create(SVGRect::create(getBBox()), 0, PropertyIsNotAn imVal);
240 }
241
242 FloatRect SVGGraphicsElement::getStrokeBBox()
238 { 243 {
239 document().updateLayoutIgnorePendingStylesheets(); 244 document().updateLayoutIgnorePendingStylesheets();
240 245
241 // FIXME: Eventually we should support getStrokeBBox for detached elements. 246 // FIXME: Eventually we should support getStrokeBBox for detached elements.
242 if (!renderer()) 247 if (!renderer())
243 return SVGRect(); 248 return FloatRect();
244 249
245 return renderer()->strokeBoundingBox(); 250 return renderer()->strokeBoundingBox();
246 } 251 }
247 252
253 PassRefPtr<SVGRectTearOff> SVGGraphicsElement::getStrokeBBoxFromJavascript()
254 {
255 return SVGRectTearOff::create(SVGRect::create(getStrokeBBox()), 0, PropertyI sNotAnimVal);
256 }
257
248 RenderObject* SVGGraphicsElement::createRenderer(RenderStyle*) 258 RenderObject* SVGGraphicsElement::createRenderer(RenderStyle*)
249 { 259 {
250 // By default, any subclass is expected to do path-based drawing 260 // By default, any subclass is expected to do path-based drawing
251 return new RenderSVGPath(this); 261 return new RenderSVGPath(this);
252 } 262 }
253 263
254 void SVGGraphicsElement::toClipPath(Path& path) 264 void SVGGraphicsElement::toClipPath(Path& path)
255 { 265 {
256 updatePathFromGraphicsElement(this, path); 266 updatePathFromGraphicsElement(this, path);
257 // FIXME: How do we know the element has done a layout? 267 // FIXME: How do we know the element has done a layout?
258 path.transform(animatedLocalTransform()); 268 path.transform(animatedLocalTransform());
259 } 269 }
260 270
261 } 271 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGGraphicsElement.h ('k') | Source/core/svg/SVGGraphicsElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698