#pragma once
#include "SVGAnimatedPreserveAspectRatio.h"
#include "SVGAnimatedRect.h"
#include "SVGFitToViewBox.h"
#include "SVGTransformListValues.h"
#include "SVGZoomAndPan.h"
namespace WebCore {
class SVGElement;
class SVGTransformList;
class SVGViewSpec final : public RefCounted<SVGViewSpec>, public SVGFitToViewBox, public SVGZoomAndPan {
public:
static Ref<SVGViewSpec> create(SVGElement& contextElement)
{
return adoptRef(*new SVGViewSpec(contextElement));
}
bool parseViewSpec(const String&);
void reset();
void resetContextElement() { m_contextElement = nullptr; }
SVGElement* viewTarget() const;
const String& viewTargetString() const { return m_viewTargetString; }
String transformString() const { return m_transform.toString(); }
RefPtr<SVGTransformList> transform();
SVGTransformListValues transformValue() const { return m_transform.value(); }
const WeakPtr<SVGElement>& contextElementConcurrently() const { return m_contextElement; }
private:
explicit SVGViewSpec(SVGElement&);
using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGViewSpec, SVGFitToViewBox, SVGZoomAndPan>;
static void registerAttributes();
static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); }
static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); }
WeakPtr<SVGElement> m_contextElement;
String m_viewTargetString;
AttributeOwnerProxy m_attributeOwnerProxy;
SVGAnimatedTransformListAttribute m_transform;
};
}