#ifndef SVGURIReference_h
#define SVGURIReference_h
#include "core/dom/Document.h"
#include "core/svg/SVGAnimatedString.h"
namespace WebCore {
class Attribute;
class Element;
class SVGURIReference {
public:
virtual ~SVGURIReference() { }
bool isKnownAttribute(const QualifiedName&);
void addSupportedAttributes(HashSet<QualifiedName>&);
static AtomicString fragmentIdentifierFromIRIString(const String&, const Document&);
static Element* targetElementFromIRIString(const String&, const Document&, AtomicString* = 0, Document* = 0);
static inline bool isExternalURIReference(const String& uri, const Document& document)
{
if (uri.startsWith('#'))
return false;
KURL url = document.completeURL(uri);
return !equalIgnoringFragmentIdentifier(url, document.url());
}
static SVGAnimatedString* href(SVGURIReference& object) { return object.href(); }
SVGAnimatedString* href() const { return m_href.get(); }
const String& hrefString() const { return m_href->currentValue()->value(); }
bool parseAttribute(const QualifiedName&, const AtomicString& value, SVGParsingError&);
protected:
explicit SVGURIReference(SVGElement*);
private:
RefPtr<SVGAnimatedString> m_href;
};
}
#endif