Index: Source/core/html/track/LoadableTextTrack.cpp |
diff --git a/Source/core/html/track/LoadableTextTrack.cpp b/Source/core/html/track/LoadableTextTrack.cpp |
index dd692848f1118ffa4a7164944fd5548c28c2a8a7..247330c0d727c48dde20c5ec510482edabc0d45c 100644 |
--- a/Source/core/html/track/LoadableTextTrack.cpp |
+++ b/Source/core/html/track/LoadableTextTrack.cpp |
@@ -155,10 +155,10 @@ size_t LoadableTextTrack::trackElementIndex() |
ASSERT(m_trackElement->parentNode()); |
size_t index = 0; |
- for (Element* child = ElementTraversal::firstWithin(*m_trackElement->parentNode()); child; child = ElementTraversal::nextSibling(*child)) { |
- if (!child->hasTagName(trackTag) || !child->parentNode()) |
+ for (HTMLTrackElement* track = Traversal<HTMLTrackElement>::firstChild(*m_trackElement->parentNode()); track; track = Traversal<HTMLTrackElement>::nextSibling(*track)) { |
+ if (!track->parentNode()) |
continue; |
- if (child == m_trackElement) |
+ if (track == m_trackElement) |
return index; |
++index; |
} |