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

Unified Diff: third_party/WebKit/Source/core/html/ClassList.cpp

Issue 2895903002: DOMTokenList: Update serialization algorithm on add()/remove() (Closed)
Patch Set: Apply review comments Created 3 years, 7 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/html/ClassList.h ('k') | third_party/WebKit/Source/core/html/RelList.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/ClassList.cpp
diff --git a/third_party/WebKit/Source/core/html/ClassList.cpp b/third_party/WebKit/Source/core/html/ClassList.cpp
index 5a749472c108ebb7740192554b389aafb9c618bf..d38aed24471a068ccf5e18d65926c93ecf0b072a 100644
--- a/third_party/WebKit/Source/core/html/ClassList.cpp
+++ b/third_party/WebKit/Source/core/html/ClassList.cpp
@@ -60,6 +60,16 @@ const SpaceSplitString& ClassList::ClassNames() const {
return element_->ClassNames();
}
+SpaceSplitString& ClassList::MutableSet() {
+ // We can't mutate element_->ClassNames() because it is used to compare class
+ // names before/after class attribute change.
+ if (element_->HasClass())
+ mutable_set_ = ClassNames();
+ else
+ mutable_set_ = SpaceSplitString();
+ return mutable_set_;
+}
+
DEFINE_TRACE(ClassList) {
visitor->Trace(element_);
DOMTokenList::Trace(visitor);
« no previous file with comments | « third_party/WebKit/Source/core/html/ClassList.h ('k') | third_party/WebKit/Source/core/html/RelList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698