[Track] Closed Caption button shouldn't be visible if all the track resources have...
authorvcarbune@chromium.org <vcarbune@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Feb 2013 04:03:04 +0000 (04:03 +0000)
committervcarbune@chromium.org <vcarbune@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Feb 2013 04:03:04 +0000 (04:03 +0000)
commit4076a16db1b63b2fb3c36c0aac266ba89961a83e
tree8a0b782d76a75c2e4fb93e75563ae90ecad95edb
parent66eb4c0fc498c2f4a93ba922c87ef5bb904c1602
[Track] Closed Caption button shouldn't be visible if all the track resources have failed loading
https://bugs.webkit.org/show_bug.cgi?id=106285

Reviewed by Eric Carlson.

Source/WebCore:

Updated existing test cases.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::textTracksAreReady): Checked whether there are tracks not loaded
when the algorithm began.
(WebCore::HTMLMediaElement::textTrackReadyStateChanged): If the ready state changed to
FailedToLoad the media controls should check whether there are other caption tracks
and hide the button if not.
(WebCore::HTMLMediaElement::didAddTrack): Added trigger to closedCaptionsTrackChanged.
(WebCore::HTMLMediaElement::hasClosedCaptions): Updated check to skip tracks that
failed to load.
* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::reset): Used the newly added method.
(WebCore::MediaControls::refreshClosedCaptionsButtonVisibility): Added container method for
default behaviour for refreshing the visibility of the caption button.
(WebCore::MediaControls::closedCaptionTracksChanged): Used the newly added method.
(WebCore):
* html/shadow/MediaControls.h:
(MediaControls):

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::textTracksAreReady):
(WebCore::HTMLMediaElement::textTrackReadyStateChanged):
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::didAddTrack):
(WebCore::HTMLMediaElement::hasClosedCaptions):
* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::reset):
(WebCore::MediaControls::refreshClosedCaptionsButtonVisibility):
(WebCore::MediaControls::closedCaptionTracksChanged):
(WebCore):
* html/shadow/MediaControls.h:
(MediaControls):

LayoutTests:

Updated tests to include improved behavior.

* media/video-controls-captions-expected.txt: Updated.
* media/video-controls-captions.html: Updated.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@141531 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/media/video-controls-captions-expected.txt
LayoutTests/media/video-controls-captions.html
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/shadow/MediaControls.cpp
Source/WebCore/html/shadow/MediaControls.h