Chromium Code Reviews| Index: third_party/WebKit/Source/core/dom/TagCollection.cpp |
| diff --git a/third_party/WebKit/Source/core/dom/TagCollection.cpp b/third_party/WebKit/Source/core/dom/TagCollection.cpp |
| index fb1ef54cf1108eff9d5da87abc067de8a1b6ca66..642818660d8d1c90498171480367968db80e0b9a 100644 |
| --- a/third_party/WebKit/Source/core/dom/TagCollection.cpp |
| +++ b/third_party/WebKit/Source/core/dom/TagCollection.cpp |
| @@ -30,17 +30,31 @@ namespace blink { |
| TagCollection::TagCollection(ContainerNode& root_node, |
| CollectionType type, |
| - const AtomicString& namespace_uri, |
| - const AtomicString& local_name) |
| + const AtomicString& qualified_name) |
| + : HTMLCollection(root_node, type, kDoesNotOverrideItemAfter), |
| + qualified_name_(qualified_name) { |
| + DCHECK_NE(qualified_name, g_star_atom); |
| +} |
| + |
| +TagCollection::~TagCollection() {} |
| + |
| +bool TagCollection::ElementMatches(const Element& test_node) const { |
| + return qualified_name_ == test_node.TagQName().ToString(); |
|
fs
2017/05/08 14:20:36
See comment in HTMLTagCollection.
|
| +} |
| + |
| +TagCollectionNS::TagCollectionNS(ContainerNode& root_node, |
| + CollectionType type, |
| + const AtomicString& namespace_uri, |
| + const AtomicString& local_name) |
| : HTMLCollection(root_node, type, kDoesNotOverrideItemAfter), |
| namespace_uri_(namespace_uri), |
| local_name_(local_name) { |
| DCHECK(namespace_uri_.IsNull() || !namespace_uri_.IsEmpty()); |
| } |
| -TagCollection::~TagCollection() {} |
| +TagCollectionNS::~TagCollectionNS() {} |
| -bool TagCollection::ElementMatches(const Element& test_node) const { |
| +bool TagCollectionNS::ElementMatches(const Element& test_node) const { |
| // Implements |
| // https://dom.spec.whatwg.org/#concept-getelementsbytagnamens |
| if (local_name_ != g_star_atom && local_name_ != test_node.localName()) |