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

Unified Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 2593973002: Queue custom element attribute reactions for no-op sets, removes (Closed)
Patch Set: Rebaseline MutationObserver test. (Thanks!) Created 4 years 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/dom/DOMTokenList.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index a483dda4d6366dc523efa95e7526e2029013109b..d1c874cbd14d358a9f373ca7327c88fede5d32ac 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -2512,8 +2512,13 @@ void Element::removeAttributeInternal(
AtomicString valueBeingRemoved = attributes[index].value();
if (!inSynchronizationOfLazyAttribute) {
- if (!valueBeingRemoved.isNull())
+ if (!valueBeingRemoved.isNull()) {
willModifyAttribute(name, valueBeingRemoved, nullAtom);
+ } else if (getCustomElementState() == CustomElementState::Custom) {
+ // This would otherwise be enqueued by willModifyAttribute.
+ CustomElement::enqueueAttributeChangedCallback(
+ this, name, valueBeingRemoved, nullAtom);
+ }
}
if (Attr* attrNode = attrIfExists(name))
@@ -3512,14 +3517,17 @@ void Element::willModifyAttribute(const QualifiedName& name,
updateName(oldValue, newValue);
}
+ if (getCustomElementState() == CustomElementState::Custom) {
+ CustomElement::enqueueAttributeChangedCallback(this, name, oldValue,
+ newValue);
+ }
+
if (oldValue != newValue) {
document().styleEngine().attributeChangedForElement(name, *this);
- if (getCustomElementState() == CustomElementState::Custom)
- CustomElement::enqueueAttributeChangedCallback(this, name, oldValue,
- newValue);
- else if (isUpgradedV0CustomElement())
+ if (isUpgradedV0CustomElement()) {
V0CustomElement::attributeDidChange(this, name.localName(), oldValue,
newValue);
+ }
}
if (MutationObserverInterestGroup* recipients =
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMTokenList.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698