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

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

Issue 2868823002: getElementsByTagName() should take a qualifiedName in parameter (Closed)
Patch Set: Added new file AllDescendantsCollection.h 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/AllDescendantsCollection.h
diff --git a/third_party/WebKit/Source/core/dom/AllDescendantsCollection.h b/third_party/WebKit/Source/core/dom/AllDescendantsCollection.h
new file mode 100644
index 0000000000000000000000000000000000000000..c6d5fac4d2efeca389b0bacb148f8e363dd47e71
--- /dev/null
+++ b/third_party/WebKit/Source/core/dom/AllDescendantsCollection.h
@@ -0,0 +1,36 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
tkent 2017/05/09 00:28:01 If you copied the code from the WebKit patch, you
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef AllDescendantsCollection_h
+#define AllDescendantsCollection_h
+
+#include "core/html/HTMLCollection.h"
+
+namespace blink {
+
+class AllDescendantsCollection : public HTMLCollection {
+ public:
+ static AllDescendantsCollection* Create(ContainerNode& root_node,
+ CollectionType type) {
+ DCHECK_EQ(type, kAllDescendantsCollectionType);
+ return new AllDescendantsCollection(root_node,
+ kAllDescendantsCollectionType);
+ }
+
+ bool ElementMatches(const Element&) const { return true; }
+
+ protected:
tkent 2017/05/09 00:28:01 should be private?
+ AllDescendantsCollection(ContainerNode& root_node, CollectionType type)
+ : HTMLCollection(root_node, type, kDoesNotOverrideItemAfter) {}
+};
+
+DEFINE_TYPE_CASTS(AllDescendantsCollection,
+ LiveNodeListBase,
+ collection,
+ collection->GetType() == kAllDescendantsCollectionType,
+ collection.GetType() == kAllDescendantsCollectionType);
+
+} // namespace blink
+
+#endif // AllDescendantsCollection_h

Powered by Google App Engine
This is Rietveld 408576698