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.cpp

Issue 1629403003: Merge DOMSettableTokensList into DOMTokensList (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed non-oilpan inheritance Created 4 years, 10 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 output.append(' '); 280 output.append(' ');
281 } 281 }
282 282
283 size_t j = output.length(); 283 size_t j = output.length();
284 if (j > 0 && isHTMLSpace<UChar>(output[j - 1])) 284 if (j > 0 && isHTMLSpace<UChar>(output[j - 1]))
285 output.resize(j - 1); 285 output.resize(j - 1);
286 286
287 return output.toAtomicString(); 287 return output.toAtomicString();
288 } 288 }
289 289
290 void DOMTokenList::setValue(const AtomicString& value)
291 {
292 m_value = value;
293 m_tokens.set(value, SpaceSplitString::ShouldNotFoldCase);
294 if (m_observer)
295 m_observer->valueWasSet();
296 }
297
298 bool DOMTokenList::containsInternal(const AtomicString& token) const
299 {
300 return m_tokens.contains(token);
301 }
302
290 ValueIterable<String>::IterationSource* DOMTokenList::startIteration(ScriptState *, ExceptionState&) 303 ValueIterable<String>::IterationSource* DOMTokenList::startIteration(ScriptState *, ExceptionState&)
291 { 304 {
292 return new DOMTokenListIterationSource(this); 305 return new DOMTokenListIterationSource(this);
293 } 306 }
294 307
308 const AtomicString DOMTokenList::item(unsigned index) const
309 {
310 if (index >= length())
311 return AtomicString();
312 return m_tokens[index];
313 }
314
295 } // namespace blink 315 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMTokenList.h ('k') | third_party/WebKit/Source/core/dom/DOMTokenList.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698