https://bugs.webkit.org/show_bug.cgi?id=77381
Patch by Arko Saha <arko@motorola.com> on 2012-01-31
Reviewed by Eric Carlson.
Renamed addTrack() to addTextTrack().
Spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#media-elements
Source/WebCore:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::addTextTrack):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::addTextTrack):
* html/HTMLMediaElement.idl:
LayoutTests:
* media/track/track-add-track-expected.txt:
* media/track/track-add-track.html:
* media/track/track-addtrack-kind-expected.txt:
* media/track/track-addtrack-kind.html:
* media/track/track-text-track-destructor-crash.html:
* media/track/track-texttracks-expected.txt:
* media/track/track-texttracks.html:
* platform/gtk/fast/dom/Window/window-properties-expected.txt:
* platform/mac/fast/dom/Window/window-properties-expected.txt:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106361
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-01-31 Arko Saha <arko@motorola.com>
+
+ The spec renamed addTrack() to addTextTrack().
+ https://bugs.webkit.org/show_bug.cgi?id=77381
+
+ Reviewed by Eric Carlson.
+
+ Renamed addTrack() to addTextTrack().
+ Spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#media-elements
+
+ * media/track/track-add-track-expected.txt:
+ * media/track/track-add-track.html:
+ * media/track/track-addtrack-kind-expected.txt:
+ * media/track/track-addtrack-kind.html:
+ * media/track/track-text-track-destructor-crash.html:
+ * media/track/track-texttracks-expected.txt:
+ * media/track/track-texttracks.html:
+ * platform/gtk/fast/dom/Window/window-properties-expected.txt:
+ * platform/mac/fast/dom/Window/window-properties-expected.txt:
+
2012-01-31 Yuzo Fujishima <yuzo@google.com>
[Chromium] Unreviewed test expectation change.
EXPECTED (event instanceof window.TrackEvent == 'true') OK
EXPECTED (event.track == '[object TextTrack]') OK
-** Test a TextTrack created with video.addTrack().
-RUN(tracks.push(video.addTrack('captions', 'Caption Track', 'en')))
+** Test a TextTrack created with video.addTextTrack().
+RUN(tracks.push(video.addTextTrack('captions', 'Caption Track', 'en')))
EXPECTED (video.textTracks.length == '2') OK
EVENT(addtrack)
EXPECTED (event.target == '[object TextTrackList]') OK
testExpected("event.track", tracks[video.textTracks.length - 1]);
if (video.textTracks.length == 1) {
- consoleWrite("<br>** Test a TextTrack created with video.addTrack().");
- run("tracks.push(video.addTrack('captions', 'Caption Track', 'en'))");
+ consoleWrite("<br>** Test a TextTrack created with video.addTextTrack().");
+ run("tracks.push(video.addTextTrack('captions', 'Caption Track', 'en'))");
testExpected("video.textTracks.length", 2);
} else {
consoleWrite("");
-Tests that the addTrack() only accepts known 'kind' values.
+Tests that the addTextTrack() only accepts known 'kind' values.
++ Test invalid 'kind'.
EXPECTED (video.textTracks.length == '0') OK
-TEST(video.addTrack('kaptions')) THROWS(DOMException.SYNTAX_ERR) OK
+TEST(video.addTextTrack('kaptions')) THROWS(DOMException.SYNTAX_ERR) OK
EXPECTED (video.textTracks.length == '0') OK
++ Test all valid 'kind' keywords.
-RUN(video.addTrack('subtitles'))
+RUN(video.addTextTrack('subtitles'))
EXPECTED (video.textTracks.length == '1') OK
-RUN(video.addTrack('captions'))
+RUN(video.addTextTrack('captions'))
EXPECTED (video.textTracks.length == '2') OK
-RUN(video.addTrack('descriptions'))
+RUN(video.addTextTrack('descriptions'))
EXPECTED (video.textTracks.length == '3') OK
-RUN(video.addTrack('chapters'))
+RUN(video.addTextTrack('chapters'))
EXPECTED (video.textTracks.length == '4') OK
-RUN(video.addTrack('metadata'))
+RUN(video.addTextTrack('metadata'))
EXPECTED (video.textTracks.length == '5') OK
END OF TEST
function addTrack(type)
{
- run("video.addTrack('" + type + "')");
+ run("video.addTextTrack('" + type + "')");
testExpected("video.textTracks.length", ++trackCount);
}
consoleWrite("<em>++ Test invalid 'kind'.</em>");
testExpected("video.textTracks.length", 0);
- testException("video.addTrack('kaptions')", "DOMException.SYNTAX_ERR");
+ testException("video.addTextTrack('kaptions')", "DOMException.SYNTAX_ERR");
testExpected("video.textTracks.length", 0);
consoleWrite("");
</script>
</head>
<body onload="start()">
- <p>Tests that the addTrack() only accepts known 'kind' values.</p>
+ <p>Tests that the addTextTrack() only accepts known 'kind' values.</p>
<video>
</video>
</body>
consoleWrite("Create video and add text tracks.");
var video = document.createElement('video');
for (var i = 0; i < 1000; i++)
- tracks[i] = video.addTrack('captions', 'Captions Track', 'en');
+ tracks[i] = video.addTextTrack('captions', 'Captions Track', 'en');
testExpected("tracks.length", 1000);
consoleWrite("");
consoleWrite("Destroy the video and force a garbage collection.");
<body onload="startTest()">
<p>Tests that we don't crash when a media element that has text tracks is destructed.</p>
</body>
-</html>
\ No newline at end of file
+</html>
Tests that TextTracks in a TextTrackList are kept in the correct order.
-** Add a track with video.addTrack().
-RUN(video.addTrack('descriptions', 'Descriptions Track', 'en'))
+** Add a track with video.addTextTrack().
+RUN(video.addTextTrack('descriptions', 'Descriptions Track', 'en'))
** Add a <track> element with DOM API.
RUN(trackElement = document.createElement('track'))
EXPECTED (video.textTracks[1].kind == 'chapters') OK
EXPECTED (video.textTracks[2].kind == 'descriptions') OK
-** Add another <track> element, is should insert before the addTrack() track.
+** Add another <track> element, is should insert before the addTextTrack() track.
RUN(trackElement = document.createElement('track'))
RUN(trackElement.setAttribute('kind', 'metadata'))
RUN(video.appendChild(trackElement))
{
findMediaElement();
- consoleWrite("** Add a track with video.addTrack().");
- run("video.addTrack('descriptions', 'Descriptions Track', 'en')");
+ consoleWrite("** Add a track with video.addTextTrack().");
+ run("video.addTextTrack('descriptions', 'Descriptions Track', 'en')");
consoleWrite("<br>** Add a <track> element with DOM API.");
run("trackElement = document.createElement('track')");
testExpected("video.textTracks[1].kind", "chapters");
testExpected("video.textTracks[2].kind", "descriptions");
- consoleWrite("<br>** Add another <track> element, is should insert before the addTrack() track.");
+ consoleWrite("<br>** Add another <track> element, is should insert before the addTextTrack() track.");
run("trackElement = document.createElement('track')");
run("trackElement.setAttribute('kind', 'metadata')");
run("video.appendChild(trackElement)");
window.Audio.prototype.PROCESSING_INSTRUCTION_NODE [number]
window.Audio.prototype.TEXT_NODE [number]
window.Audio.prototype.addEventListener [function]
-window.Audio.prototype.addTrack [function]
+window.Audio.prototype.addTextTrack [function]
window.Audio.prototype.appendChild [function]
window.Audio.prototype.blur [function]
window.Audio.prototype.canPlayType [function]
window.Audio.prototype.PROCESSING_INSTRUCTION_NODE [number]
window.Audio.prototype.TEXT_NODE [number]
window.Audio.prototype.addEventListener [function]
-window.Audio.prototype.addTrack [function]
+window.Audio.prototype.addTextTrack [function]
window.Audio.prototype.appendChild [function]
window.Audio.prototype.blur [function]
window.Audio.prototype.canPlayType [function]
+2012-01-31 Arko Saha <arko@motorola.com>
+
+ The spec renamed addTrack() to addTextTrack().
+ https://bugs.webkit.org/show_bug.cgi?id=77381
+
+ Reviewed by Eric Carlson.
+
+ Renamed addTrack() to addTextTrack().
+ Spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#media-elements
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::addTextTrack):
+ * html/HTMLMediaElement.h:
+ (WebCore::HTMLMediaElement::addTextTrack):
+ * html/HTMLMediaElement.idl:
+
2012-01-31 Peter Rybin <peter.rybin@gmail.com>
Web Inspector: CodeGeneratorInspector.py: reimplement generated array types
}
#if ENABLE(VIDEO_TRACK)
-PassRefPtr<TextTrack> HTMLMediaElement::addTrack(const String& kind, const String& label, const String& language, ExceptionCode& ec)
+PassRefPtr<TextTrack> HTMLMediaElement::addTextTrack(const String& kind, const String& label, const String& language, ExceptionCode& ec)
{
if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled())
return 0;
float percentLoaded() const;
#if ENABLE(VIDEO_TRACK)
- PassRefPtr<TextTrack> addTrack(const String& kind, const String& label, const String& language, ExceptionCode&);
- PassRefPtr<TextTrack> addTrack(const String& kind, const String& label, ExceptionCode& ec) { return addTrack(kind, label, emptyString(), ec); }
- PassRefPtr<TextTrack> addTrack(const String& kind, ExceptionCode& ec) { return addTrack(kind, emptyString(), emptyString(), ec); }
+ PassRefPtr<TextTrack> addTextTrack(const String& kind, const String& label, const String& language, ExceptionCode&);
+ PassRefPtr<TextTrack> addTextTrack(const String& kind, const String& label, ExceptionCode& ec) { return addTextTrack(kind, label, emptyString(), ec); }
+ PassRefPtr<TextTrack> addTextTrack(const String& kind, ExceptionCode& ec) { return addTextTrack(kind, emptyString(), emptyString(), ec); }
TextTrackList* textTracks();
CueList currentlyActiveCues() const { return m_currentlyActiveCues; }
#endif
#if defined(ENABLE_VIDEO_TRACK) && ENABLE_VIDEO_TRACK
- [EnabledAtRuntime=webkitVideoTrack] TextTrack addTrack(in DOMString kind, in [Optional] DOMString label, in [Optional] DOMString language)
+ [EnabledAtRuntime=webkitVideoTrack] TextTrack addTextTrack(in DOMString kind, in [Optional] DOMString label, in [Optional] DOMString language)
raises (DOMException);
readonly attribute [EnabledAtRuntime=webkitVideoTrack] TextTrackList textTracks;
#endif