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 = ¤tElement; |