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

Side by Side Diff: third_party/WebKit/Source/core/html/ClassList.h

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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 void ClearValueForQuirksMode() { class_names_for_quirks_mode_ = nullptr; } 46 void ClearValueForQuirksMode() { class_names_for_quirks_mode_ = nullptr; }
47 47
48 DECLARE_VIRTUAL_TRACE(); 48 DECLARE_VIRTUAL_TRACE();
49 49
50 private: 50 private:
51 explicit ClassList(Element*); 51 explicit ClassList(Element*);
52 52
53 bool ContainsInternal(const AtomicString&) const override; 53 bool ContainsInternal(const AtomicString&) const override;
54 54
55 const SpaceSplitString& ClassNames() const; 55 const SpaceSplitString& ClassNames() const;
56 SpaceSplitString& MutableSet() override;
56 57
57 const AtomicString& value() const override { 58 const AtomicString& value() const override {
58 return element_->getAttribute(HTMLNames::classAttr); 59 return element_->getAttribute(HTMLNames::classAttr);
59 } 60 }
60 void setValue(const AtomicString& value) override { 61 void setValue(const AtomicString& value) override {
61 element_->setAttribute(HTMLNames::classAttr, value); 62 element_->setAttribute(HTMLNames::classAttr, value);
63 mutable_set_.Clear();
62 } 64 }
63 65
64 Member<Element> element_; 66 Member<Element> element_;
65 mutable std::unique_ptr<SpaceSplitString> class_names_for_quirks_mode_; 67 mutable std::unique_ptr<SpaceSplitString> class_names_for_quirks_mode_;
68 SpaceSplitString mutable_set_;
66 }; 69 };
67 70
68 } // namespace blink 71 } // namespace blink
69 72
70 #endif // ClassList_h 73 #endif // ClassList_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/SpaceSplitString.cpp ('k') | third_party/WebKit/Source/core/html/ClassList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698