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

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

Issue 668113003: SVGElement::parseAttribute resolves property via property map (Step 2.6) (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
« no previous file with comments | « Source/core/svg/SVGStopElement.h ('k') | Source/core/svg/SVGStyleElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGStopElement.cpp
diff --git a/Source/core/svg/SVGStopElement.cpp b/Source/core/svg/SVGStopElement.cpp
index 42e3fd5c78766515333ceb58cccd22a3a267da3e..74234325ecc6b561db0cb24118793d5111706d0b 100644
--- a/Source/core/svg/SVGStopElement.cpp
+++ b/Source/core/svg/SVGStopElement.cpp
@@ -36,49 +36,23 @@ inline SVGStopElement::SVGStopElement(Document& document)
DEFINE_NODE_FACTORY(SVGStopElement)
-bool SVGStopElement::isSupportedAttribute(const QualifiedName& attrName)
-{
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
- if (supportedAttributes.isEmpty())
- supportedAttributes.add(SVGNames::offsetAttr);
- return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
-}
-
void SVGStopElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (!isSupportedAttribute(name)) {
- SVGElement::parseAttribute(name, value);
- return;
- }
-
- SVGParsingError parseError = NoError;
-
- if (name == SVGNames::offsetAttr)
- m_offset->setBaseValueAsString(value, parseError);
- else
- ASSERT_NOT_REACHED();
-
- reportAttributeParsingError(parseError, name, value);
+ parseAttributeNew(name, value);
}
void SVGStopElement::svgAttributeChanged(const QualifiedName& attrName)
{
- if (!isSupportedAttribute(attrName)) {
- SVGElement::svgAttributeChanged(attrName);
- return;
- }
-
- SVGElement::InvalidationGuard invalidationGuard(this);
+ if (attrName == SVGNames::offsetAttr) {
+ SVGElement::InvalidationGuard invalidationGuard(this);
- if (!renderer())
- return;
+ if (renderer())
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer());
- if (attrName == SVGNames::offsetAttr) {
- RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer());
return;
}
- ASSERT_NOT_REACHED();
+ SVGElement::svgAttributeChanged(attrName);
}
RenderObject* SVGStopElement::createRenderer(RenderStyle*)
« no previous file with comments | « Source/core/svg/SVGStopElement.h ('k') | Source/core/svg/SVGStyleElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698