Make TextTrackCue more mutable
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jan 2012 21:12:40 +0000 (21:12 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jan 2012 21:12:40 +0000 (21:12 +0000)
commitd0c745b91a6a3718aa39befbab6a8cacd8496710
treea111a4e1ae495ec36f146ed7a089dc77b606f56f
parentf710aa99651f3ac4ecbcaa1723e5b90a921bac4e
Make TextTrackCue more mutable
https://bugs.webkit.org/show_bug.cgi?id=72555

Reviewed by Anders Carlsson.

Source/WebCore:

Test: media/track/track-cue-mutable.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateActiveTextTrackCues): Do nothing if the "ignore cue updates"
    flag is set
(WebCore::HTMLMediaElement::textTrackAddCues): Block cue updates until all of the new cues have
    been added, then call updateActiveTextTrackCues so update the display if necessary.
(WebCore::HTMLMediaElement::textTrackRemoveCues): Block cue updates until all of the new cues have
    been removed, then call updateActiveTextTrackCues so update the display if necessary.
(WebCore::HTMLMediaElement::textTrackAddCue): Call updateActiveTextTrackCues so update the display if necessary.
(WebCore::HTMLMediaElement::textTrackRemoveCue): Ditto.
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::ignoreTrackDisplayUpdateRequests):
(WebCore::HTMLMediaElement::beginIgnoringTrackDisplayUpdateRequests):
(WebCore::HTMLMediaElement::endIgnoringTrackDisplayUpdateRequests):

* html/TextTrack.cpp:
(WebCore::TextTrack::cueWillChange): New, remove the cue from the media element because its
    position in the interval tree is based on start and end times.
(WebCore::TextTrack::cueDidChange): Add the cue to the media element.
* html/TextTrack.h:

* html/TextTrackCue.cpp:
(WebCore::startKeyword): New, use a static String for the constant.
(WebCore::middleKeyword): Ditto.
(WebCore::endKeyword): Ditto.
(WebCore::horizontalKeyword): Ditto.
(WebCore::verticalKeyword): Ditto.
(WebCore::verticallrKeyword): Ditto.
(WebCore::TextTrackCue::cueWillChange): New, tell the track the cue is about to change.
(WebCore::TextTrackCue::cueDidChange): New, tell the track the cue has changed.
(WebCore::TextTrackCue::setId): New, attribute is mutable.
(WebCore::TextTrackCue::setStartTime): Ditto.
(WebCore::TextTrackCue::setEndTime): Ditto.
(WebCore::TextTrackCue::setPauseOnExit): Ditto.
(WebCore::TextTrackCue::direction): Ditto.
(WebCore::TextTrackCue::setDirection): Ditto.
(WebCore::TextTrackCue::setSnapToLines): Ditto.
(WebCore::TextTrackCue::setLinePosition): Ditto.
(WebCore::TextTrackCue::setTextPosition): Ditto.
(WebCore::TextTrackCue::setSize): Ditto.
(WebCore::TextTrackCue::alignment): Ditto.
(WebCore::TextTrackCue::setAlignment): Ditto.
(WebCore::TextTrackCue::parseSettings): Use the static strings.
* html/TextTrackCue.h:
(WebCore::TextTrackCue::id):
(WebCore::TextTrackCue::startTime):
(WebCore::TextTrackCue::endTime):
(WebCore::TextTrackCue::pauseOnExit):
* html/TextTrackCue.idl:

LayoutTests:

* media/track/track-cue-mutable-expected.txt: Added.
* media/track/track-cue-mutable.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@104327 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/media/track/track-cue-mutable-expected.txt [new file with mode: 0644]
LayoutTests/media/track/track-cue-mutable.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/TextTrack.cpp
Source/WebCore/html/TextTrack.h
Source/WebCore/html/TextTrackCue.cpp
Source/WebCore/html/TextTrackCue.h
Source/WebCore/html/TextTrackCue.idl