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

Unified Diff: Source/core/rendering/svg/RenderSVGViewportContainer.cpp

Issue 17287012: Replace hasAttribute with the check for actual value (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Replace '>=' with '=' to fix layout test failures Created 7 years, 6 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 | « LayoutTests/svg/animations/use-set-attribute-width-height-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGViewportContainer.cpp
diff --git a/Source/core/rendering/svg/RenderSVGViewportContainer.cpp b/Source/core/rendering/svg/RenderSVGViewportContainer.cpp
index 00e428e75ad5e5d65c7eb56ec4768b5fe2520e01..cb2f28e649b3246f50a62de364de9bdbd0e2f9c9 100644
--- a/Source/core/rendering/svg/RenderSVGViewportContainer.cpp
+++ b/Source/core/rendering/svg/RenderSVGViewportContainer.cpp
@@ -96,14 +96,14 @@ void RenderSVGViewportContainer::calcViewport()
// values will override the corresponding attributes on the 'svg' in the generated tree.
SVGLengthContext lengthContext(element);
- if (useElement->hasAttribute(SVGNames::widthAttr))
+ if (useElement->width().value(lengthContext) > 0)
m_viewport.setWidth(useElement->width().value(lengthContext));
else if (isSymbolElement && svg->hasAttribute(SVGNames::widthAttr)) {
SVGLength containerWidth(LengthModeWidth, "100%");
m_viewport.setWidth(containerWidth.value(lengthContext));
}
- if (useElement->hasAttribute(SVGNames::heightAttr))
+ if (useElement->height().value(lengthContext) > 0)
m_viewport.setHeight(useElement->height().value(lengthContext));
else if (isSymbolElement && svg->hasAttribute(SVGNames::heightAttr)) {
SVGLength containerHeight(LengthModeHeight, "100%");
« no previous file with comments | « LayoutTests/svg/animations/use-set-attribute-width-height-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698