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

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

Issue 963733002: [svg2] Make 'width' and 'height' presentation attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebaseline some EX tests [Mac Win] Created 5 years, 9 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/LayoutSVGImage.cpp ('k') | Source/core/layout/svg/SVGPathData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/svg/LayoutSVGRect.cpp
diff --git a/Source/core/layout/svg/LayoutSVGRect.cpp b/Source/core/layout/svg/LayoutSVGRect.cpp
index a04e79fb99c2dca6bb1a5ae4cd1368b01f0574c3..55cb64448da2297a9b7e3b7024de2a1662c808ba 100644
--- a/Source/core/layout/svg/LayoutSVGRect.cpp
+++ b/Source/core/layout/svg/LayoutSVGRect.cpp
@@ -54,7 +54,9 @@ void LayoutSVGRect::updateShapeFromElement()
ASSERT(rect);
SVGLengthContext lengthContext(rect);
- FloatSize boundingBoxSize(rect->width()->currentValue()->value(lengthContext), rect->height()->currentValue()->value(lengthContext));
+ FloatSize boundingBoxSize(
+ lengthContext.valueForLength(styleRef().width(), styleRef(), SVGLengthMode::Width),
+ lengthContext.valueForLength(styleRef().height(), styleRef(), SVGLengthMode::Height));
// Spec: "A negative value is an error."
if (boundingBoxSize.width() < 0 || boundingBoxSize.height() < 0)
@@ -64,8 +66,8 @@ void LayoutSVGRect::updateShapeFromElement()
if (!boundingBoxSize.isEmpty()) {
// Fallback to LayoutSVGShape and path-based hit detection if the rect
// has rounded corners or a non-scaling or non-simple stroke.
- if (lengthContext.valueForLength(style()->svgStyle().rx(), styleRef(), SVGLengthMode::Width) > 0
- || lengthContext.valueForLength(style()->svgStyle().ry(), styleRef(), SVGLengthMode::Height) > 0
+ if (lengthContext.valueForLength(styleRef().svgStyle().rx(), styleRef(), SVGLengthMode::Width) > 0
+ || lengthContext.valueForLength(styleRef().svgStyle().ry(), styleRef(), SVGLengthMode::Height) > 0
|| hasNonScalingStroke()
|| !definitelyHasSimpleStroke()) {
LayoutSVGShape::updateShapeFromElement();
« no previous file with comments | « Source/core/layout/svg/LayoutSVGImage.cpp ('k') | Source/core/layout/svg/SVGPathData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698