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

Side by Side Diff: Source/core/html/DocumentNameCollection.h

Issue 492453002: Make it clear a DocumentNameCollection can only contain HTMLElements (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Clean up Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/html/DocumentNameCollection.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef DocumentNameCollection_h 5 #ifndef DocumentNameCollection_h
6 #define DocumentNameCollection_h 6 #define DocumentNameCollection_h
7 7
8 #include "core/html/HTMLElement.h"
8 #include "core/html/HTMLNameCollection.h" 9 #include "core/html/HTMLNameCollection.h"
9 10
10 namespace blink { 11 namespace blink {
11 12
12 class DocumentNameCollection FINAL : public HTMLNameCollection { 13 class DocumentNameCollection FINAL : public HTMLNameCollection {
13 public: 14 public:
14 static PassRefPtrWillBeRawPtr<DocumentNameCollection> create(ContainerNode& document, CollectionType type, const AtomicString& name) 15 static PassRefPtrWillBeRawPtr<DocumentNameCollection> create(ContainerNode& document, CollectionType type, const AtomicString& name)
15 { 16 {
16 ASSERT_UNUSED(type, type == DocumentNamedItems); 17 ASSERT_UNUSED(type, type == DocumentNamedItems);
17 return adoptRefWillBeNoop(new DocumentNameCollection(document, name)); 18 return adoptRefWillBeNoop(new DocumentNameCollection(document, name));
18 } 19 }
19 20
20 bool elementMatches(const Element&) const; 21 HTMLElement* item(unsigned offset) const { return toHTMLElement(HTMLNameColl ection::item(offset)); }
22
23 bool elementMatches(const HTMLElement&) const;
21 24
22 private: 25 private:
23 DocumentNameCollection(ContainerNode& document, const AtomicString& name); 26 DocumentNameCollection(ContainerNode& document, const AtomicString& name);
24 }; 27 };
25 28
26 DEFINE_TYPE_CASTS(DocumentNameCollection, LiveNodeListBase, collection, collecti on->type() == DocumentNamedItems, collection.type() == DocumentNamedItems); 29 DEFINE_TYPE_CASTS(DocumentNameCollection, LiveNodeListBase, collection, collecti on->type() == DocumentNamedItems, collection.type() == DocumentNamedItems);
27 30
28 } // namespace blink 31 } // namespace blink
29 32
30 #endif // DocumentNameCollection_h 33 #endif // DocumentNameCollection_h
OLDNEW
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/html/DocumentNameCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698