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

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

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
Index: third_party/WebKit/Source/core/svg/SVGViewSpec.h
diff --git a/third_party/WebKit/Source/core/svg/SVGViewSpec.h b/third_party/WebKit/Source/core/svg/SVGViewSpec.h
index ba1ca6917baf6afcbf3eb4e4b285fc23797cb0a3..3d7ea0384d9da25c484baab9372a34e9b057cf17 100644
--- a/third_party/WebKit/Source/core/svg/SVGViewSpec.h
+++ b/third_party/WebKit/Source/core/svg/SVGViewSpec.h
@@ -28,17 +28,18 @@ namespace blink {
class FloatRect;
class SVGPreserveAspectRatio;
class SVGRect;
+class SVGSVGElement;
class SVGTransformList;
class SVGViewSpec final : public GarbageCollectedFinalized<SVGViewSpec>,
public SVGZoomAndPan {
public:
- static SVGViewSpec* create() { return new SVGViewSpec(); }
+ static SVGViewSpec* createForElement(SVGSVGElement&);
bool parseViewSpec(const String&);
void reset();
template <typename T>
- void inheritViewAttributesFromElement(T*);
+ void inheritViewAttributesFromElement(T&);
SVGRect* viewBox() { return m_viewBox; }
SVGPreserveAspectRatio* preserveAspectRatio() {
@@ -63,17 +64,17 @@ class SVGViewSpec final : public GarbageCollectedFinalized<SVGViewSpec>,
};
template <typename T>
-void SVGViewSpec::inheritViewAttributesFromElement(T* inheritFromElement) {
- if (!inheritFromElement->hasEmptyViewBox())
- setViewBox(inheritFromElement->viewBox()->currentValue()->value());
+void SVGViewSpec::inheritViewAttributesFromElement(T& inheritFromElement) {
+ if (!inheritFromElement.hasEmptyViewBox())
+ setViewBox(inheritFromElement.viewBox()->currentValue()->value());
- if (inheritFromElement->preserveAspectRatio()->isSpecified()) {
+ if (inheritFromElement.preserveAspectRatio()->isSpecified()) {
setPreserveAspectRatio(
- *inheritFromElement->preserveAspectRatio()->currentValue());
+ *inheritFromElement.preserveAspectRatio()->currentValue());
}
- if (inheritFromElement->hasAttribute(SVGNames::zoomAndPanAttr))
- setZoomAndPan(inheritFromElement->zoomAndPan());
+ if (inheritFromElement.hasAttribute(SVGNames::zoomAndPanAttr))
+ setZoomAndPan(inheritFromElement.zoomAndPan());
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGSVGElement.cpp ('k') | third_party/WebKit/Source/core/svg/SVGViewSpec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698