Update TextTrack API to current spec
authorb.long@cablelabs.com <b.long@cablelabs.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Feb 2014 22:32:45 +0000 (22:32 +0000)
committerb.long@cablelabs.com <b.long@cablelabs.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Feb 2014 22:32:45 +0000 (22:32 +0000)
commit58d2f31419f5862d2343bc111e6aa4e4932c76ce
tree6b0bc4da45054b79d6c0fb679cde45d15478ecdd
parent03e892c971d7ea0c87d774212146ecf4958a664e
Update TextTrack API to current spec
https://bugs.webkit.org/show_bug.cgi?id=122218

Refactoring VTTCue out of TextTrackCue.

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/track/track-vttcue.html

* CMakeLists.txt: Add VTTCue and rename RenderTextTrackCue to RenderVTTCue.
* DerivedSources.cpp: Same.
* DerivedSources.make: Same.
* GNUmakefile.list.am: Same.
* PlatformGTK.cmake:  Same.
* WebCore.vcxproj/WebCore.vcxproj: Same.
* WebCore.vcxproj/WebCore.vcxproj.filters: Same.
* WebCore.xcodeproj/project.pbxproj: Same.
* bindings/js/JSTextTrackCueCustom.cpp:
(WebCore::toJS): Use VTTCue DOM wrapper for VTTCue and its subclasses.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateActiveTextTrackCues): Convert to VTTCue as needed.
(WebCore::HTMLMediaElement::textTrackRemoveCue): Same.
* html/HTMLMediaElement.h: Only print cue.text in debug output if the cue type has a .text attribute
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay): Convert to VTTCue as needed, and fix TextTrackCueBox to VTTCueBox.
(WebCore::MediaControlTextTrackContainerElement::updateTimerFired): Convert to VTTCue as needed.
* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::addGenericCue): Use refactored VTTCue attributes.
* html/track/InbandWebVTTTextTrack.cpp:
(WebCore::InbandWebVTTTextTrack::newCuesParsed): Use VTTCue's constructor instead of deprecated TextTrackCue constructor.
* html/track/TextTrack.cpp:
(WebCore::TextTrack::setMode): Convert to VTTCue as needed.
(WebCore::TextTrack::hasCue): Make this function only accept VTTCues, since it's only used for them anyway, and convert existing cues to VTTCues as needed.
* html/track/TextTrack.h: Same as hasCue above.
* html/track/TextTrackCue.cpp: Refactor a lot of code out. Everything that was removed went to VTTCue.cpp.
(WebCore::TextTrackCue::create): For backwards compatibility, just call VTTCue::create().
(WebCore::TextTrackCue::TextTrackCue): Refactor a lot of code out.
(WebCore::TextTrackCue::~TextTrackCue): Same.
(WebCore::TextTrackCue::didChange): Same.
(WebCore::TextTrackCue::setIsActive): Same.
* html/track/TextTrackCue.h: Same.
* html/track/TextTrackCue.idl: Remove VTTCue attributes and add custom toJS function.
* html/track/TextTrackCueGeneric.cpp: Use VTTCue instead of TextTrackCue.
* html/track/TextTrackCueGeneric.h: Same.
* html/track/VTTCue.cpp: Copied from Source/WebCore/html/track/TextTrackCue.cpp.
* html/track/VTTCue.h: Copied from Source/WebCore/html/track/TextTrackCue.h.
* html/track/VTTCue.idl: Copied from Source/WebCore/html/track/TextTrackCue.idl.
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::getNewCues): Use VTTCue instead of TextTrackCue.
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride): Use VTTCueBox instead of TextTrackCueBox.
* rendering/RenderVTTCue.cpp: Renamed from Source/WebCore/rendering/RenderTextTrackCue.cpp. Changed to use VTTCue instead of TextTrackCue.
* rendering/RenderVTTCue.h: Renamed from Source/WebCore/rendering/RenderTextTrackCue.h. Changed to use VTTCue instead of TextTrackCue.
* rendering/RenderingAllInOne.cpp: Rename RenderTextTrackCue to RenderVTTCue.

LayoutTests:

* js/dom/constructor-length.html: Add VTTCue constructor.
* platform/efl/js/dom/global-constructors-attributes-expected.txt: Same.
* platform/efl/js/dom/constructor-length-expected.txt: Same.
* js/dom/global-constructors-attributes-expected.txt: Same.
* platform/gtk-wk2/js/dom/constructor-length-expected.txt:  Same.
* platform/gtk-wk2/js/dom/global-constructors-attributes-expected.txt: Same.
* platform/gtk/js/dom/constructor-length-expected.txt: Same.
* platform/gtk/js/dom/global-constructors-attributes-expected.txt: Same.
* platform/mac-mountainlion/js/dom/global-constructors-attributes-expected.txt: Same.
* platform/mac/js/dom/constructor-length-expected.txt: Same.
* platform/mac/js/dom/global-constructors-attributes-expected.txt: Same.
* platform/win/js/dom/global-constructors-attributes-expected.txt: Same.
* media/track/track-cues-cuechange-expected.txt: Cues are of type VTTCue now.
* media/track/track-cues-enter-exit-expected.txt: Same.
* media/track/track-vttcue-expected.txt: Test VTTCue interface.
* media/track/track-vttcue.html: Same.
* media/video-test.js:
(testExpected): Add "instanceof" as a valid operator.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163649 268f45cc-cd09-0410-ab3c-d52691b4dbfc
48 files changed:
LayoutTests/ChangeLog
LayoutTests/js/dom/constructor-length.html
LayoutTests/js/dom/global-constructors-attributes-expected.txt
LayoutTests/media/track/track-cues-cuechange-expected.txt
LayoutTests/media/track/track-cues-enter-exit-expected.txt
LayoutTests/media/track/track-vttcue-expected.txt [new file with mode: 0644]
LayoutTests/media/track/track-vttcue.html [new file with mode: 0644]
LayoutTests/media/video-test.js
LayoutTests/platform/efl/js/dom/constructor-length-expected.txt
LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/gtk-wk2/js/dom/constructor-length-expected.txt
LayoutTests/platform/gtk-wk2/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/gtk/js/dom/constructor-length-expected.txt
LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/mac-mountainlion/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/mac/js/dom/constructor-length-expected.txt
LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.cpp
Source/WebCore/DerivedSources.make
Source/WebCore/GNUmakefile.list.am
Source/WebCore/PlatformGTK.cmake
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSTextTrackCueCustom.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/html/track/InbandGenericTextTrack.cpp
Source/WebCore/html/track/InbandWebVTTTextTrack.cpp
Source/WebCore/html/track/TextTrack.cpp
Source/WebCore/html/track/TextTrack.h
Source/WebCore/html/track/TextTrackCue.cpp
Source/WebCore/html/track/TextTrackCue.h
Source/WebCore/html/track/TextTrackCue.idl
Source/WebCore/html/track/TextTrackCueGeneric.cpp
Source/WebCore/html/track/TextTrackCueGeneric.h
Source/WebCore/html/track/VTTCue.cpp [new file with mode: 0644]
Source/WebCore/html/track/VTTCue.h [new file with mode: 0644]
Source/WebCore/html/track/VTTCue.idl [new file with mode: 0644]
Source/WebCore/loader/TextTrackLoader.cpp
Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp
Source/WebCore/rendering/RenderVTTCue.cpp [moved from Source/WebCore/rendering/RenderTextTrackCue.cpp with 83% similarity]
Source/WebCore/rendering/RenderVTTCue.h [moved from Source/WebCore/rendering/RenderTextTrackCue.h with 90% similarity]
Source/WebCore/rendering/RenderingAllInOne.cpp