Chromium Code Reviews

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

Issue 963733002: [svg2] Make 'width' and 'height' presentation attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: test fixes Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: Source/core/layout/svg/LayoutSVGForeignObject.cpp
diff --git a/Source/core/layout/svg/LayoutSVGForeignObject.cpp b/Source/core/layout/svg/LayoutSVGForeignObject.cpp
index 298769cb550d6a2d08530aea77fb106b52f22efb..392bc5a92828ff76cddbc8fa4b08ce466ce10f77 100644
--- a/Source/core/layout/svg/LayoutSVGForeignObject.cpp
+++ b/Source/core/layout/svg/LayoutSVGForeignObject.cpp
@@ -93,8 +93,13 @@ void LayoutSVGForeignObject::layout()
// Cache viewport boundaries
SVGLengthContext lengthContext(foreign);
- FloatPoint viewportLocation(foreign->x()->currentValue()->value(lengthContext), foreign->y()->currentValue()->value(lengthContext));
- m_viewport = FloatRect(viewportLocation, FloatSize(foreign->width()->currentValue()->value(lengthContext), foreign->height()->currentValue()->value(lengthContext)));
+ const LayoutStyle& style = foreign->layoutObject()->styleRef();
fs 2015/03/12 14:28:48 Just use styleRef() directly? (foreign->layoutObje
Erik Dahlström (inactive) 2015/03/12 16:14:56 Done.
+ FloatPoint viewportLocation(
+ lengthContext.valueForLength(style.svgStyle().x(), style, SVGLengthMode::Width),
+ lengthContext.valueForLength(style.svgStyle().y(), style, SVGLengthMode::Height));
+ m_viewport = FloatRect(viewportLocation, FloatSize(
+ lengthContext.valueForLength(style.width(), style, SVGLengthMode::Width),
+ lengthContext.valueForLength(style.height(), style, SVGLengthMode::Height)));
if (!updateCachedBoundariesInParents)
updateCachedBoundariesInParents = oldViewport != m_viewport;

Powered by Google App Engine