The spec renamed addTrack() to addTextTrack().
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2012 16:44:15 +0000 (16:44 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2012 16:44:15 +0000 (16:44 +0000)
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

14 files changed:
LayoutTests/ChangeLog
LayoutTests/media/track/track-add-track-expected.txt
LayoutTests/media/track/track-add-track.html
LayoutTests/media/track/track-addtrack-kind-expected.txt
LayoutTests/media/track/track-addtrack-kind.html
LayoutTests/media/track/track-text-track-destructor-crash.html
LayoutTests/media/track/track-texttracks-expected.txt
LayoutTests/media/track/track-texttracks.html
LayoutTests/platform/gtk/fast/dom/Window/window-properties-expected.txt
LayoutTests/platform/mac/fast/dom/Window/window-properties-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/HTMLMediaElement.idl

index 2d23770..d785fbb 100644 (file)
@@ -1,3 +1,23 @@
+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.
index fb9335c..a2b8ab5 100644 (file)
@@ -11,8 +11,8 @@ EXPECTED (event.target == '[object TextTrackList]') OK
 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
index 3bfb01d..e118c59 100644 (file)
@@ -18,8 +18,8 @@
                 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("");
index 246db1d..f18e8f7 100644 (file)
@@ -1,20 +1,20 @@
-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
index 95c4a44..343cb5d 100644 (file)
@@ -11,7 +11,7 @@
 
             function addTrack(type)
             {
-                run("video.addTrack('" + type + "')");
+                run("video.addTextTrack('" + type + "')");
                 testExpected("video.textTracks.length", ++trackCount);
             }
 
@@ -21,7 +21,7 @@
 
                 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("");
 
@@ -39,7 +39,7 @@
         </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>
index bb6bf9d..c2d0760 100644 (file)
@@ -14,7 +14,7 @@
                 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.");
@@ -39,4 +39,4 @@
     <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>
index 12f2de0..ccdb41e 100644 (file)
@@ -1,7 +1,7 @@
 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'))
@@ -14,7 +14,7 @@ EXPECTED (video.textTracks[0].kind == 'captions') OK
 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))
index 7b096da..26d5557 100644 (file)
@@ -13,8 +13,8 @@
             {
                 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 &lt;track&gt; element with DOM API.");
                 run("trackElement = document.createElement('track')");
@@ -27,7 +27,7 @@
                 testExpected("video.textTracks[1].kind", "chapters");
                 testExpected("video.textTracks[2].kind", "descriptions");
 
-                consoleWrite("<br>** Add another &lt;track&gt; element, is should insert before the addTrack() track.");
+                consoleWrite("<br>** Add another &lt;track&gt; element, is should insert before the addTextTrack() track.");
                 run("trackElement = document.createElement('track')");
                 run("trackElement.setAttribute('kind', 'metadata')");
                 run("video.appendChild(trackElement)");
index f546cc1..2cc9aa5 100644 (file)
@@ -72,7 +72,7 @@ window.Audio.prototype.NOTATION_NODE [number]
 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]
index b4e796a..fcf8527 100644 (file)
@@ -72,7 +72,7 @@ window.Audio.prototype.NOTATION_NODE [number]
 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]
index 1816766..bb2e71f 100644 (file)
@@ -1,3 +1,19 @@
+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
index 03bbca3..23ce7e4 100644 (file)
@@ -2198,7 +2198,7 @@ float HTMLMediaElement::percentLoaded() const
 }
 
 #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;
index 5f763b2..59143a6 100644 (file)
@@ -197,9 +197,9 @@ public:
     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; }
index 2dd55d5..ba03337 100644 (file)
@@ -112,7 +112,7 @@ module html {
 #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