OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/html/track/CueTimeline.h" | 6 #include "core/html/track/CueTimeline.h" |
7 | 7 |
8 #include "core/events/Event.h" | 8 #include "core/events/Event.h" |
9 #include "core/html/HTMLMediaElement.h" | 9 #include "core/html/HTMLMediaElement.h" |
10 #include "core/html/HTMLTrackElement.h" | 10 #include "core/html/HTMLTrackElement.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 // 4.8.10.8 Playing the media resource | 125 // 4.8.10.8 Playing the media resource |
126 | 126 |
127 // If the current playback position changes while the steps are running, | 127 // If the current playback position changes while the steps are running, |
128 // then the user agent must wait for the steps to complete, and then must | 128 // then the user agent must wait for the steps to complete, and then must |
129 // immediately rerun the steps. | 129 // immediately rerun the steps. |
130 if (ignoreUpdateRequests()) | 130 if (ignoreUpdateRequests()) |
131 return; | 131 return; |
132 | 132 |
133 HTMLMediaElement& mediaElement = this->mediaElement(); | 133 HTMLMediaElement& mediaElement = this->mediaElement(); |
134 | 134 |
135 // Don't run the "time marches on" algorithm if the document has been | |
136 // detached. This primarily guards against dispatch of events w/ | |
137 // HTMLTrackElement targets. | |
138 if (mediaElement.document().isDetached()) | |
philipj_slow
2015/08/12 07:39:33
Do you think we should make if conditional on !OIL
fs
2015/08/12 07:55:45
I've been pondering whether the (somewhat similar)
| |
139 return; | |
140 | |
135 // https://html.spec.whatwg.org/#time-marches-on | 141 // https://html.spec.whatwg.org/#time-marches-on |
136 | 142 |
137 // 1 - Let current cues be a list of cues, initialized to contain all the | 143 // 1 - Let current cues be a list of cues, initialized to contain all the |
138 // cues of all the hidden, showing, or showing by default text tracks of the | 144 // cues of all the hidden, showing, or showing by default text tracks of the |
139 // media element (not the disabled ones) whose start times are less than or | 145 // media element (not the disabled ones) whose start times are less than or |
140 // equal to the current playback position and whose end times are greater | 146 // equal to the current playback position and whose end times are greater |
141 // than the current playback position. | 147 // than the current playback position. |
142 CueList currentCues; | 148 CueList currentCues; |
143 | 149 |
144 // The user agent must synchronously unset [the text track cue active] flag | 150 // The user agent must synchronously unset [the text track cue active] flag |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
351 if (!m_ignoreUpdate && mediaElement().inActiveDocument()) | 357 if (!m_ignoreUpdate && mediaElement().inActiveDocument()) |
352 updateActiveCues(mediaElement().currentTime()); | 358 updateActiveCues(mediaElement().currentTime()); |
353 } | 359 } |
354 | 360 |
355 DEFINE_TRACE(CueTimeline) | 361 DEFINE_TRACE(CueTimeline) |
356 { | 362 { |
357 visitor->trace(m_mediaElement); | 363 visitor->trace(m_mediaElement); |
358 } | 364 } |
359 | 365 |
360 } // namespace blink | 366 } // namespace blink |
OLD | NEW |