Lines Matching refs:track

27 #include "core/html/track/TextTrackList.h"
32 #include "core/html/track/InbandTextTrack.h"
33 #include "core/html/track/LoadableTextTrack.h"
34 #include "core/html/track/TextTrack.h"
35 #include "core/html/track/TrackEvent.h"
84 // Calculate the "Let n be the number of text tracks whose text track mode is showing and that are in the media element's list of text tracks before track."
121 // 4.8.10.12.1 Text track model
123 // 1. The text tracks corresponding to track element children of the media element, in tree order.
144 // 4.8.10.12.5 Text track API
149 TextTrack* track = item(i);
150 if (track->id() == id)
151 return track;
158 void TextTrackList::invalidateTrackIndexesAfterTrack(TextTrack* track)
162 if (track->trackType() == TextTrack::TrackElement) {
168 } else if (track->trackType() == TextTrack::AddTrack) {
172 } else if (track->trackType() == TextTrack::InBand) {
178 size_t index = tracks->find(track);
188 RefPtrWillBeRawPtr<TextTrack> track = prpTrack;
190 if (track->trackType() == TextTrack::AddTrack) {
191 m_addTrackTracks.append(track);
192 } else if (track->trackType() == TextTrack::TrackElement) {
193 // Insert tracks added for <track> element in tree order.
194 size_t index = static_cast<LoadableTextTrack*>(track.get())->trackElementIndex();
195 m_elementTracks.insert(index, track);
196 } else if (track->trackType() == TextTrack::InBand) {
198 size_t index = static_cast<InbandTextTrack*>(track.get())->inbandTrackIndex();
199 m_inbandTracks.insert(index, track);
204 invalidateTrackIndexesAfterTrack(track.get());
206 ASSERT(!track->trackList());
207 track->setTrackList(this);
209 scheduleAddTrackEvent(track.release());
212 void TextTrackList::remove(TextTrack* track)
216 if (track->trackType() == TextTrack::TrackElement) {
218 } else if (track->trackType() == TextTrack::AddTrack) {
220 } else if (track->trackType() == TextTrack::InBand) {
226 size_t index = tracks->find(track);
230 invalidateTrackIndexesAfterTrack(track);
232 ASSERT(track->trackList() == this);
233 track->setTrackList(0);
237 scheduleRemoveTrackEvent(track);
248 bool TextTrackList::contains(TextTrack* track) const
252 if (track->trackType() == TextTrack::TrackElement)
254 else if (track->trackType() == TextTrack::AddTrack)
256 else if (track->trackType() == TextTrack::InBand)
261 return tracks->find(track) != kNotFound;
281 void TextTrackList::scheduleTrackEvent(const AtomicString& eventName, PassRefPtrWillBeRawPtr<TextTrack> track)
284 initializer.track = track;
291 void TextTrackList::scheduleAddTrackEvent(PassRefPtrWillBeRawPtr<TextTrack> track)
294 // 4.8.10.12.4 Text track API
297 // the track attribute initialized to the text track's TextTrack object, at
299 scheduleTrackEvent(EventTypeNames::addtrack, track);
304 // 4.8.10.12.1 Text track model
305 // Whenever a text track that is in a media element's list of text tracks
306 // has its text track mode change value, the user agent must run the
315 void TextTrackList::scheduleRemoveTrackEvent(PassRefPtrWillBeRawPtr<TextTrack> track)
318 // When a track element's parent element changes and the old parent was a
319 // media element, then the user agent must remove the track element's
320 // corresponding text track from the media element's list of text tracks,
323 // interface, with the track attribute initialized to the text track's
326 scheduleTrackEvent(EventTypeNames::removetrack, track);