SVGExternalResourcesRequired.h [plain text]
#pragma once
#include "QualifiedName.h"
#include "SVGAttributeOwnerProxyImpl.h"
#include <wtf/HashSet.h>
namespace WebCore {
class SVGElement;
class SVGExternalResourcesRequired {
WTF_MAKE_NONCOPYABLE(SVGExternalResourcesRequired);
public:
virtual ~SVGExternalResourcesRequired() = default;
void parseAttribute(const QualifiedName&, const AtomicString&);
void svgAttributeChanged(const QualifiedName&);
static void addSupportedAttributes(HashSet<QualifiedName>&);
using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGExternalResourcesRequired>;
static auto& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); }
auto externalResourcesRequiredAnimated() { return m_externalResourcesRequired.animatedProperty(attributeOwnerProxy()); }
bool externalResourcesRequired() const { return m_externalResourcesRequired.value(); }
void setExternalResourcesRequired(bool externalResourcesRequired) { m_externalResourcesRequired.setValue(externalResourcesRequired); }
protected:
SVGExternalResourcesRequired(SVGElement* contextElement);
static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); }
virtual void setHaveFiredLoadEvent(bool) { }
virtual bool isParserInserted() const { return false; }
virtual bool haveFiredLoadEvent() const { return false; }
void dispatchLoadEvent();
void insertedIntoDocument();
void finishParsingChildren();
bool haveLoadedRequiredResources() const;
private:
static void registerAttributes();
AttributeOwnerProxy attributeOwnerProxy() { return { *this, m_contextElement }; }
SVGElement& m_contextElement;
SVGAnimatedBooleanAttribute m_externalResourcesRequired;
};
}