Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0cfd238e978672f45c8c2070725693aa01a5041f
https://github.com/WebKit/WebKit/commit/0cfd238e978672f45c8c2070725693aa01a5041f
Author: Ahmad Saleem <[email protected]>
Date: 2026-07-06 (Mon, 06 Jul 2026)
Changed paths:
M Source/WebCore/html/track/TextTrackList.cpp
Log Message:
-----------
TextTrackList::invalidateTrackIndexesAfterTrack only invalidates the first
track's index
https://bugs.webkit.org/show_bug.cgi?id=318198
rdar://181003146
Reviewed by Brent Fulgham.
invalidateTrackIndexesAfterTrack() is meant to clear the cached index of
the given track and every track following it, since inserting or removing
a track shifts all subsequent positions. The loop advanced its counter
from the found index to the end of the vector, but the body indexed with
the loop-invariant `index` instead of the loop variable, so it repeatedly
invalidated only the first track and left every following track with a
stale cached index.
Fix the indexing, and while here rewrite the loop as a range-for over
Vector::subspan(index) to remove the manual counter.
* Source/WebCore/html/track/TextTrackList.cpp:
(WebCore::TextTrackList::invalidateTrackIndexesAfterTrack):
Canonical link: https://commits.webkit.org/316577@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications