HTMLMediaElement::configureTextTracks should configure all text tracks
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Nov 2012 23:06:40 +0000 (23:06 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Nov 2012 23:06:40 +0000 (23:06 +0000)
commitdf80d756afa55ad5bb554d9ee2f431ebc8facdb2
treeb7601ac5ec5d4c5d557ee46e763b6e8e0fa82071
parent7d8d0182dab01ca9115a691bde088b3097fa736a
HTMLMediaElement::configureTextTracks should configure all text tracks
https://bugs.webkit.org/show_bug.cgi?id=102561

Reviewed by Philippe Normand.

Source/WebCore:

No new tests, track-mode-not-changed-by-new-track.html was updated to test the changes.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::textTrackModeChanged): HTMLTrackElement -> TextTrack.
(WebCore::HTMLMediaElement::willRemoveTrack): Ditto.
(WebCore::HTMLMediaElement::configureTextTrackGroup): Ditto.
(WebCore::HTMLMediaElement::configureTextTracks): Ditto.
(WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured): Ditto.
* html/HTMLMediaElement.h:

* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::HTMLTrackElement): Move hasBeenConfigured down to TextTrack.
(WebCore::HTMLTrackElement::parseAttribute): isDefault is stored on TextTrack.
(WebCore::HTMLTrackElement::ensureTrack): LoadableTextTrack constructor doesn't take
    "default" argument.
* html/HTMLTrackElement.h:

* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::LoadableTextTrack): Initialize m_isDefault to false.
* html/track/LoadableTextTrack.h:
(WebCore::TextTrack::isDefault): Override base class implementation, because a track element
    can be flagged as default.
(WebCore::TextTrack::setIsDefault): Ditto.

* html/track/TextTrack.cpp:
(WebCore::TextTrack::TextTrack): Initialize m_hasBeenConfigured.
* html/track/TextTrack.h:
(WebCore::TextTrack::hasBeenConfigured): New, moved from HTMLTrackElement so other code doesn't
    need know what type of track it is calling.
(WebCore::TextTrack::setHasBeenConfigured): Ditto.
(WebCore::TextTrack::isDefault): Base, do nothing, implementation because only LoadableTextTrack
    can be "default".
(WebCore::TextTrack::setIsDefault): Ditto.

LayoutTests:

Update test and results to check that dynamically added tracks are configured correctly.

* media/track/track-mode-not-changed-by-new-track-expected.txt:
* media/track/track-mode-not-changed-by-new-track.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@135202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/media/track/track-mode-not-changed-by-new-track-expected.txt
LayoutTests/media/track/track-mode-not-changed-by-new-track.html
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/HTMLTrackElement.cpp
Source/WebCore/html/HTMLTrackElement.h
Source/WebCore/html/track/LoadableTextTrack.cpp
Source/WebCore/html/track/LoadableTextTrack.h
Source/WebCore/html/track/TextTrack.cpp
Source/WebCore/html/track/TextTrack.h