Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(709)

Unified Diff: Source/core/svg/SVGScriptElement.cpp

Issue 148173018: [SVG] SVGAnimatedString{,List} migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove if 0 Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/svg/SVGScriptElement.cpp
diff --git a/Source/core/svg/SVGScriptElement.cpp b/Source/core/svg/SVGScriptElement.cpp
index 5563f095c1d033d7a87ac0194078615ae647f49c..b6d0a63ba79919ddf4889f616d03a8ead645e21a 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();
}
@@ -83,10 +83,14 @@ void SVGScriptElement::parseAttribute(const QualifiedName& name, const AtomicStr
return;
}
- if (SVGURIReference::parseAttribute(name, value))
- return;
+ SVGParsingError parseError = NoError;
- ASSERT_NOT_REACHED();
+ if (name.matches(XLinkNames::hrefAttr))
+ m_href->setBaseValueAsString(value, parseError);
+ else
+ ASSERT_NOT_REACHED();
+
+ reportAttributeParsingError(parseError, name, value);
}
void SVGScriptElement::svgAttributeChanged(const QualifiedName& attrName)
@@ -102,7 +106,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 +163,7 @@ bool SVGScriptElement::haveLoadedRequiredResources()
String SVGScriptElement::sourceAttributeValue() const
{
- return hrefCurrentValue();
+ return m_href->currentValue()->value();
}
String SVGScriptElement::charsetAttributeValue() const
@@ -199,7 +203,7 @@ bool SVGScriptElement::deferAttributeValue() const
bool SVGScriptElement::hasSourceAttribute() const
{
- return hasAttribute(XLinkNames::hrefAttr);
+ return m_href->isSpecified();
}
PassRefPtr<Element> SVGScriptElement::cloneElementWithoutAttributesAndChildren()

Powered by Google App Engine
This is Rietveld 408576698