From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/svg/SVGViewSpec.h | 69 ++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 45 deletions(-) (limited to 'Source/WebCore/svg/SVGViewSpec.h') diff --git a/Source/WebCore/svg/SVGViewSpec.h b/Source/WebCore/svg/SVGViewSpec.h index f8634afd6..9fb5d42be 100644 --- a/Source/WebCore/svg/SVGViewSpec.h +++ b/Source/WebCore/svg/SVGViewSpec.h @@ -17,75 +17,58 @@ * Boston, MA 02110-1301, USA. */ -#ifndef SVGViewSpec_h -#define SVGViewSpec_h +#pragma once -#if ENABLE(SVG) #include "SVGAnimatedPreserveAspectRatio.h" #include "SVGAnimatedRect.h" #include "SVGFitToViewBox.h" -#include "SVGTransformList.h" +#include "SVGTransformListValues.h" #include "SVGZoomAndPan.h" namespace WebCore { class SVGElement; -class SVGTransformListPropertyTearOff; +class SVGTransformList; -class SVGViewSpec : public RefCounted - , public SVGZoomAndPan - , public SVGFitToViewBox { +class SVGViewSpec final : public RefCounted, public SVGZoomAndPan, public SVGFitToViewBox { public: - virtual ~SVGViewSpec() { } - - using RefCounted::ref; - using RefCounted::deref; - - static PassRefPtr create(SVGElement* contextElement) + static Ref create(SVGElement& contextElement) { - return adoptRef(new SVGViewSpec(contextElement)); + return adoptRef(*new SVGViewSpec(contextElement)); } bool parseViewSpec(const String&); void reset(); SVGElement* viewTarget() const; - String viewBoxString() const; - - String preserveAspectRatioString() const; - void setTransformString(const String&); String transformString() const; - - void setViewTargetString(const String& string) { m_viewTargetString = string; } - String viewTargetString() const { return m_viewTargetString; } + String viewBoxString() const; + String preserveAspectRatioString() const; + const String& viewTargetString() const { return m_viewTargetString; } SVGZoomAndPanType zoomAndPan() const { return m_zoomAndPan; } - void setZoomAndPan(unsigned short zoomAndPan) { setZoomAndPanBaseValue(zoomAndPan); } - void setZoomAndPan(unsigned short, ExceptionCode&); + ExceptionOr setZoomAndPan(unsigned short); void setZoomAndPanBaseValue(unsigned short zoomAndPan) { m_zoomAndPan = SVGZoomAndPan::parseFromNumber(zoomAndPan); } - SVGElement* contextElement() const { return m_contextElement; } - void resetContextElement() { m_contextElement = 0; } + void resetContextElement() { m_contextElement = nullptr; } // Custom non-animated 'transform' property. - SVGTransformListPropertyTearOff* transform(); - SVGTransformList transformBaseValue() const { return m_transform; } + RefPtr transform(); + SVGTransformListValues transformBaseValue() const { return m_transform; } // Custom animated 'viewBox' property. - PassRefPtr viewBoxAnimated(); + RefPtr viewBoxAnimated(); FloatRect& viewBox() { return m_viewBox; } - FloatRect viewBoxBaseValue() const { return m_viewBox; } void setViewBoxBaseValue(const FloatRect& viewBox) { m_viewBox = viewBox; } // Custom animated 'preserveAspectRatio' property. - PassRefPtr preserveAspectRatioAnimated(); - SVGPreserveAspectRatio& preserveAspectRatio() { return m_preserveAspectRatio; } - SVGPreserveAspectRatio preserveAspectRatioBaseValue() const { return m_preserveAspectRatio; } - void setPreserveAspectRatioBaseValue(const SVGPreserveAspectRatio& preserveAspectRatio) { m_preserveAspectRatio = preserveAspectRatio; } + RefPtr preserveAspectRatioAnimated(); + SVGPreserveAspectRatioValue& preserveAspectRatio() { return m_preserveAspectRatio; } + void setPreserveAspectRatioBaseValue(const SVGPreserveAspectRatioValue& preserveAspectRatio) { m_preserveAspectRatio = preserveAspectRatio; } private: - SVGViewSpec(SVGElement*); + explicit SVGViewSpec(SVGElement&); static const SVGPropertyInfo* transformPropertyInfo(); static const SVGPropertyInfo* viewBoxPropertyInfo(); @@ -95,20 +78,16 @@ private: static const AtomicString& viewBoxIdentifier(); static const AtomicString& preserveAspectRatioIdentifier(); - static PassRefPtr lookupOrCreateTransformWrapper(SVGViewSpec* contextElement); - static PassRefPtr lookupOrCreateViewBoxWrapper(SVGViewSpec* contextElement); - static PassRefPtr lookupOrCreatePreserveAspectRatioWrapper(SVGViewSpec* contextElement); + static Ref lookupOrCreateTransformWrapper(SVGViewSpec* contextElement); + static Ref lookupOrCreateViewBoxWrapper(SVGViewSpec* contextElement); + static Ref lookupOrCreatePreserveAspectRatioWrapper(SVGViewSpec* contextElement); SVGElement* m_contextElement; - SVGZoomAndPanType m_zoomAndPan; - - SVGTransformList m_transform; + SVGZoomAndPanType m_zoomAndPan { SVGZoomAndPanMagnify }; + SVGTransformListValues m_transform; FloatRect m_viewBox; - SVGPreserveAspectRatio m_preserveAspectRatio; + SVGPreserveAspectRatioValue m_preserveAspectRatio; String m_viewTargetString; }; } // namespace WebCore - -#endif // ENABLE(SVG) -#endif -- cgit v1.2.1