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

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

Issue 22801006: Use svg casting function instead of static_cast<> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 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 | no next file » | 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 writeNameValuePair(ts, "cx", element->cxCurrentValue().value(lengthConte xt)); 347 writeNameValuePair(ts, "cx", element->cxCurrentValue().value(lengthConte xt));
348 writeNameValuePair(ts, "cy", element->cyCurrentValue().value(lengthConte xt)); 348 writeNameValuePair(ts, "cy", element->cyCurrentValue().value(lengthConte xt));
349 writeNameValuePair(ts, "rx", element->rxCurrentValue().value(lengthConte xt)); 349 writeNameValuePair(ts, "rx", element->rxCurrentValue().value(lengthConte xt));
350 writeNameValuePair(ts, "ry", element->ryCurrentValue().value(lengthConte xt)); 350 writeNameValuePair(ts, "ry", element->ryCurrentValue().value(lengthConte xt));
351 } else if (svgElement->hasTagName(SVGNames::circleTag)) { 351 } else if (svgElement->hasTagName(SVGNames::circleTag)) {
352 SVGCircleElement* element = static_cast<SVGCircleElement*>(svgElement); 352 SVGCircleElement* element = static_cast<SVGCircleElement*>(svgElement);
353 writeNameValuePair(ts, "cx", element->cxCurrentValue().value(lengthConte xt)); 353 writeNameValuePair(ts, "cx", element->cxCurrentValue().value(lengthConte xt));
354 writeNameValuePair(ts, "cy", element->cyCurrentValue().value(lengthConte xt)); 354 writeNameValuePair(ts, "cy", element->cyCurrentValue().value(lengthConte xt));
355 writeNameValuePair(ts, "r", element->rCurrentValue().value(lengthContext )); 355 writeNameValuePair(ts, "r", element->rCurrentValue().value(lengthContext ));
356 } else if (svgElement->hasTagName(SVGNames::polygonTag) || svgElement->hasTa gName(SVGNames::polylineTag)) { 356 } else if (svgElement->hasTagName(SVGNames::polygonTag) || svgElement->hasTa gName(SVGNames::polylineTag)) {
357 SVGPolyElement* element = static_cast<SVGPolyElement*>(svgElement); 357 writeNameAndQuotedValue(ts, "points", toSVGPolyElement(svgElement)->poin tList().valueAsString());
358 writeNameAndQuotedValue(ts, "points", element->pointList().valueAsString ());
359 } else if (svgElement->hasTagName(SVGNames::pathTag)) { 358 } else if (svgElement->hasTagName(SVGNames::pathTag)) {
360 SVGPathElement* element = toSVGPathElement(svgElement);
361 String pathString; 359 String pathString;
362 // FIXME: We should switch to UnalteredParsing here - this will affect t he path dumping output of dozens of tests. 360 // FIXME: We should switch to UnalteredParsing here - this will affect t he path dumping output of dozens of tests.
363 buildStringFromByteStream(element->pathByteStream(), pathString, Normali zedParsing); 361 buildStringFromByteStream(toSVGPathElement(svgElement)->pathByteStream() , pathString, NormalizedParsing);
364 writeNameAndQuotedValue(ts, "data", pathString); 362 writeNameAndQuotedValue(ts, "data", pathString);
365 } else 363 } else
366 ASSERT_NOT_REACHED(); 364 ASSERT_NOT_REACHED();
367 return ts; 365 return ts;
368 } 366 }
369 367
370 static TextStream& operator<<(TextStream& ts, const RenderSVGRoot& root) 368 static TextStream& operator<<(TextStream& ts, const RenderSVGRoot& root)
371 { 369 {
372 return writePositionAndStyle(ts, root); 370 return writePositionAndStyle(ts, root);
373 } 371 }
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 ts << " "; 667 ts << " ";
670 writeNameAndQuotedValue(ts, "filter", svgStyle->filterResource()); 668 writeNameAndQuotedValue(ts, "filter", svgStyle->filterResource());
671 ts << " "; 669 ts << " ";
672 writeStandardPrefix(ts, *filter, 0); 670 writeStandardPrefix(ts, *filter, 0);
673 ts << " " << filter->resourceBoundingBox(&renderer) << "\n"; 671 ts << " " << filter->resourceBoundingBox(&renderer) << "\n";
674 } 672 }
675 } 673 }
676 } 674 }
677 675
678 } // namespace WebCore 676 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698