| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 185 |
| 186 TextTrackCueList* TextTrack::cues() | 186 TextTrackCueList* TextTrack::cues() |
| 187 { | 187 { |
| 188 // 4.8.10.12.5 If the text track mode ... is not the text track disabled mod
e, | 188 // 4.8.10.12.5 If the text track mode ... is not the text track disabled mod
e, |
| 189 // then the cues attribute must return a live TextTrackCueList object ... | 189 // then the cues attribute must return a live TextTrackCueList object ... |
| 190 // Otherwise, it must return null. When an object is returned, the | 190 // Otherwise, it must return null. When an object is returned, the |
| 191 // same object must be returned each time. | 191 // same object must be returned each time. |
| 192 // http://www.whatwg.org/specs/web-apps/current-work/#dom-texttrack-cues | 192 // http://www.whatwg.org/specs/web-apps/current-work/#dom-texttrack-cues |
| 193 if (m_mode != disabledKeyword()) | 193 if (m_mode != disabledKeyword()) |
| 194 return ensureTextTrackCueList(); | 194 return ensureTextTrackCueList(); |
| 195 return 0; | 195 return nullptr; |
| 196 } | 196 } |
| 197 | 197 |
| 198 void TextTrack::removeAllCues() | 198 void TextTrack::removeAllCues() |
| 199 { | 199 { |
| 200 if (!m_cues) | 200 if (!m_cues) |
| 201 return; | 201 return; |
| 202 | 202 |
| 203 if (mediaElement()) | 203 if (mediaElement()) |
| 204 mediaElement()->textTrackRemoveCues(this, m_cues.get()); | 204 mediaElement()->textTrackRemoveCues(this, m_cues.get()); |
| 205 | 205 |
| 206 for (size_t i = 0; i < m_cues->length(); ++i) | 206 for (size_t i = 0; i < m_cues->length(); ++i) |
| 207 m_cues->item(i)->setTrack(0); | 207 m_cues->item(i)->setTrack(0); |
| 208 | 208 |
| 209 m_cues = nullptr; | 209 m_cues = nullptr; |
| 210 } | 210 } |
| 211 | 211 |
| 212 TextTrackCueList* TextTrack::activeCues() const | 212 TextTrackCueList* TextTrack::activeCues() const |
| 213 { | 213 { |
| 214 // 4.8.10.12.5 If the text track mode ... is not the text track disabled mod
e, | 214 // 4.8.10.12.5 If the text track mode ... is not the text track disabled mod
e, |
| 215 // then the activeCues attribute must return a live TextTrackCueList object
... | 215 // then the activeCues attribute must return a live TextTrackCueList object
... |
| 216 // ... whose active flag was set when the script started, in text track cue | 216 // ... whose active flag was set when the script started, in text track cue |
| 217 // order. Otherwise, it must return null. When an object is returned, the | 217 // order. Otherwise, it must return null. When an object is returned, the |
| 218 // same object must be returned each time. | 218 // same object must be returned each time. |
| 219 // http://www.whatwg.org/specs/web-apps/current-work/#dom-texttrack-activecu
es | 219 // http://www.whatwg.org/specs/web-apps/current-work/#dom-texttrack-activecu
es |
| 220 if (m_cues && m_mode != disabledKeyword()) | 220 if (m_cues && m_mode != disabledKeyword()) |
| 221 return m_cues->activeCues(); | 221 return m_cues->activeCues(); |
| 222 return 0; | 222 return nullptr; |
| 223 } | 223 } |
| 224 | 224 |
| 225 void TextTrack::addCue(PassRefPtrWillBeRawPtr<TextTrackCue> prpCue) | 225 void TextTrack::addCue(PassRefPtrWillBeRawPtr<TextTrackCue> prpCue) |
| 226 { | 226 { |
| 227 if (!prpCue) | 227 if (!prpCue) |
| 228 return; | 228 return; |
| 229 | 229 |
| 230 RefPtrWillBeRawPtr<TextTrackCue> cue = prpCue; | 230 RefPtrWillBeRawPtr<TextTrackCue> cue = prpCue; |
| 231 | 231 |
| 232 // TODO(93143): Add spec-compliant behavior for negative time values. | 232 // TODO(93143): Add spec-compliant behavior for negative time values. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 VTTRegionList* TextTrack::regions() | 289 VTTRegionList* TextTrack::regions() |
| 290 { | 290 { |
| 291 // If the text track mode of the text track that the TextTrack object | 291 // If the text track mode of the text track that the TextTrack object |
| 292 // represents is not the text track disabled mode, then the regions | 292 // represents is not the text track disabled mode, then the regions |
| 293 // attribute must return a live VTTRegionList object that represents | 293 // attribute must return a live VTTRegionList object that represents |
| 294 // the text track list of regions of the text track. Otherwise, it must | 294 // the text track list of regions of the text track. Otherwise, it must |
| 295 // return null. When an object is returned, the same object must be returned | 295 // return null. When an object is returned, the same object must be returned |
| 296 // each time. | 296 // each time. |
| 297 if (RuntimeEnabledFeatures::webVTTRegionsEnabled() && m_mode != disabledKeyw
ord()) | 297 if (RuntimeEnabledFeatures::webVTTRegionsEnabled() && m_mode != disabledKeyw
ord()) |
| 298 return ensureVTTRegionList(); | 298 return ensureVTTRegionList(); |
| 299 return 0; | 299 return nullptr; |
| 300 } | 300 } |
| 301 | 301 |
| 302 void TextTrack::addRegion(PassRefPtrWillBeRawPtr<VTTRegion> prpRegion) | 302 void TextTrack::addRegion(PassRefPtrWillBeRawPtr<VTTRegion> prpRegion) |
| 303 { | 303 { |
| 304 if (!prpRegion) | 304 if (!prpRegion) |
| 305 return; | 305 return; |
| 306 | 306 |
| 307 RefPtrWillBeRawPtr<VTTRegion> region = prpRegion; | 307 RefPtrWillBeRawPtr<VTTRegion> region = prpRegion; |
| 308 VTTRegionList* regionList = ensureVTTRegionList(); | 308 VTTRegionList* regionList = ensureVTTRegionList(); |
| 309 | 309 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 void TextTrack::trace(Visitor* visitor) | 440 void TextTrack::trace(Visitor* visitor) |
| 441 { | 441 { |
| 442 visitor->trace(m_cues); | 442 visitor->trace(m_cues); |
| 443 visitor->trace(m_regions); | 443 visitor->trace(m_regions); |
| 444 visitor->trace(m_trackList); | 444 visitor->trace(m_trackList); |
| 445 TrackBase::trace(visitor); | 445 TrackBase::trace(visitor); |
| 446 EventTargetWithInlineData::trace(visitor); | 446 EventTargetWithInlineData::trace(visitor); |
| 447 } | 447 } |
| 448 | 448 |
| 449 } // namespace blink | 449 } // namespace blink |
| OLD | NEW |