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

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 debug print 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
« no previous file with comments | « Source/core/svg/SVGScriptElement.h ('k') | Source/core/svg/SVGStaticStringList.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
« no previous file with comments | « Source/core/svg/SVGScriptElement.h ('k') | Source/core/svg/SVGStaticStringList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698