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

Unified Diff: third_party/WebKit/Source/core/dom/TagCollection.h

Issue 2868823002: getElementsByTagName() should take a qualifiedName in parameter (Closed)
Patch Set: Rebased And Align with review comments Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/TagCollection.h
diff --git a/third_party/WebKit/Source/core/dom/TagCollection.h b/third_party/WebKit/Source/core/dom/TagCollection.h
index d46f51b153ba559c877abaebcfe51f1c02fbc58d..b6ba81ffb804b6b55a281bd237e53d9380e52e35 100644
--- a/third_party/WebKit/Source/core/dom/TagCollection.h
+++ b/third_party/WebKit/Source/core/dom/TagCollection.h
@@ -33,19 +33,10 @@ namespace blink {
class TagCollection : public HTMLCollection {
public:
static TagCollection* Create(ContainerNode& root_node,
- const AtomicString& namespace_uri,
- const AtomicString& local_name) {
- DCHECK(namespace_uri != g_star_atom);
- return new TagCollection(root_node, kTagCollectionType, namespace_uri,
- local_name);
- }
-
- static TagCollection* Create(ContainerNode& root_node,
CollectionType type,
- const AtomicString& local_name) {
+ const AtomicString& qualified_name) {
DCHECK_EQ(type, kTagCollectionType);
- return new TagCollection(root_node, kTagCollectionType, g_star_atom,
- local_name);
+ return new TagCollection(root_node, kTagCollectionType, qualified_name);
}
~TagCollection() override;
@@ -55,8 +46,29 @@ class TagCollection : public HTMLCollection {
protected:
TagCollection(ContainerNode& root_node,
CollectionType,
- const AtomicString& namespace_uri,
- const AtomicString& local_name);
+ const AtomicString& qualified_name);
+
+ AtomicString qualified_name_;
+};
+
+class TagCollectionNS : public HTMLCollection {
+ public:
+ static TagCollectionNS* Create(ContainerNode& root_node,
+ const AtomicString& namespace_uri,
+ const AtomicString& local_name) {
+ return new TagCollectionNS(root_node, kTagCollectionNSType, namespace_uri,
+ local_name);
+ }
+
+ ~TagCollectionNS() override;
+
+ bool ElementMatches(const Element&) const;
+
+ private:
+ TagCollectionNS(ContainerNode& root_node,
+ CollectionType,
+ const AtomicString& namespace_uri,
+ const AtomicString& local_name);
AtomicString namespace_uri_;
AtomicString local_name_;
@@ -68,6 +80,12 @@ DEFINE_TYPE_CASTS(TagCollection,
collection->GetType() == kTagCollectionType,
collection.GetType() == kTagCollectionType);
+DEFINE_TYPE_CASTS(TagCollectionNS,
+ LiveNodeListBase,
+ collection,
+ collection->GetType() == kTagCollectionNSType,
+ collection.GetType() == kTagCollectionNSType);
+
} // namespace blink
#endif // TagCollection_h
« no previous file with comments | « third_party/WebKit/Source/core/dom/NodeListsNodeData.cpp ('k') | third_party/WebKit/Source/core/dom/TagCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698