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

Side by Side Diff: third_party/WebKit/Source/core/html/ClassList.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 12 matching lines...) Expand all
23 */ 23 */
24 24
25 #include "core/html/ClassList.h" 25 #include "core/html/ClassList.h"
26 26
27 #include "core/dom/Document.h" 27 #include "core/dom/Document.h"
28 28
29 namespace blink { 29 namespace blink {
30 30
31 using namespace HTMLNames; 31 using namespace HTMLNames;
32 32
33 ClassList::ClassList(Element* element) : m_element(element) { } 33 ClassList::ClassList(Element* element) : DOMTokenList(nullptr), m_element(elemen t) { }
34
35 #if !ENABLE(OILPAN)
36 void ClassList::ref()
37 {
38 m_element->ref();
39 }
40
41 void ClassList::deref()
42 {
43 m_element->deref();
44 }
45 #endif
46 34
47 unsigned ClassList::length() const 35 unsigned ClassList::length() const
48 { 36 {
49 return m_element->hasClass() ? classNames().size() : 0; 37 return m_element->hasClass() ? classNames().size() : 0;
50 } 38 }
51 39
52 const AtomicString ClassList::item(unsigned index) const 40 const AtomicString ClassList::item(unsigned index) const
53 { 41 {
54 if (index >= length()) 42 if (index >= length())
55 return AtomicString(); 43 return AtomicString();
(...skipping 16 matching lines...) Expand all
72 return m_element->classNames(); 60 return m_element->classNames();
73 } 61 }
74 62
75 DEFINE_TRACE(ClassList) 63 DEFINE_TRACE(ClassList)
76 { 64 {
77 visitor->trace(m_element); 65 visitor->trace(m_element);
78 DOMTokenList::trace(visitor); 66 DOMTokenList::trace(visitor);
79 } 67 }
80 68
81 } // namespace blink 69 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/ClassList.h ('k') | third_party/WebKit/Source/core/html/HTMLAnchorElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698