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

Side by Side Diff: Source/core/rendering/svg/SVGRenderTreeAsText.cpp

Issue 27096003: Use DEFINE_NODE_TYPE_CASTS instead of using manual toSVGFooElement() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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 | « no previous file | Source/core/svg/SVGCircleElement.h » ('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, 2007, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2007, 2009 Apple Inc. All rights reserved.
3 * (C) 2005 Rob Buis <buis@kde.org> 3 * (C) 2005 Rob Buis <buis@kde.org>
4 * (C) 2006 Alexander Kellett <lypanov@kde.org> 4 * (C) 2006 Alexander Kellett <lypanov@kde.org>
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 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 if (object.isSVGShape()) { 267 if (object.isSVGShape()) {
268 const RenderSVGShape& shape = static_cast<const RenderSVGShape&>(object) ; 268 const RenderSVGShape& shape = static_cast<const RenderSVGShape&>(object) ;
269 ASSERT(shape.element()); 269 ASSERT(shape.element());
270 270
271 Color fallbackColor; 271 Color fallbackColor;
272 if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strok ePaintingResource(const_cast<RenderSVGShape*>(&shape), shape.style(), fallbackCo lor)) { 272 if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strok ePaintingResource(const_cast<RenderSVGShape*>(&shape), shape.style(), fallbackCo lor)) {
273 TextStreamSeparator s(" "); 273 TextStreamSeparator s(" ");
274 ts << " [stroke={" << s; 274 ts << " [stroke={" << s;
275 writeSVGPaintingResource(ts, strokePaintingResource); 275 writeSVGPaintingResource(ts, strokePaintingResource);
276 276
277 SVGLengthContext lengthContext(toSVGElement(shape.element())); 277 SVGLengthContext lengthContext(shape.element());
278 double dashOffset = svgStyle->strokeDashOffset().value(lengthContext ); 278 double dashOffset = svgStyle->strokeDashOffset().value(lengthContext );
279 double strokeWidth = svgStyle->strokeWidth().value(lengthContext); 279 double strokeWidth = svgStyle->strokeWidth().value(lengthContext);
280 const Vector<SVGLength>& dashes = svgStyle->strokeDashArray(); 280 const Vector<SVGLength>& dashes = svgStyle->strokeDashArray();
281 281
282 DashArray dashArray; 282 DashArray dashArray;
283 const Vector<SVGLength>::const_iterator end = dashes.end(); 283 const Vector<SVGLength>::const_iterator end = dashes.end();
284 for (Vector<SVGLength>::const_iterator it = dashes.begin(); it != en d; ++it) 284 for (Vector<SVGLength>::const_iterator it = dashes.begin(); it != en d; ++it)
285 dashArray.append((*it).value(lengthContext)); 285 dashArray.append((*it).value(lengthContext));
286 286
287 writeIfNotDefault(ts, "opacity", svgStyle->strokeOpacity(), 1.0f); 287 writeIfNotDefault(ts, "opacity", svgStyle->strokeOpacity(), 1.0f);
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 ts << " "; 659 ts << " ";
660 writeNameAndQuotedValue(ts, "filter", svgStyle->filterResource()); 660 writeNameAndQuotedValue(ts, "filter", svgStyle->filterResource());
661 ts << " "; 661 ts << " ";
662 writeStandardPrefix(ts, *filter, 0); 662 writeStandardPrefix(ts, *filter, 0);
663 ts << " " << filter->resourceBoundingBox(&renderer) << "\n"; 663 ts << " " << filter->resourceBoundingBox(&renderer) << "\n";
664 } 664 }
665 } 665 }
666 } 666 }
667 667
668 } // namespace WebCore 668 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/svg/SVGCircleElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698