| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1311 void HTMLMediaElement::textTrackRemoveCue(TextTrack*, PassRefPtr<TextTrackCue> c
ue) | 1311 void HTMLMediaElement::textTrackRemoveCue(TextTrack*, PassRefPtr<TextTrackCue> c
ue) |
| 1312 { | 1312 { |
| 1313 // Negative duration cues need to be treated in the interval tree as | 1313 // Negative duration cues need to be treated in the interval tree as |
| 1314 // zero-length cues. | 1314 // zero-length cues. |
| 1315 double endTime = max(cue->startTime(), cue->endTime()); | 1315 double endTime = max(cue->startTime(), cue->endTime()); |
| 1316 | 1316 |
| 1317 CueInterval interval = m_cueTree.createInterval(cue->startTime(), endTime, c
ue.get()); | 1317 CueInterval interval = m_cueTree.createInterval(cue->startTime(), endTime, c
ue.get()); |
| 1318 m_cueTree.remove(interval); | 1318 m_cueTree.remove(interval); |
| 1319 | 1319 |
| 1320 size_t index = m_currentlyActiveCues.find(interval); | 1320 size_t index = m_currentlyActiveCues.find(interval); |
| 1321 if (index != notFound) { | 1321 if (index != kNotFound) { |
| 1322 m_currentlyActiveCues.remove(index); | 1322 m_currentlyActiveCues.remove(index); |
| 1323 cue->setIsActive(false); | 1323 cue->setIsActive(false); |
| 1324 } | 1324 } |
| 1325 | 1325 |
| 1326 cue->removeDisplayTree(); | 1326 cue->removeDisplayTree(); |
| 1327 updateActiveTextTrackCues(currentTime()); | 1327 updateActiveTextTrackCues(currentTime()); |
| 1328 } | 1328 } |
| 1329 | 1329 |
| 1330 | 1330 |
| 1331 bool HTMLMediaElement::isSafeToLoadURL(const KURL& url, InvalidURLAction actionI
fInvalid) | 1331 bool HTMLMediaElement::isSafeToLoadURL(const KURL& url, InvalidURLAction actionI
fInvalid) |
| (...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2709 if (!m_textTracks) | 2709 if (!m_textTracks) |
| 2710 return; | 2710 return; |
| 2711 | 2711 |
| 2712 // 4.8.10.12.3 Sourcing out-of-band text tracks | 2712 // 4.8.10.12.3 Sourcing out-of-band text tracks |
| 2713 // When a track element's parent element changes and the old parent was a me
dia element, | 2713 // When a track element's parent element changes and the old parent was a me
dia element, |
| 2714 // then the user agent must remove the track element's corresponding text tr
ack from the | 2714 // then the user agent must remove the track element's corresponding text tr
ack from the |
| 2715 // media element's list of text tracks. | 2715 // media element's list of text tracks. |
| 2716 removeTrack(textTrack.get()); | 2716 removeTrack(textTrack.get()); |
| 2717 | 2717 |
| 2718 size_t index = m_textTracksWhenResourceSelectionBegan.find(textTrack.get()); | 2718 size_t index = m_textTracksWhenResourceSelectionBegan.find(textTrack.get()); |
| 2719 if (index != notFound) | 2719 if (index != kNotFound) |
| 2720 m_textTracksWhenResourceSelectionBegan.remove(index); | 2720 m_textTracksWhenResourceSelectionBegan.remove(index); |
| 2721 } | 2721 } |
| 2722 | 2722 |
| 2723 static int textTrackLanguageSelectionScore(const TextTrack& track) | 2723 static int textTrackLanguageSelectionScore(const TextTrack& track) |
| 2724 { | 2724 { |
| 2725 if (track.language().isEmpty()) | 2725 if (track.language().isEmpty()) |
| 2726 return 0; | 2726 return 0; |
| 2727 | 2727 |
| 2728 Vector<String> languages = userPreferredLanguages(); | 2728 Vector<String> languages = userPreferredLanguages(); |
| 2729 size_t languageMatchIndex = indexOfBestMatchingLanguageInList(track.language
(), languages); | 2729 size_t languageMatchIndex = indexOfBestMatchingLanguageInList(track.language
(), languages); |
| (...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3996 { | 3996 { |
| 3997 m_restrictions = NoRestrictions; | 3997 m_restrictions = NoRestrictions; |
| 3998 } | 3998 } |
| 3999 | 3999 |
| 4000 void HTMLMediaElement::mediaPlayerScheduleLayerUpdate() | 4000 void HTMLMediaElement::mediaPlayerScheduleLayerUpdate() |
| 4001 { | 4001 { |
| 4002 scheduleLayerUpdate(); | 4002 scheduleLayerUpdate(); |
| 4003 } | 4003 } |
| 4004 | 4004 |
| 4005 } | 4005 } |
| OLD | NEW |