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

Unified Diff: third_party/WebKit/Source/core/html/HTMLElement.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
Index: third_party/WebKit/Source/core/html/HTMLElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLElement.cpp b/third_party/WebKit/Source/core/html/HTMLElement.cpp
index 9755528d4b2eb6bee6591e07cba4f35ae9ae223a..729ac0ef40a33ce2a8d2a9bb2f77c30bc47fc229 100644
--- a/third_party/WebKit/Source/core/html/HTMLElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLElement.cpp
@@ -426,18 +426,15 @@ const AtomicString& HTMLElement::eventNameForAttributeName(
return attributeNameToEventNameMap.get(attrName.localName());
}
-void HTMLElement::attributeChanged(const QualifiedName& name,
- const AtomicString& oldValue,
- const AtomicString& newValue,
- AttributeModificationReason reason) {
- Element::attributeChanged(name, oldValue, newValue, reason);
- if (reason != AttributeModificationReason::kDirectly)
+void HTMLElement::attributeChanged(const AttributeModificationParams& params) {
+ Element::attributeChanged(params);
+ if (params.reason != AttributeModificationReason::kDirectly)
return;
if (adjustedFocusedElementInTreeScope() != this)
return;
- if (name == hiddenAttr && !newValue.isNull()) {
+ if (params.name == hiddenAttr && !params.newValue.isNull()) {
blur();
- } else if (name == contenteditableAttr) {
+ } else if (params.name == contenteditableAttr) {
// The attribute change may cause supportsFocus() to return false
// for the element which had focus.
//
@@ -449,22 +446,22 @@ void HTMLElement::attributeChanged(const QualifiedName& name,
}
}
-void HTMLElement::parseAttribute(const QualifiedName& name,
- const AtomicString& oldValue,
- const AtomicString& value) {
- if (name == tabindexAttr || name == XMLNames::langAttr)
- return Element::parseAttribute(name, oldValue, value);
+void HTMLElement::parseAttribute(const AttributeModificationParams& params) {
+ if (params.name == tabindexAttr || params.name == XMLNames::langAttr)
+ return Element::parseAttribute(params);
- if (name == dirAttr) {
- dirAttributeChanged(value);
- } else if (name == langAttr) {
+ if (params.name == dirAttr) {
+ dirAttributeChanged(params.newValue);
+ } else if (params.name == langAttr) {
pseudoStateChanged(CSSSelector::PseudoLang);
} else {
- const AtomicString& eventName = eventNameForAttributeName(name);
- if (!eventName.isNull())
+ const AtomicString& eventName = eventNameForAttributeName(params.name);
+ if (!eventName.isNull()) {
setAttributeEventListener(
- eventName, createAttributeEventListener(this, name, value,
- eventParameterName()));
+ eventName,
+ createAttributeEventListener(this, params.name, params.newValue,
+ eventParameterName()));
+ }
}
}
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLElement.h ('k') | third_party/WebKit/Source/core/html/HTMLEmbedElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698