OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 203 |
204 if (cueTimeline()) | 204 if (cueTimeline()) |
205 cueTimeline()->removeCues(this, m_cues.get()); | 205 cueTimeline()->removeCues(this, m_cues.get()); |
206 | 206 |
207 for (size_t i = 0; i < m_cues->length(); ++i) | 207 for (size_t i = 0; i < m_cues->length(); ++i) |
208 m_cues->item(i)->setTrack(0); | 208 m_cues->item(i)->setTrack(0); |
209 | 209 |
210 m_cues = nullptr; | 210 m_cues = nullptr; |
211 } | 211 } |
212 | 212 |
| 213 void TextTrack::addListOfCues(WillBeHeapVector<RefPtrWillBeMember<TextTrackCue>>
& listOfNewCues) |
| 214 { |
| 215 TextTrackCueList* cues = ensureTextTrackCueList(); |
| 216 |
| 217 for (auto& newCue : listOfNewCues) { |
| 218 newCue->setTrack(this); |
| 219 cues->add(newCue.release()); |
| 220 } |
| 221 |
| 222 if (cueTimeline() && mode() != disabledKeyword()) |
| 223 cueTimeline()->addCues(this, cues); |
| 224 } |
| 225 |
213 TextTrackCueList* TextTrack::activeCues() const | 226 TextTrackCueList* TextTrack::activeCues() const |
214 { | 227 { |
215 // 4.8.10.12.5 If the text track mode ... is not the text track disabled mod
e, | 228 // 4.8.10.12.5 If the text track mode ... is not the text track disabled mod
e, |
216 // then the activeCues attribute must return a live TextTrackCueList object
... | 229 // then the activeCues attribute must return a live TextTrackCueList object
... |
217 // ... whose active flag was set when the script started, in text track cue | 230 // ... whose active flag was set when the script started, in text track cue |
218 // order. Otherwise, it must return null. When an object is returned, the | 231 // order. Otherwise, it must return null. When an object is returned, the |
219 // same object must be returned each time. | 232 // same object must be returned each time. |
220 // http://www.whatwg.org/specs/web-apps/current-work/#dom-texttrack-activecu
es | 233 // http://www.whatwg.org/specs/web-apps/current-work/#dom-texttrack-activecu
es |
221 if (m_cues && m_mode != disabledKeyword()) | 234 if (m_cues && m_mode != disabledKeyword()) |
222 return m_cues->activeCues(); | 235 return m_cues->activeCues(); |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 DEFINE_TRACE(TextTrack) | 462 DEFINE_TRACE(TextTrack) |
450 { | 463 { |
451 visitor->trace(m_cues); | 464 visitor->trace(m_cues); |
452 visitor->trace(m_regions); | 465 visitor->trace(m_regions); |
453 visitor->trace(m_trackList); | 466 visitor->trace(m_trackList); |
454 TrackBase::trace(visitor); | 467 TrackBase::trace(visitor); |
455 EventTargetWithInlineData::trace(visitor); | 468 EventTargetWithInlineData::trace(visitor); |
456 } | 469 } |
457 | 470 |
458 } // namespace blink | 471 } // namespace blink |
OLD | NEW |