Index: third_party/WebKit/Source/core/svg/SVGViewSpec.cpp |
diff --git a/third_party/WebKit/Source/core/svg/SVGViewSpec.cpp b/third_party/WebKit/Source/core/svg/SVGViewSpec.cpp |
index 23fdd2a9ae66cac2b3f933393c6dc491ec84b4a8..a8098ef4faf0b951f95b1b38f0a91a156fd0e46f 100644 |
--- a/third_party/WebKit/Source/core/svg/SVGViewSpec.cpp |
+++ b/third_party/WebKit/Source/core/svg/SVGViewSpec.cpp |
@@ -22,6 +22,7 @@ |
#include "core/svg/SVGParserUtilities.h" |
#include "core/svg/SVGPreserveAspectRatio.h" |
#include "core/svg/SVGRect.h" |
+#include "core/svg/SVGSVGElement.h" |
#include "core/svg/SVGTransformList.h" |
#include "wtf/text/ParsingUtilities.h" |
@@ -38,6 +39,16 @@ DEFINE_TRACE(SVGViewSpec) { |
visitor->trace(m_transform); |
} |
+SVGViewSpec* SVGViewSpec::createForElement(SVGSVGElement& rootElement) { |
+ SVGViewSpec* viewSpec = rootElement.viewSpec(); |
+ if (!viewSpec) |
+ viewSpec = new SVGViewSpec(); |
+ else |
+ viewSpec->reset(); |
+ viewSpec->inheritViewAttributesFromElement(rootElement); |
+ return viewSpec; |
+} |
+ |
bool SVGViewSpec::parseViewSpec(const String& spec) { |
if (spec.isEmpty()) |
return false; |