Move readyState from TextTrack to HTMLTrackElement
authorannacc@chromium.org <annacc@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Nov 2011 09:25:39 +0000 (09:25 +0000)
committerannacc@chromium.org <annacc@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Nov 2011 09:25:39 +0000 (09:25 +0000)
commit0ca5d64afeb224e3f73e9ed871bd99c9517b155f
tree56c8c92e2f0e5af1f213c9e8627a6a8d9c4de5f5
parent4e919d54fc9f0f5b941e18b71b074f4dbb402516
Move readyState from TextTrack to HTMLTrackElement
https://bugs.webkit.org/show_bug.cgi?id=72553

Reviewed by Eric Carlson.

Source/WebCore:

* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::HTMLTrackElement):
    Set initial readyState to NONE.
(WebCore::HTMLTrackElement::didCompleteLoad):
    Set readyState based on load completed status.
(WebCore::HTMLTrackElement::setReadyState):
    This replaces textTrackReadyStateChanged() because only LoadableTextTrack
    needs to notify HTMLTrackElement of readyState changes (i.e.
    textTrackReadyStateChanged() is no longer required of TextTrackClient).
* html/HTMLTrackElement.h:
    ReadyState enum and m_readyState member variable moved from TextTrack.
(WebCore::HTMLTrackElement::readyState):
    New: readyState() getter.
* html/HTMLTrackElement.idl:
    Add readyState attribute and associated constants.

* html/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::loadTimerFired): Set readyState on HTMLTrackElement.
(WebCore::LoadableTextTrack::cueLoadingStarted): Ditto.
(WebCore::LoadableTextTrack::cueLoadingCompleted): Move code to set readyState
    to HTMLTrackElement (it can set it based on loading status).

* html/TextTrack.cpp: Remove readyState from TextTrack.
(WebCore::TextTrack::TextTrack): Ditto.
* html/TextTrack.h: Ditto.
* html/TextTrack.idl: Ditto.

LayoutTests:

* media/track/track-add-track-expected.txt:
* media/track/track-add-track.html:
* media/track/track-constants-expected.txt:
* media/track/track-constants.html:
* media/track/track-load-error-readyState-expected.txt:
* media/track/track-load-error-readyState.html:
* media/track/track-load-from-element-readyState-expected.txt:
* media/track/track-load-from-element-readyState.html:
* media/track/track-load-from-src-readyState-expected.txt:
* media/track/track-load-from-src-readyState.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@101057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/media/track/track-add-track-expected.txt
LayoutTests/media/track/track-add-track.html
LayoutTests/media/track/track-constants-expected.txt
LayoutTests/media/track/track-constants.html
LayoutTests/media/track/track-load-error-readyState-expected.txt
LayoutTests/media/track/track-load-error-readyState.html
LayoutTests/media/track/track-load-from-element-readyState-expected.txt
LayoutTests/media/track/track-load-from-element-readyState.html
LayoutTests/media/track/track-load-from-src-readyState-expected.txt
LayoutTests/media/track/track-load-from-src-readyState.html
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLTrackElement.cpp
Source/WebCore/html/HTMLTrackElement.h
Source/WebCore/html/HTMLTrackElement.idl
Source/WebCore/html/LoadableTextTrack.cpp
Source/WebCore/html/TextTrack.cpp
Source/WebCore/html/TextTrack.h
Source/WebCore/html/TextTrack.idl