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

Side by Side Diff: third_party/WebKit/Source/core/dom/DOMTokenList.h

Issue 2895903002: DOMTokenList: Update serialization algorithm on add()/remove() (Closed)
Patch Set: Remove one -expected.txt 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 virtual void remove(const Vector<String>&, ExceptionState&); 66 virtual void remove(const Vector<String>&, ExceptionState&);
67 void remove(const AtomicString&, ExceptionState&); 67 void remove(const AtomicString&, ExceptionState&);
68 bool toggle(const AtomicString&, ExceptionState&); 68 bool toggle(const AtomicString&, ExceptionState&);
69 bool toggle(const AtomicString&, bool force, ExceptionState&); 69 bool toggle(const AtomicString&, bool force, ExceptionState&);
70 bool supports(const AtomicString&, ExceptionState&); 70 bool supports(const AtomicString&, ExceptionState&);
71 71
72 virtual const AtomicString& value() const { return value_; } 72 virtual const AtomicString& value() const { return value_; }
73 virtual void setValue(const AtomicString&); 73 virtual void setValue(const AtomicString&);
74 74
75 const SpaceSplitString& Tokens() const { return tokens_; } 75 const SpaceSplitString& Tokens() const { return tokens_; }
76 virtual SpaceSplitString& MutableSet() { return tokens_; }
kochi 2017/05/24 05:46:00 How about moving this to protected: section?
tkent 2017/05/24 06:05:34 It's reasonable. Done.
76 void SetObserver(DOMTokenListObserver* observer) { observer_ = observer; } 77 void SetObserver(DOMTokenListObserver* observer) { observer_ = observer; }
77 78
78 const AtomicString& toString() const { return value(); } 79 const AtomicString& toString() const { return value(); }
79 80
80 DEFINE_INLINE_VIRTUAL_TRACE() { visitor->Trace(observer_); } 81 DEFINE_INLINE_VIRTUAL_TRACE() { visitor->Trace(observer_); }
81 82
82 protected: 83 protected:
83 DOMTokenList(DOMTokenListObserver* observer) : observer_(observer) {} 84 DOMTokenList(DOMTokenListObserver* observer) : observer_(observer) {}
84 85
85 virtual void AddInternal(const AtomicString&); 86 virtual void AddInternal(const AtomicString&);
86 virtual bool ContainsInternal(const AtomicString&) const; 87 virtual bool ContainsInternal(const AtomicString&) const;
87 virtual void RemoveInternal(const AtomicString&); 88 virtual void RemoveInternal(const AtomicString&);
88 89
89 bool ValidateToken(const String&, ExceptionState&) const; 90 bool ValidateToken(const String&, ExceptionState&) const;
90 bool ValidateTokens(const Vector<String>&, ExceptionState&) const; 91 bool ValidateTokens(const Vector<String>&, ExceptionState&) const;
91 virtual bool ValidateTokenValue(const AtomicString&, ExceptionState&) const; 92 virtual bool ValidateTokenValue(const AtomicString&, ExceptionState&) const;
92 static AtomicString AddToken(const AtomicString&, const AtomicString&); 93 AtomicString AddToken(const AtomicString&);
93 static AtomicString AddTokens(const AtomicString&, const Vector<String>&); 94 AtomicString AddTokens(const Vector<String>&);
94 static AtomicString RemoveToken(const AtomicString&, const AtomicString&); 95 AtomicString RemoveToken(const AtomicString&);
95 static AtomicString RemoveTokens(const AtomicString&, const Vector<String>&); 96 AtomicString RemoveTokens(const Vector<String>&);
97 static AtomicString SerializeSet(const SpaceSplitString&);
96 98
97 private: 99 private:
98 SpaceSplitString tokens_; 100 SpaceSplitString tokens_;
99 AtomicString value_; 101 AtomicString value_;
100 WeakMember<DOMTokenListObserver> observer_; 102 WeakMember<DOMTokenListObserver> observer_;
101 }; 103 };
102 104
103 } // namespace blink 105 } // namespace blink
104 106
105 #endif // DOMTokenList_h 107 #endif // DOMTokenList_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698