+
+ // SVGFitToViewBox JS API.
+ static SVGAnimatedRect* viewBox(SVGFitToViewBox* object) { return object->viewBox(); }
+ static SVGAnimatedPreserveAspectRatio* preserveAspectRatio(SVGFitToViewBox* object) { return object->preserveAspectRatio(); }
+
+ SVGAnimatedRect* viewBox() const { return m_viewBox.get(); }
+ bool hasEmptyViewBox() const { return m_viewBox->currentValue()->isValid() && m_viewBox->currentValue()->value().isEmpty(); }
+ SVGAnimatedPreserveAspectRatio* preserveAspectRatio() const { return m_preserveAspectRatio.get(); }
+
+protected:
+ explicit SVGFitToViewBox(SVGElement*, PropertyMapPolicy = PropertyMapPolicyAdd);
+ void updateViewBox(const FloatRect&);
+ void clearViewBox() { m_viewBox = 0; }
+ void clearPreserveAspectRatio() { m_preserveAspectRatio = 0; }
+
+private:
+ RefPtr<SVGAnimatedRect> m_viewBox;
+ RefPtr<SVGAnimatedPreserveAspectRatio> m_preserveAspectRatio;