Chromium Code Reviews| 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 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 | 26 |
| 27 #include "core/html/HTMLCollection.h" | 27 #include "core/html/HTMLCollection.h" |
| 28 #include "platform/wtf/text/AtomicString.h" | 28 #include "platform/wtf/text/AtomicString.h" |
| 29 | 29 |
| 30 namespace blink { | 30 namespace blink { |
| 31 | 31 |
| 32 // Collection that limits to a particular tag. | 32 // Collection that limits to a particular tag. |
| 33 class TagCollection : public HTMLCollection { | 33 class TagCollection : public HTMLCollection { |
| 34 public: | 34 public: |
| 35 static TagCollection* Create(ContainerNode& root_node, | 35 static TagCollection* Create(ContainerNode& root_node, |
| 36 const AtomicString& namespace_uri, | |
| 37 const AtomicString& local_name) { | |
| 38 DCHECK(namespace_uri != g_star_atom); | |
| 39 return new TagCollection(root_node, kTagCollectionType, namespace_uri, | |
| 40 local_name); | |
| 41 } | |
| 42 | |
| 43 static TagCollection* Create(ContainerNode& root_node, | |
| 44 CollectionType type, | 36 CollectionType type, |
| 45 const AtomicString& local_name) { | 37 const AtomicString& qualified_name) { |
| 46 DCHECK_EQ(type, kTagCollectionType); | 38 DCHECK_EQ(type, kTagCollectionType); |
| 47 return new TagCollection(root_node, kTagCollectionType, g_star_atom, | 39 return new TagCollection(root_node, kTagCollectionType, qualified_name); |
| 48 local_name); | |
| 49 } | 40 } |
| 50 | 41 |
| 51 ~TagCollection() override; | 42 ~TagCollection() override; |
| 52 | 43 |
| 53 bool ElementMatches(const Element&) const; | 44 bool ElementMatches(const Element&) const; |
| 54 | 45 |
| 55 protected: | 46 protected: |
| 56 TagCollection(ContainerNode& root_node, | 47 TagCollection(ContainerNode& root_node, |
| 57 CollectionType, | 48 CollectionType, |
| 58 const AtomicString& namespace_uri, | 49 const AtomicString& qualified_name); |
| 59 const AtomicString& local_name); | 50 |
| 51 AtomicString qualified_name_; | |
| 52 }; | |
| 53 | |
| 54 class TagCollectionNS : public HTMLCollection { | |
| 55 public: | |
| 56 static TagCollectionNS* Create(ContainerNode& root_node, | |
| 57 const AtomicString& namespace_uri, | |
| 58 const AtomicString& local_name) { | |
| 59 return new TagCollectionNS(root_node, kTagCollectionNSType, namespace_uri, | |
| 60 local_name); | |
| 61 } | |
| 62 | |
| 63 static TagCollectionNS* Create(ContainerNode& root_node, | |
|
fs
2017/05/08 14:20:36
Is this even called?
Shanmuga Pandi
2017/05/10 12:17:22
Removed
| |
| 64 CollectionType type, | |
| 65 const AtomicString& local_name) { | |
| 66 DCHECK_EQ(type, kTagCollectionNSType); | |
| 67 return new TagCollectionNS(root_node, kTagCollectionNSType, g_star_atom, | |
| 68 local_name); | |
| 69 } | |
| 70 | |
| 71 ~TagCollectionNS() override; | |
| 72 | |
| 73 bool ElementMatches(const Element&) const; | |
| 74 | |
| 75 protected: | |
|
tkent
2017/05/09 00:28:01
should be private?
Shanmuga Pandi
2017/05/10 12:17:22
Done.
| |
| 76 TagCollectionNS(ContainerNode& root_node, | |
| 77 CollectionType, | |
| 78 const AtomicString& namespace_uri, | |
| 79 const AtomicString& local_name); | |
| 60 | 80 |
| 61 AtomicString namespace_uri_; | 81 AtomicString namespace_uri_; |
| 62 AtomicString local_name_; | 82 AtomicString local_name_; |
| 63 }; | 83 }; |
| 64 | 84 |
| 65 DEFINE_TYPE_CASTS(TagCollection, | 85 DEFINE_TYPE_CASTS(TagCollection, |
| 66 LiveNodeListBase, | 86 LiveNodeListBase, |
| 67 collection, | 87 collection, |
| 68 collection->GetType() == kTagCollectionType, | 88 collection->GetType() == kTagCollectionType, |
| 69 collection.GetType() == kTagCollectionType); | 89 collection.GetType() == kTagCollectionType); |
| 70 | 90 |
| 91 DEFINE_TYPE_CASTS(TagCollectionNS, | |
| 92 LiveNodeListBase, | |
| 93 collection, | |
| 94 collection->GetType() == kTagCollectionNSType, | |
| 95 collection.GetType() == kTagCollectionNSType); | |
| 96 | |
| 71 } // namespace blink | 97 } // namespace blink |
| 72 | 98 |
| 73 #endif // TagCollection_h | 99 #endif // TagCollection_h |
| OLD | NEW |