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

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

Issue 2537223006: Cleanup after removal of the SVGViewSpec interface (Closed)
Patch Set: SVGViewSpec& 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 550ddcd72f3022b145bad0d7484818c00e86f5a9..ba1ca6917baf6afcbf3eb4e4b285fc23797cb0a3 100644
--- a/third_party/WebKit/Source/core/svg/SVGViewSpec.h
+++ b/third_party/WebKit/Source/core/svg/SVGViewSpec.h
@@ -20,60 +20,56 @@
#ifndef SVGViewSpec_h
#define SVGViewSpec_h
-#include "core/svg/SVGFitToViewBox.h"
-#include "core/svg/SVGSVGElement.h"
#include "core/svg/SVGZoomAndPan.h"
#include "platform/heap/Handle.h"
namespace blink {
-class SVGViewSpec final : public GarbageCollectedFinalized<SVGViewSpec>,
- public SVGZoomAndPan,
- public SVGFitToViewBox {
- USING_GARBAGE_COLLECTED_MIXIN(SVGViewSpec);
+class FloatRect;
+class SVGPreserveAspectRatio;
+class SVGRect;
+class SVGTransformList;
+class SVGViewSpec final : public GarbageCollectedFinalized<SVGViewSpec>,
+ public SVGZoomAndPan {
public:
- static SVGViewSpec* create(SVGSVGElement* contextElement) {
- return new SVGViewSpec(contextElement);
- }
+ static SVGViewSpec* create() { return new SVGViewSpec(); }
bool parseViewSpec(const String&);
void reset();
template <typename T>
void inheritViewAttributesFromElement(T*);
- SVGTransformList* transform() {
- return m_transform ? m_transform->baseValue() : 0;
+ SVGRect* viewBox() { return m_viewBox; }
+ SVGPreserveAspectRatio* preserveAspectRatio() {
+ return m_preserveAspectRatio;
}
+ SVGTransformList* transform() { return m_transform; }
DECLARE_VIRTUAL_TRACE();
- SVGSVGElement* contextElement() { return m_contextElement.get(); }
-
private:
- explicit SVGViewSpec(SVGSVGElement*);
+ SVGViewSpec();
template <typename CharType>
bool parseViewSpecInternal(const CharType* ptr, const CharType* end);
- Member<SVGSVGElement> m_contextElement;
- Member<SVGAnimatedTransformList> m_transform;
- String m_viewTargetString;
+ void setViewBox(const FloatRect&);
+ void setPreserveAspectRatio(const SVGPreserveAspectRatio&);
+
+ Member<SVGRect> m_viewBox;
+ Member<SVGPreserveAspectRatio> m_preserveAspectRatio;
+ Member<SVGTransformList> m_transform;
};
template <typename T>
void SVGViewSpec::inheritViewAttributesFromElement(T* inheritFromElement) {
if (!inheritFromElement->hasEmptyViewBox())
- viewBox()->baseValue()->setValue(
- inheritFromElement->viewBox()->currentValue()->value());
+ setViewBox(inheritFromElement->viewBox()->currentValue()->value());
if (inheritFromElement->preserveAspectRatio()->isSpecified()) {
- preserveAspectRatio()->baseValue()->setAlign(
- inheritFromElement->preserveAspectRatio()->currentValue()->align());
- preserveAspectRatio()->baseValue()->setMeetOrSlice(
- inheritFromElement->preserveAspectRatio()
- ->currentValue()
- ->meetOrSlice());
+ setPreserveAspectRatio(
+ *inheritFromElement->preserveAspectRatio()->currentValue());
}
if (inheritFromElement->hasAttribute(SVGNames::zoomAndPanAttr))
« 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