#pragma once
#include "SVGFitToViewBox.h"
#include "SVGZoomAndPan.h"
#include <wtf/WeakPtr.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 StringView&);
void reset();
void resetContextElement() { m_contextElement = nullptr; }
SVGElement* viewTarget() const;
const String& viewTargetString() const { return m_viewTargetString; }
String transformString() const { return m_transform->valueAsString(); }
Ref<SVGTransformList>& transform() { return m_transform; }
const WeakPtr<SVGElement>& contextElementConcurrently() const { return m_contextElement; }
private:
explicit SVGViewSpec(SVGElement&);
using PropertyRegistry = SVGPropertyOwnerRegistry<SVGViewSpec, SVGFitToViewBox>;
WeakPtr<SVGElement> m_contextElement;
String m_viewTargetString;
Ref<SVGTransformList> m_transform;
};
}