| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |