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

Unified Diff: third_party/WebKit/Source/core/html/HTMLCollection.cpp

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/html/HTMLCollection.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLCollection.cpp b/third_party/WebKit/Source/core/html/HTMLCollection.cpp
index 07c45002b58c5edc4b4eccf1abc447680d52ce41..4a5dec9f0d03dc2a8f24df0a5cfb6736273abfb9 100644
--- a/third_party/WebKit/Source/core/html/HTMLCollection.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLCollection.cpp
@@ -24,6 +24,7 @@
#include "core/html/HTMLCollection.h"
#include "core/HTMLNames.h"
+#include "core/dom/AllDescendantsCollection.h"
#include "core/dom/ClassCollection.h"
#include "core/dom/ElementTraversal.h"
#include "core/dom/NodeRareData.h"
@@ -46,7 +47,9 @@ static bool ShouldTypeOnlyIncludeDirectChildren(CollectionType type) {
switch (type) {
case kClassCollectionType:
case kTagCollectionType:
+ case kTagCollectionNSType:
case kHTMLTagCollectionType:
+ case kAllDescendantsCollectionType:
case kDocAll:
case kDocAnchors:
case kDocApplets:
@@ -95,7 +98,9 @@ static NodeListRootType RootTypeFromCollectionType(const ContainerNode& owner,
return NodeListRootType::kTreeScope;
case kClassCollectionType:
case kTagCollectionType:
+ case kTagCollectionNSType:
case kHTMLTagCollectionType:
+ case kAllDescendantsCollectionType:
case kNodeChildren:
case kTableTBodies:
case kTSectionRows:
@@ -125,7 +130,9 @@ static NodeListInvalidationType InvalidationTypeExcludingIdAndNameAttributes(
CollectionType type) {
switch (type) {
case kTagCollectionType:
+ case kTagCollectionNSType:
case kHTMLTagCollectionType:
+ case kAllDescendantsCollectionType:
case kDocImages:
case kDocEmbeds:
case kDocForms:
@@ -244,7 +251,9 @@ static inline bool IsMatchingHTMLElement(const HTMLCollection& html_collection,
return isHTMLObjectElement(element) || IsHTMLFormControlElement(element);
case kClassCollectionType:
case kTagCollectionType:
+ case kTagCollectionNSType:
case kHTMLTagCollectionType:
+ case kAllDescendantsCollectionType:
case kDocAll:
case kNodeChildren:
case kTableRows:
@@ -270,6 +279,10 @@ inline bool HTMLCollection::ElementMatches(const Element& element) const {
return ToTagCollection(*this).ElementMatches(element);
case kHTMLTagCollectionType:
return ToHTMLTagCollection(*this).ElementMatches(element);
+ case kTagCollectionNSType:
+ return ToTagCollectionNS(*this).ElementMatches(element);
+ case kAllDescendantsCollectionType:
+ return ToAllDescendantsCollection(*this).ElementMatches(element);
case kWindowNamedItems:
return ToWindowNameCollection(*this).ElementMatches(element);
default:

Powered by Google App Engine
This is Rietveld 408576698