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 3192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3203 if (!m_player || !hasClosedCaptions()) | 3203 if (!m_player || !hasClosedCaptions()) |
3204 return; | 3204 return; |
3205 | 3205 |
3206 m_closedCaptionsVisible = closedCaptionVisible; | 3206 m_closedCaptionsVisible = closedCaptionVisible; |
3207 | 3207 |
3208 markCaptionAndSubtitleTracksAsUnconfigured(); | 3208 markCaptionAndSubtitleTracksAsUnconfigured(); |
3209 m_processingPreferenceChange = true; | 3209 m_processingPreferenceChange = true; |
3210 honorUserPreferencesForAutomaticTextTrackSelection(); | 3210 honorUserPreferencesForAutomaticTextTrackSelection(); |
3211 m_processingPreferenceChange = false; | 3211 m_processingPreferenceChange = false; |
3212 | 3212 |
| 3213 // As track visibility changed while m_processingPreferenceChange was set, |
| 3214 // there was no call to updateTextTrackDisplay(). This call is not in the |
| 3215 // spec, see the note in configureTextTrackDisplay(). |
3213 updateTextTrackDisplay(); | 3216 updateTextTrackDisplay(); |
3214 } | 3217 } |
3215 | 3218 |
3216 void HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured() | 3219 void HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured() |
3217 { | 3220 { |
3218 if (!m_textTracks) | 3221 if (!m_textTracks) |
3219 return; | 3222 return; |
3220 | 3223 |
3221 // Mark all tracks as not "configured" so that | 3224 // Mark all tracks as not "configured" so that |
3222 // honorUserPreferencesForAutomaticTextTrackSelection() will reconsider | 3225 // honorUserPreferencesForAutomaticTextTrackSelection() will reconsider |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3341 m_haveVisibleTextTrack = haveVisibleTextTrack; | 3344 m_haveVisibleTextTrack = haveVisibleTextTrack; |
3342 m_closedCaptionsVisible = m_haveVisibleTextTrack; | 3345 m_closedCaptionsVisible = m_haveVisibleTextTrack; |
3343 | 3346 |
3344 if (!m_haveVisibleTextTrack && !mediaControls()) | 3347 if (!m_haveVisibleTextTrack && !mediaControls()) |
3345 return; | 3348 return; |
3346 | 3349 |
3347 ensureMediaControls(); | 3350 ensureMediaControls(); |
3348 mediaControls()->changedClosedCaptionsVisibility(); | 3351 mediaControls()->changedClosedCaptionsVisibility(); |
3349 | 3352 |
3350 cueTimeline().updateActiveCues(currentTime()); | 3353 cueTimeline().updateActiveCues(currentTime()); |
| 3354 |
| 3355 // Note: The "time marches on" algorithm (updateActiveCues) runs the "rules |
| 3356 // for updating the text track rendering" (updateTextTrackDisplay) only for |
| 3357 // "affected tracks", i.e. tracks where the the active cues have changed. |
| 3358 // This misses cues in tracks that changed mode between hidden and showing. |
| 3359 // This appears to be a spec bug, which we work around here: |
| 3360 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=28236 |
3351 updateTextTrackDisplay(); | 3361 updateTextTrackDisplay(); |
3352 } | 3362 } |
3353 | 3363 |
3354 void* HTMLMediaElement::preDispatchEventHandler(Event* event) | 3364 void* HTMLMediaElement::preDispatchEventHandler(Event* event) |
3355 { | 3365 { |
3356 if (event && event->type() == EventTypeNames::webkitfullscreenchange) | 3366 if (event && event->type() == EventTypeNames::webkitfullscreenchange) |
3357 configureMediaControls(); | 3367 configureMediaControls(); |
3358 | 3368 |
3359 return nullptr; | 3369 return nullptr; |
3360 } | 3370 } |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3600 | 3610 |
3601 #if ENABLE(WEB_AUDIO) | 3611 #if ENABLE(WEB_AUDIO) |
3602 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) | 3612 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) |
3603 { | 3613 { |
3604 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider()) | 3614 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider()) |
3605 audioSourceProvider()->setClient(nullptr); | 3615 audioSourceProvider()->setClient(nullptr); |
3606 } | 3616 } |
3607 #endif | 3617 #endif |
3608 | 3618 |
3609 } | 3619 } |
OLD | NEW |