| Index: Source/core/html/MediaController.cpp
|
| diff --git a/Source/core/html/MediaController.cpp b/Source/core/html/MediaController.cpp
|
| index f8f7b132d517a843e923ef1c46c50b8417165df3..4e60eb9ab59c20dc808c40490b14bae0134145ee 100644
|
| --- a/Source/core/html/MediaController.cpp
|
| +++ b/Source/core/html/MediaController.cpp
|
| @@ -20,7 +20,7 @@
|
| * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
| * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| #include "config.h"
|
| @@ -92,8 +92,8 @@ PassRefPtr<TimeRanges> MediaController::buffered() const
|
| if (m_mediaElements.isEmpty())
|
| return TimeRanges::create();
|
|
|
| - // The buffered attribute must return a new static normalized TimeRanges object that represents
|
| - // the intersection of the ranges of the media resources of the slaved media elements that the
|
| + // The buffered attribute must return a new static normalized TimeRanges object that represents
|
| + // the intersection of the ranges of the media resources of the slaved media elements that the
|
| // user agent has buffered, at the time the attribute is evaluated.
|
| RefPtr<TimeRanges> bufferedRanges = m_mediaElements.first()->buffered();
|
| for (size_t index = 1; index < m_mediaElements.size(); ++index)
|
| @@ -120,8 +120,8 @@ PassRefPtr<TimeRanges> MediaController::played()
|
| if (m_mediaElements.isEmpty())
|
| return TimeRanges::create();
|
|
|
| - // The played attribute must return a new static normalized TimeRanges object that represents
|
| - // the union of the ranges of the media resources of the slaved media elements that the
|
| + // The played attribute must return a new static normalized TimeRanges object that represents
|
| + // the union of the ranges of the media resources of the slaved media elements that the
|
| // user agent has so far rendered, at the time the attribute is evaluated.
|
| RefPtr<TimeRanges> playedRanges = m_mediaElements.first()->played();
|
| for (size_t index = 1; index < m_mediaElements.size(); ++index)
|
| @@ -159,18 +159,18 @@ double MediaController::currentTime() const
|
|
|
| void MediaController::setCurrentTime(double time, ExceptionCode& ec)
|
| {
|
| - // When the user agent is to seek the media controller to a particular new playback position,
|
| + // When the user agent is to seek the media controller to a particular new playback position,
|
| // it must follow these steps:
|
| // If the new playback position is less than zero, then set it to zero.
|
| time = max(0.0, time);
|
| -
|
| - // If the new playback position is greater than the media controller duration, then set it
|
| +
|
| + // If the new playback position is greater than the media controller duration, then set it
|
| // to the media controller duration.
|
| time = min(time, duration());
|
| -
|
| +
|
| // Set the media controller position to the new playback position.
|
| m_clock->setCurrentTime(time);
|
| -
|
| +
|
| // Seek each slaved media element to the new playback position relative to the media element timeline.
|
| for (size_t index = 0; index < m_mediaElements.size(); ++index)
|
| m_mediaElements[index]->seek(time, ec);
|
| @@ -240,7 +240,7 @@ void MediaController::setPlaybackRate(double rate)
|
| if (m_clock->playRate() == rate)
|
| return;
|
|
|
| - // The playbackRate attribute, on setting, must set the MediaController's media controller
|
| + // The playbackRate attribute, on setting, must set the MediaController's media controller
|
| // playback rate to the new value,
|
| m_clock->setPlayRate(rate);
|
|
|
| @@ -256,13 +256,13 @@ void MediaController::setVolume(double level, ExceptionCode& ec)
|
| if (m_volume == level)
|
| return;
|
|
|
| - // If the new value is outside the range 0.0 to 1.0 inclusive, then, on setting, an
|
| + // If the new value is outside the range 0.0 to 1.0 inclusive, then, on setting, an
|
| // IndexSizeError exception must be raised instead.
|
| if (level < 0 || level > 1) {
|
| ec = IndexSizeError;
|
| return;
|
| }
|
| -
|
| +
|
| // The volume attribute, on setting, if the new value is in the range 0.0 to 1.0 inclusive,
|
| // must set the MediaController's media controller volume multiplier to the new value
|
| m_volume = level;
|
| @@ -352,7 +352,7 @@ void MediaController::updateReadyState()
|
| {
|
| ReadyState oldReadyState = m_readyState;
|
| ReadyState newReadyState;
|
| -
|
| +
|
| if (m_mediaElements.isEmpty()) {
|
| // If the MediaController has no slaved media elements, let new readiness state be 0.
|
| newReadyState = HAVE_NOTHING;
|
| @@ -364,10 +364,10 @@ void MediaController::updateReadyState()
|
| newReadyState = min(newReadyState, m_mediaElements[index]->readyState());
|
| }
|
|
|
| - if (newReadyState == oldReadyState)
|
| + if (newReadyState == oldReadyState)
|
| return;
|
|
|
| - // If the MediaController's most recently reported readiness state is greater than new readiness
|
| + // If the MediaController's most recently reported readiness state is greater than new readiness
|
| // state then queue a task to fire a simple event at the MediaController object, whose name is the
|
| // event name corresponding to the value of new readiness state given in the table below. [omitted]
|
| if (oldReadyState > newReadyState) {
|
| @@ -384,7 +384,7 @@ void MediaController::updateReadyState()
|
| nextState = static_cast<ReadyState>(nextState + 1);
|
| // 3. Queue a task to fire a simple event at the MediaController object, whose name is the
|
| // event name corresponding to the value of next state given in the table below. [omitted]
|
| - scheduleEvent(eventNameForReadyState(nextState));
|
| + scheduleEvent(eventNameForReadyState(nextState));
|
| // If next state is less than new readiness state, then return to the step labeled loop
|
| } while (nextState < newReadyState);
|
|
|
| @@ -397,7 +397,7 @@ void MediaController::updatePlaybackState()
|
| PlaybackState oldPlaybackState = m_playbackState;
|
| PlaybackState newPlaybackState;
|
|
|
| - // Initialize new playback state by setting it to the state given for the first matching
|
| + // Initialize new playback state by setting it to the state given for the first matching
|
| // condition from the following list:
|
| if (m_mediaElements.isEmpty()) {
|
| // If the MediaController has no slaved media elements
|
| @@ -424,9 +424,9 @@ void MediaController::updatePlaybackState()
|
|
|
| // and the new playback state is ended,
|
| if (newPlaybackState == ENDED) {
|
| - // then queue a task that, if the MediaController object is a playing media controller, and
|
| - // all of the MediaController's slaved media elements have still ended playback, and the
|
| - // media controller playback rate is still positive or zero,
|
| + // then queue a task that, if the MediaController object is a playing media controller, and
|
| + // all of the MediaController's slaved media elements have still ended playback, and the
|
| + // media controller playback rate is still positive or zero,
|
| if (!m_paused && hasEnded()) {
|
| // changes the MediaController object to a paused media controller
|
| m_paused = true;
|
| @@ -437,7 +437,7 @@ void MediaController::updatePlaybackState()
|
| }
|
|
|
| // If the MediaController's most recently reported playback state is not equal to new playback state
|
| - // then queue a task to fire a simple event at the MediaController object, whose name is playing
|
| + // then queue a task to fire a simple event at the MediaController object, whose name is playing
|
| // if new playback state is playing, ended if new playback state is ended, and waiting otherwise.
|
| AtomicString eventName;
|
| switch (newPlaybackState) {
|
| @@ -486,30 +486,30 @@ void MediaController::bringElementUpToSpeed(HTMLMediaElement* element)
|
|
|
| bool MediaController::isBlocked() const
|
| {
|
| - // A MediaController is a blocked media controller if the MediaController is a paused media
|
| + // A MediaController is a blocked media controller if the MediaController is a paused media
|
| // controller,
|
| if (m_paused)
|
| return true;
|
| -
|
| +
|
| if (m_mediaElements.isEmpty())
|
| return false;
|
| -
|
| +
|
| bool allPaused = true;
|
| for (size_t index = 0; index < m_mediaElements.size(); ++index) {
|
| HTMLMediaElement* element = m_mediaElements[index];
|
| // or if any of its slaved media elements are blocked media elements,
|
| if (element->isBlocked())
|
| return true;
|
| -
|
| - // or if any of its slaved media elements whose autoplaying flag is true still have their
|
| +
|
| + // or if any of its slaved media elements whose autoplaying flag is true still have their
|
| // paused attribute set to true,
|
| if (element->isAutoplaying() && element->paused())
|
| return true;
|
| -
|
| +
|
| if (!element->paused())
|
| allPaused = false;
|
| }
|
| -
|
| +
|
| // or if all of its slaved media elements have their paused attribute set to true.
|
| return allPaused;
|
| }
|
| @@ -524,7 +524,7 @@ bool MediaController::hasEnded() const
|
| // playback state be ended.
|
| if (m_mediaElements.isEmpty())
|
| return false;
|
| -
|
| +
|
| bool allHaveEnded = true;
|
| for (size_t index = 0; index < m_mediaElements.size(); ++index) {
|
| if (!m_mediaElements[index]->ended())
|
|
|