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

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

Issue 643703006: SVGElement::parseAttribute resolves property via property map (Step 2.4) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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 7099c20162db9cee840f2c67764eba2482361cfd..f27d91dcac1282a347be4e27589700148456a084 100644
--- a/Source/core/svg/SVGScriptElement.cpp
+++ b/Source/core/svg/SVGScriptElement.cpp
@@ -49,56 +49,22 @@ PassRefPtrWillBeRawPtr<SVGScriptElement> SVGScriptElement::create(Document& docu
return adoptRefWillBeNoop(new SVGScriptElement(document, insertedByParser, false));
}
-bool SVGScriptElement::isSupportedAttribute(const QualifiedName& attrName)
-{
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
- if (supportedAttributes.isEmpty()) {
- SVGURIReference::addSupportedAttributes(supportedAttributes);
- supportedAttributes.add(SVGNames::typeAttr);
- supportedAttributes.add(HTMLNames::onerrorAttr);
- }
- return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
-}
-
void SVGScriptElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (!isSupportedAttribute(name)) {
- SVGElement::parseAttribute(name, value);
- return;
- }
-
- SVGParsingError parseError = NoError;
- if (name == SVGNames::typeAttr)
- return;
-
- if (name == HTMLNames::onerrorAttr) {
+ if (name == HTMLNames::onerrorAttr)
setAttributeEventListener(EventTypeNames::error, createAttributeEventListener(this, name, value, eventParameterName()));
- } else if (SVGURIReference::parseAttribute(name, value, parseError)) {
- } else {
- ASSERT_NOT_REACHED();
- }
-
- reportAttributeParsingError(parseError, name, value);
+ else
+ parseAttributeNew(name, value);
}
void SVGScriptElement::svgAttributeChanged(const QualifiedName& attrName)
{
- if (!isSupportedAttribute(attrName)) {
- SVGElement::svgAttributeChanged(attrName);
- return;
- }
-
- SVGElement::InvalidationGuard invalidationGuard(this);
-
- if (attrName == SVGNames::typeAttr || attrName == HTMLNames::onerrorAttr)
- return;
-
if (SVGURIReference::isKnownAttribute(attrName)) {
+ SVGElement::InvalidationGuard invalidationGuard(this);
m_loader->handleSourceAttribute(hrefString());
- return;
+ } else {
+ SVGElement::svgAttributeChanged(attrName);
}
-
- ASSERT_NOT_REACHED();
}
Node::InsertionNotificationRequest SVGScriptElement::insertedInto(ContainerNode* rootParent)

Powered by Google App Engine
This is Rietveld 408576698