namespace WebCore {
// Animated property definitions
-DEFINE_ANIMATED_STRING(SVGScriptElement, XLinkNames::hrefAttr, Href, href)
BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGScriptElement)
- REGISTER_LOCAL_ANIMATED_PROPERTY(href)
END_REGISTER_ANIMATED_PROPERTIES
inline SVGScriptElement::SVGScriptElement(Document& document, bool wasInsertedByParser, bool alreadyStarted)
: SVGElement(SVGNames::scriptTag, document)
+ , SVGURIReference(this)
, m_svgLoadEventTimer(this, &SVGElement::svgLoadEventTimerFired)
, m_loader(ScriptLoader::create(this, wasInsertedByParser, alreadyStarted))
{
return;
}
- if (name == SVGNames::typeAttr) {
- setType(value);
+ SVGParsingError parseError = NoError;
+ if (name == SVGNames::typeAttr)
return;
- }
if (name == HTMLNames::onerrorAttr) {
setAttributeEventListener(EventTypeNames::error, createAttributeEventListener(this, name, value));
- return;
+ } else if (SVGURIReference::parseAttribute(name, value, parseError)) {
+ } else {
+ ASSERT_NOT_REACHED();
}
- if (SVGURIReference::parseAttribute(name, value))
- return;
-
- ASSERT_NOT_REACHED();
+ reportAttributeParsingError(parseError, name, value);
}
void SVGScriptElement::svgAttributeChanged(const QualifiedName& attrName)
return;
if (SVGURIReference::isKnownAttribute(attrName)) {
- m_loader->handleSourceAttribute(hrefCurrentValue());
+ m_loader->handleSourceAttribute(hrefString());
return;
}
m_loader->setHaveFiredLoadEvent(true);
}
-String SVGScriptElement::type() const
-{
- return m_type;
-}
-
-void SVGScriptElement::setType(const String& type)
-{
- m_type = type;
-}
-
bool SVGScriptElement::haveLoadedRequiredResources()
{
return m_loader->haveFiredLoadEvent();
String SVGScriptElement::sourceAttributeValue() const
{
- return hrefCurrentValue();
+ return hrefString();
}
String SVGScriptElement::charsetAttributeValue() const
String SVGScriptElement::typeAttributeValue() const
{
- return type();
+ return getAttribute(SVGNames::typeAttr).string();
}
String SVGScriptElement::languageAttributeValue() const
bool SVGScriptElement::hasSourceAttribute() const
{
- return hasAttribute(XLinkNames::hrefAttr);
+ return href()->isSpecified();
}
PassRefPtr<Element> SVGScriptElement::cloneElementWithoutAttributesAndChildren()
dispatchEvent(Event::create(EventTypeNames::load));
}
+#ifndef NDEBUG
+bool SVGScriptElement::isAnimatableAttribute(const QualifiedName& name) const
+{
+ if (name == SVGNames::typeAttr)
+ return false;
+
+ return SVGElement::isAnimatableAttribute(name);
+}
+#endif
+
}