| Index: Source/core/svg/SVGScriptElement.cpp
|
| diff --git a/Source/core/svg/SVGScriptElement.cpp b/Source/core/svg/SVGScriptElement.cpp
|
| index 5563f095c1d033d7a87ac0194078615ae647f49c..36891e3161d564f253f31c060f0a085005dbd8b1 100644
|
| --- a/Source/core/svg/SVGScriptElement.cpp
|
| +++ b/Source/core/svg/SVGScriptElement.cpp
|
| @@ -35,18 +35,18 @@
|
| 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)
|
| + , m_href(SVGAnimatedString::create(this, XLinkNames::hrefAttr, SVGString::create()))
|
| , m_svgLoadEventTimer(this, &SVGElement::svgLoadEventTimerFired)
|
| , m_loader(ScriptLoader::create(this, wasInsertedByParser, alreadyStarted))
|
| {
|
| ScriptWrappable::init(this);
|
| + addToPropertyMap(m_href);
|
| registerAnimatedPropertiesForSVGScriptElement();
|
| }
|
|
|
| @@ -73,20 +73,18 @@ void SVGScriptElement::parseAttribute(const QualifiedName& name, const AtomicStr
|
| return;
|
| }
|
|
|
| - if (name == SVGNames::typeAttr) {
|
| - setType(value);
|
| - return;
|
| - }
|
| + SVGParsingError parseError = NoError;
|
|
|
| - if (name == HTMLNames::onerrorAttr) {
|
| + if (name == SVGNames::typeAttr)
|
| + setType(value);
|
| + else if (name == HTMLNames::onerrorAttr)
|
| setAttributeEventListener(EventTypeNames::error, createAttributeEventListener(this, name, value));
|
| - return;
|
| - }
|
| -
|
| - if (SVGURIReference::parseAttribute(name, value))
|
| - return;
|
| + else if (name.matches(XLinkNames::hrefAttr))
|
| + m_href->setBaseValueAsString(value, parseError);
|
| + else
|
| + ASSERT_NOT_REACHED();
|
|
|
| - ASSERT_NOT_REACHED();
|
| + reportAttributeParsingError(parseError, name, value);
|
| }
|
|
|
| void SVGScriptElement::svgAttributeChanged(const QualifiedName& attrName)
|
| @@ -102,7 +100,7 @@ void SVGScriptElement::svgAttributeChanged(const QualifiedName& attrName)
|
| return;
|
|
|
| if (SVGURIReference::isKnownAttribute(attrName)) {
|
| - m_loader->handleSourceAttribute(hrefCurrentValue());
|
| + m_loader->handleSourceAttribute(m_href->currentValue()->value());
|
| return;
|
| }
|
|
|
| @@ -159,7 +157,7 @@ bool SVGScriptElement::haveLoadedRequiredResources()
|
|
|
| String SVGScriptElement::sourceAttributeValue() const
|
| {
|
| - return hrefCurrentValue();
|
| + return m_href->currentValue()->value();
|
| }
|
|
|
| String SVGScriptElement::charsetAttributeValue() const
|
| @@ -199,7 +197,7 @@ bool SVGScriptElement::deferAttributeValue() const
|
|
|
| bool SVGScriptElement::hasSourceAttribute() const
|
| {
|
| - return hasAttribute(XLinkNames::hrefAttr);
|
| + return m_href->isSpecified();
|
| }
|
|
|
| PassRefPtr<Element> SVGScriptElement::cloneElementWithoutAttributesAndChildren()
|
|
|