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

Unified Diff: Source/core/layout/svg/SVGPathData.cpp

Issue 955033002: [svg2] Make 'rx' and 'ry' presentation attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add tests Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/layout/svg/SVGPathData.cpp
diff --git a/Source/core/layout/svg/SVGPathData.cpp b/Source/core/layout/svg/SVGPathData.cpp
index 954b47e2c020a0568fb85fe811f30704178b0292..279b1c9f8acbc26120bfbc1fa3de3a3028c7b379 100644
--- a/Source/core/layout/svg/SVGPathData.cpp
+++ b/Source/core/layout/svg/SVGPathData.cpp
@@ -51,12 +51,14 @@ static void updatePathFromCircleElement(SVGElement* element, Path& path)
static void updatePathFromEllipseElement(SVGElement* element, Path& path)
{
SVGEllipseElement* ellipse = toSVGEllipseElement(element);
+ ASSERT(ellipse->renderer());
SVGLengthContext lengthContext(element);
- float rx = ellipse->rx()->currentValue()->value(lengthContext);
+ const LayoutStyle& style = ellipse->renderer()->styleRef();
+ float rx = lengthContext.valueForLength(style.svgStyle().rx(), style, LengthModeWidth);
if (rx < 0)
fs 2015/02/26 14:20:58 Shouldn't the negative value be filtered out alrea
Erik Dahlström (inactive) 2015/02/26 16:16:33 Calc may do that indeed, so I think we should keep
return;
- float ry = ellipse->ry()->currentValue()->value(lengthContext);
+ float ry = lengthContext.valueForLength(style.svgStyle().ry(), style, LengthModeHeight);
if (ry < 0)
return;
if (!rx && !ry)
@@ -119,8 +121,8 @@ static void updatePathFromRectElement(SVGElement* element, Path& path)
const LayoutStyle& style = rect->renderer()->styleRef();
float x = lengthContext.valueForLength(style.svgStyle().x(), style, LengthModeWidth);
float y = lengthContext.valueForLength(style.svgStyle().y(), style, LengthModeHeight);
- float rx = rect->rx()->currentValue()->value(lengthContext);
- float ry = rect->ry()->currentValue()->value(lengthContext);
+ float rx = lengthContext.valueForLength(style.svgStyle().rx(), style, LengthModeWidth);
+ float ry = lengthContext.valueForLength(style.svgStyle().ry(), style, LengthModeHeight);
bool hasRx = rx > 0;
bool hasRy = ry > 0;
if (hasRx || hasRy) {

Powered by Google App Engine
This is Rietveld 408576698