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

Unified Diff: third_party/WebKit/Source/core/dom/DOMTokenList.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
Index: third_party/WebKit/Source/core/dom/DOMTokenList.cpp
diff --git a/third_party/WebKit/Source/core/dom/DOMTokenList.cpp b/third_party/WebKit/Source/core/dom/DOMTokenList.cpp
index b931c6832e9744863c0e2b61a36454b92573d15c..1149d40fbb15821f490493f7be53d807bdc428f7 100644
--- a/third_party/WebKit/Source/core/dom/DOMTokenList.cpp
+++ b/third_party/WebKit/Source/core/dom/DOMTokenList.cpp
@@ -153,8 +153,7 @@ void DOMTokenList::remove(const Vector<String>& tokens,
}
}
- if (found)
- setValue(removeTokens(value(), tokens));
+ setValue(found ? removeTokens(value(), tokens) : value());
}
bool DOMTokenList::toggle(const AtomicString& token,
@@ -291,8 +290,10 @@ AtomicString DOMTokenList::removeTokens(const AtomicString& input,
}
void DOMTokenList::setValue(const AtomicString& value) {
+ bool valueChanged = m_value != value;
m_value = value;
- m_tokens.set(value, SpaceSplitString::ShouldNotFoldCase);
+ if (valueChanged)
+ m_tokens.set(value, SpaceSplitString::ShouldNotFoldCase);
if (m_observer)
m_observer->valueWasSet();
}

Powered by Google App Engine
This is Rietveld 408576698