OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All r
ights reserved. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All r
ights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 namespace WebCore { | 32 namespace WebCore { |
33 | 33 |
34 class HTMLCollection : public ScriptWrappable, public RefCounted<HTMLCollection>
, public LiveNodeListBase { | 34 class HTMLCollection : public ScriptWrappable, public RefCounted<HTMLCollection>
, public LiveNodeListBase { |
35 public: | 35 public: |
36 static PassRefPtr<HTMLCollection> create(ContainerNode* base, CollectionType
); | 36 static PassRefPtr<HTMLCollection> create(ContainerNode* base, CollectionType
); |
37 virtual ~HTMLCollection(); | 37 virtual ~HTMLCollection(); |
38 virtual void invalidateCache() const OVERRIDE; | 38 virtual void invalidateCache() const OVERRIDE; |
39 | 39 |
40 // DOM API | 40 // DOM API |
41 virtual Node* namedItem(const AtomicString& name) const; | 41 virtual Element* namedItem(const AtomicString& name) const; |
42 | 42 |
43 // Non-DOM API | 43 // Non-DOM API |
44 void namedItems(const AtomicString& name, Vector<RefPtr<Node> >&) const; | 44 void namedItems(const AtomicString& name, Vector<RefPtr<Element> >&) const; |
45 bool isEmpty() const | 45 bool isEmpty() const |
46 { | 46 { |
47 if (isLengthCacheValid()) | 47 if (isLengthCacheValid()) |
48 return !cachedLength(); | 48 return !cachedLength(); |
49 if (cachedItem()) | 49 if (cachedItem()) |
50 return false; | 50 return false; |
51 return !item(0); | 51 return !item(0); |
52 } | 52 } |
53 bool hasExactlyOneItem() const | 53 bool hasExactlyOneItem() const |
54 { | 54 { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 mutable unsigned m_isNameCacheValid : 1; | 92 mutable unsigned m_isNameCacheValid : 1; |
93 mutable NodeCacheMap m_idCache; | 93 mutable NodeCacheMap m_idCache; |
94 mutable NodeCacheMap m_nameCache; | 94 mutable NodeCacheMap m_nameCache; |
95 | 95 |
96 friend class LiveNodeListBase; | 96 friend class LiveNodeListBase; |
97 }; | 97 }; |
98 | 98 |
99 } // namespace | 99 } // namespace |
100 | 100 |
101 #endif | 101 #endif |
OLD | NEW |