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

Unified Diff: third_party/WebKit/Source/core/svg/SVGSVGElement.cpp

Issue 2774753004: Add SVGFitToViewBox::hasValidViewBox helper (Closed)
Patch Set: Created 3 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
Index: third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
index b1c0f787121a9a560fc375edfdeb96ee952a5af6..8febecdedad02529b39e012ac4947b34ee1a7745 100644
--- a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
@@ -582,9 +582,9 @@ SVGPreserveAspectRatio* SVGSVGElement::currentPreserveAspectRatio() const {
if (m_viewSpec)
return m_viewSpec->preserveAspectRatio();
- if (!viewBox()->currentValue()->isValid() && shouldSynthesizeViewBox()) {
- // If no viewBox is specified and we're embedded through SVGImage, then
- // synthesize a pAR with the value 'none'.
+ if (!hasValidViewBox() && shouldSynthesizeViewBox()) {
+ // If no (valid) viewBox is specified and we're embedded through SVGImage,
+ // then synthesize a pAR with the value 'none'.
SVGPreserveAspectRatio* synthesizedPAR = SVGPreserveAspectRatio::create();
synthesizedPAR->setAlign(
SVGPreserveAspectRatio::kSvgPreserveaspectratioNone);
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGPatternElement.cpp ('k') | third_party/WebKit/Source/core/svg/SVGViewSpec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698