SVGForeignObjectElement.h [plain text]
#pragma once
#include "SVGAnimatedBoolean.h"
#include "SVGAnimatedLength.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGGraphicsElement.h"
#include "SVGNames.h"
#include "SVGURIReference.h"
namespace WebCore {
class SVGForeignObjectElement final : public SVGGraphicsElement, public SVGExternalResourcesRequired {
WTF_MAKE_ISO_ALLOCATED(SVGForeignObjectElement);
public:
static Ref<SVGForeignObjectElement> create(const QualifiedName&, Document&);
const SVGLengthValue& x() const { return m_x.currentValue(attributeOwnerProxy()); }
const SVGLengthValue& y() const { return m_y.currentValue(attributeOwnerProxy()); }
const SVGLengthValue& width() const { return m_width.currentValue(attributeOwnerProxy()); }
const SVGLengthValue& height() const { return m_height.currentValue(attributeOwnerProxy()); }
RefPtr<SVGAnimatedLength> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); }
RefPtr<SVGAnimatedLength> yAnimated() { return m_y.animatedProperty(attributeOwnerProxy()); }
RefPtr<SVGAnimatedLength> widthAnimated() { return m_width.animatedProperty(attributeOwnerProxy()); }
RefPtr<SVGAnimatedLength> heightAnimated() { return m_height.animatedProperty(attributeOwnerProxy()); }
private:
SVGForeignObjectElement(const QualifiedName&, Document&);
using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGForeignObjectElement, SVGGraphicsElement, SVGExternalResourcesRequired>;
static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); }
static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); }
static void registerAttributes();
const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; }
void parseAttribute(const QualifiedName&, const AtomicString&) final;
void svgAttributeChanged(const QualifiedName&) final;
bool rendererIsNeeded(const RenderStyle&) final;
bool childShouldCreateRenderer(const Node&) const final;
RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final;
bool isValid() const final { return SVGTests::isValid(); }
bool selfHasRelativeLengths() const final { return true; }
AttributeOwnerProxy m_attributeOwnerProxy { *this };
SVGAnimatedLengthAttribute m_x { LengthModeWidth };
SVGAnimatedLengthAttribute m_y { LengthModeHeight };
SVGAnimatedLengthAttribute m_width { LengthModeWidth };
SVGAnimatedLengthAttribute m_height { LengthModeHeight };
};
}