Bug 909993 - Add WebIDL for TextTrackCue and fix link in VTTCue.webidl. r=rillian,bz
☠☠ backed out by e8a0360b762d ☠ ☠
authorBrendan Long <b.long@cablelabs.com>
Fri, 24 Jul 2015 17:11:00 -0700
changeset 286712 3fa834e9838337a9a0af29b266ad0e11ceaae0f3
parent 286711 5e20a7ea2c169866b3833658172b71ebbf44d735
child 286713 20afa46d73c187bd23dc095ece6343a477f72649
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrillian, bz
bugs909993
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 909993 - Add WebIDL for TextTrackCue and fix link in VTTCue.webidl. r=rillian,bz
dom/media/test/test_texttrackcue.html
dom/tests/mochitest/general/test_interfaces.html
dom/webidl/TextTrackCue.webidl
dom/webidl/VTTCue.webidl
dom/webidl/moz.build
--- a/dom/media/test/test_texttrackcue.html
+++ b/dom/media/test/test_texttrackcue.html
@@ -40,21 +40,23 @@ SpecialPowers.pushPrefEnv({"set": [["med
       is(trackElement.readyState, 2, "Track::ReadyState should be set to LOADED.");
       // Set mode to hidden so that the active cue lists are being updated.
       trackElement.track.mode = "hidden";
 
       var cueList = trackElement.track.cues;
       is(cueList.length, 6, "Cue list length should be 6.");
 
       // Check that the typedef of TextTrackCue works in Gecko.
-      is(window.TextTrackCue, undefined, "TextTrackCue should be undefined.");
+      isnot(window.TextTrackCue, undefined, "TextTrackCue should be defined.");
       isnot(window.VTTCue, undefined, "VTTCue should be defined.");
 
       // Check if first cue was parsed correctly.
       var cue = cueList[0];
+      ok(cue instanceof TextTrackCue, "Cue should be an instanceof TextTrackCue.");
+      ok(cue instanceof VTTCue, "Cue should be an instanceof VTTCue.");
       is(cue.id, "1", "Cue's ID should be 1.");
       is(cue.startTime, 0.5, "Cue's start time should be 0.5.");
       is(cue.endTime, 0.7, "Cue's end time should be 0.7.");
       is(cue.pauseOnExit, false, "Cue's pause on exit flag should be false.");
       is(cue.text, "This", "Cue's text should be set correctly.");
       is(cue.track, trackElement.track, "Cue's track should be defined.");
 
       cue.track = null;
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -1271,16 +1271,18 @@ var interfaceNamesInGlobalScope =
     "TextDecoder",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "TextEncoder",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "TextMetrics",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "TextTrack",
 // IMPORTANT: Do not change this list without review from a DOM peer!
+    "TextTrackCue",
+// IMPORTANT: Do not change this list without review from a DOM peer!
     "TextTrackCueList",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "TextTrackList",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "TimeEvent",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "TimeRanges",
 // IMPORTANT: Do not change this list without review from a DOM peer!
new file mode 100644
--- /dev/null
+++ b/dom/webidl/TextTrackCue.webidl
@@ -0,0 +1,21 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * The origin of this IDL file is
+ * https://html.spec.whatwg.org/#texttrackcue
+ */
+
+[Pref="media.webvtt.enabled"]
+interface TextTrackCue : EventTarget {
+  readonly attribute TextTrack? track;
+
+  attribute DOMString id;
+  attribute double startTime;
+  attribute double endTime;
+  attribute boolean pauseOnExit;
+
+  attribute EventHandler onenter;
+  attribute EventHandler onexit;
+};
\ No newline at end of file
--- a/dom/webidl/VTTCue.webidl
+++ b/dom/webidl/VTTCue.webidl
@@ -1,15 +1,15 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * The origin of this IDL file is
- * http://www.whatwg.org/specs/web-apps/current-work/#texttrackcue
+ * http://dev.w3.org/html5/webvtt/#the-vttcue-interface
  */
 
 enum AutoKeyword { "auto" };
 
 enum AlignSetting {
   "start",
   "middle",
   "end",
@@ -20,43 +20,33 @@ enum AlignSetting {
 enum DirectionSetting {
   "",
   "rl",
   "lr"
 };
 
 [Constructor(double startTime, double endTime, DOMString text),
  Pref="media.webvtt.enabled"]
-interface VTTCue : EventTarget {
-  readonly attribute TextTrack? track;
-
-  attribute DOMString id;
-  attribute double startTime;
-  attribute double endTime;
-  attribute boolean pauseOnExit;
+interface VTTCue : TextTrackCue {
   [Pref="media.webvtt.regions.enabled"]
   attribute VTTRegion? region;
   attribute DirectionSetting vertical;
   attribute boolean snapToLines;
   attribute (long or AutoKeyword) line;
   [SetterThrows]
   attribute AlignSetting lineAlign;
   [SetterThrows]
   attribute long position;
   [SetterThrows]
   attribute AlignSetting positionAlign;
   [SetterThrows]
   attribute long size;
   attribute AlignSetting align;
   attribute DOMString text;
   DocumentFragment getCueAsHTML();
-
-  attribute EventHandler onenter;
-
-  attribute EventHandler onexit;
 };
 
 // Mozilla extensions.
 partial interface VTTCue {
   [ChromeOnly]
   attribute HTMLDivElement? displayState;
   [ChromeOnly]
   readonly attribute boolean hasBeenReset;
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -516,16 +516,17 @@ WEBIDL_FILES = [
     'Telephony.webidl',
     'TelephonyCall.webidl',
     'TelephonyCallGroup.webidl',
     'TelephonyCallId.webidl',
     'Text.webidl',
     'TextDecoder.webidl',
     'TextEncoder.webidl',
     'TextTrack.webidl',
+    'TextTrackCue.webidl',
     'TextTrackCueList.webidl',
     'TextTrackList.webidl',
     'ThreadSafeChromeUtils.webidl',
     'TimeEvent.webidl',
     'TimeRanges.webidl',
     'Touch.webidl',
     'TouchEvent.webidl',
     'TouchList.webidl',