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

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

Issue 305963014: Introduce and use type casting functions for several HTMLCollection types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
« no previous file with comments | « Source/core/html/HTMLAllCollection.cpp ('k') | Source/core/html/HTMLFormControlsCollection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLCollection.cpp
diff --git a/Source/core/html/HTMLCollection.cpp b/Source/core/html/HTMLCollection.cpp
index 79bb5313c1683fd942be761d22b421a8b4c591e2..61c63c894218c6f3443aa8d4c4fa0e37d352e18a 100644
--- a/Source/core/html/HTMLCollection.cpp
+++ b/Source/core/html/HTMLCollection.cpp
@@ -201,11 +201,11 @@ template <> inline bool isMatchingElement(const HTMLCollection& htmlCollection,
case NodeChildren:
return true;
case ClassCollectionType:
- return static_cast<const ClassCollection&>(htmlCollection).elementMatches(element);
+ return toClassCollection(htmlCollection).elementMatches(element);
case TagCollectionType:
- return static_cast<const TagCollection&>(htmlCollection).elementMatches(element);
+ return toTagCollection(htmlCollection).elementMatches(element);
case HTMLTagCollectionType:
- return static_cast<const HTMLTagCollection&>(htmlCollection).elementMatches(element);
+ return toHTMLTagCollection(htmlCollection).elementMatches(element);
default:
break;
}
@@ -339,9 +339,9 @@ Element* HTMLCollection::traverseToFirstElement() const
{
switch (type()) {
case HTMLTagCollectionType:
- return firstMatchingElement(static_cast<const HTMLTagCollection&>(*this));
+ return firstMatchingElement(toHTMLTagCollection(*this));
case ClassCollectionType:
- return firstMatchingElement(static_cast<const ClassCollection&>(*this));
+ return firstMatchingElement(toClassCollection(*this));
default:
if (overridesItemAfter())
return virtualItemAfter(0);
@@ -373,9 +373,9 @@ Element* HTMLCollection::traverseForwardToOffset(unsigned offset, Element& curre
ASSERT(currentOffset < offset);
switch (type()) {
case HTMLTagCollectionType:
- return traverseMatchingElementsForwardToOffset(static_cast<const HTMLTagCollection&>(*this), offset, currentElement, currentOffset);
+ return traverseMatchingElementsForwardToOffset(toHTMLTagCollection(*this), offset, currentElement, currentOffset);
case ClassCollectionType:
- return traverseMatchingElementsForwardToOffset(static_cast<const ClassCollection&>(*this), offset, currentElement, currentOffset);
+ return traverseMatchingElementsForwardToOffset(toClassCollection(*this), offset, currentElement, currentOffset);
default:
if (overridesItemAfter()) {
Element* next = &currentElement;
« no previous file with comments | « Source/core/html/HTMLAllCollection.cpp ('k') | Source/core/html/HTMLFormControlsCollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698