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

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

Issue 2552513002: Rework SVGViewSpec<->SVGSVGElement integration (Closed)
Patch Set: Move setup back to SVGSVGElement Created 4 years 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 | « third_party/WebKit/Source/core/svg/SVGViewSpec.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGViewSpec.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698