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

Unified Diff: third_party/WebKit/Source/core/svg/SVGElement.cpp

Issue 2623513005: Introduce Element::AttributeModificationParams (Closed)
Patch Set: Created 3 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 | « third_party/WebKit/Source/core/svg/SVGElement.h ('k') | third_party/WebKit/Source/core/svg/SVGSVGElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/svg/SVGElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGElement.cpp
index e16d7e0a83777768e9c8a9e0d091b96025efec81..ca28a2c62aabbe6da3ad50231c4f87911506fcf2 100644
--- a/third_party/WebKit/Source/core/svg/SVGElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGElement.cpp
@@ -661,34 +661,36 @@ bool SVGElement::inUseShadowTree() const {
return correspondingUseElement();
}
-void SVGElement::parseAttribute(const QualifiedName& name,
- const AtomicString& oldValue,
- const AtomicString& value) {
- if (SVGAnimatedPropertyBase* property = propertyFromAttribute(name)) {
- SVGParsingError parseError = property->setBaseValueAsString(value);
- reportAttributeParsingError(parseError, name, value);
+void SVGElement::parseAttribute(const AttributeModificationParams& params) {
+ if (SVGAnimatedPropertyBase* property = propertyFromAttribute(params.name)) {
+ SVGParsingError parseError =
+ property->setBaseValueAsString(params.newValue);
+ reportAttributeParsingError(parseError, params.name, params.newValue);
return;
}
- if (name == HTMLNames::classAttr) {
+ if (params.name == HTMLNames::classAttr) {
// SVG animation has currently requires special storage of values so we set
// the className here. svgAttributeChanged actually causes the resulting
// style updates (instead of Element::parseAttribute). We don't
// tell Element about the change to avoid parsing the class list twice
- SVGParsingError parseError = m_className->setBaseValueAsString(value);
- reportAttributeParsingError(parseError, name, value);
- } else if (name == tabindexAttr) {
- Element::parseAttribute(name, oldValue, value);
+ SVGParsingError parseError =
+ m_className->setBaseValueAsString(params.newValue);
+ reportAttributeParsingError(parseError, params.name, params.newValue);
+ } else if (params.name == tabindexAttr) {
+ Element::parseAttribute(params);
} else {
// standard events
const AtomicString& eventName =
- HTMLElement::eventNameForAttributeName(name);
- if (!eventName.isNull())
+ HTMLElement::eventNameForAttributeName(params.name);
+ if (!eventName.isNull()) {
setAttributeEventListener(
- eventName, createAttributeEventListener(this, name, value,
- eventParameterName()));
- else
- Element::parseAttribute(name, oldValue, value);
+ eventName,
+ createAttributeEventListener(this, params.name, params.newValue,
+ eventParameterName()));
+ } else {
+ Element::parseAttribute(params);
+ }
}
}
@@ -914,23 +916,21 @@ void SVGElement::sendSVGLoadEventToSelfAndAncestorChainIfPossible() {
toSVGElement(parent)->sendSVGLoadEventToSelfAndAncestorChainIfPossible();
}
-void SVGElement::attributeChanged(const QualifiedName& name,
- const AtomicString& oldValue,
- const AtomicString& newValue,
- AttributeModificationReason) {
- Element::attributeChanged(name, oldValue, newValue,
- AttributeModificationReason::kDirectly);
+void SVGElement::attributeChanged(const AttributeModificationParams& params) {
+ Element::attributeChanged(
+ AttributeModificationParams(params.name, params.oldValue, params.newValue,
+ AttributeModificationReason::kDirectly));
- if (name == HTMLNames::idAttr)
+ if (params.name == HTMLNames::idAttr)
rebuildAllIncomingReferences();
// Changes to the style attribute are processed lazily (see
// Element::getAttribute() and related methods), so we don't want changes to
// the style attribute to result in extra work here.
- if (name == HTMLNames::styleAttr)
+ if (params.name == HTMLNames::styleAttr)
return;
- svgAttributeBaseValChanged(name);
+ svgAttributeBaseValChanged(params.name);
}
void SVGElement::svgAttributeChanged(const QualifiedName& attrName) {
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGElement.h ('k') | third_party/WebKit/Source/core/svg/SVGSVGElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698