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

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

Issue 896773002: [svg2] Make 'x' and 'y' presentation attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase 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
« no previous file with comments | « Source/core/layout/svg/LayoutSVGRect.cpp ('k') | Source/core/svg/SVGAnimateElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/svg/SVGPathData.cpp
diff --git a/Source/core/layout/svg/SVGPathData.cpp b/Source/core/layout/svg/SVGPathData.cpp
index 164022e19ed41a96393cedf3a1be268bf16762ae..c884a5bc29ee06e1f2cf1179132b5616bdcf9e60 100644
--- a/Source/core/layout/svg/SVGPathData.cpp
+++ b/Source/core/layout/svg/SVGPathData.cpp
@@ -21,6 +21,8 @@
#include "core/layout/svg/SVGPathData.h"
#include "core/SVGNames.h"
+#include "core/layout/LayoutObject.h"
+#include "core/layout/style/SVGLayoutStyle.h"
#include "core/svg/SVGCircleElement.h"
#include "core/svg/SVGEllipseElement.h"
#include "core/svg/SVGLineElement.h"
@@ -102,6 +104,7 @@ static void updatePathFromPolygonElement(SVGElement* element, Path& path)
static void updatePathFromRectElement(SVGElement* element, Path& path)
{
SVGRectElement* rect = toSVGRectElement(element);
+ ASSERT(rect->renderer());
SVGLengthContext lengthContext(element);
float width = rect->width()->currentValue()->value(lengthContext);
@@ -112,8 +115,10 @@ static void updatePathFromRectElement(SVGElement* element, Path& path)
return;
if (!width && !height)
return;
- float x = rect->x()->currentValue()->value(lengthContext);
- float y = rect->y()->currentValue()->value(lengthContext);
+
+ const SVGLayoutStyle& style = rect->renderer()->style()->svgStyle();
+ float x = lengthContext.valueForLength(style.x(), LengthModeWidth);
+ float y = lengthContext.valueForLength(style.y(), LengthModeHeight);
float rx = rect->rx()->currentValue()->value(lengthContext);
float ry = rect->ry()->currentValue()->value(lengthContext);
bool hasRx = rx > 0;
« no previous file with comments | « Source/core/layout/svg/LayoutSVGRect.cpp ('k') | Source/core/svg/SVGAnimateElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698