Bug 909993 - Add WebIDL for TextTrackCue and fix link in VTTCue.webidl. r=rillian r=bz
authorBrendan Long <b.long@cablelabs.com>
Wed, 29 Jul 2015 12:41:00 +0200
changeset 255381 17766cdd3de44947323f987e93286e7fb3ce6bab
parent 255380 d8c51bb08d3723c7d040455a354c88aad46c6950
child 255382 c9d25e716d31e97d801451d8eeedaac3b7664664
push id63020
push usercbook@mozilla.com
push dateThu, 30 Jul 2015 08:18:50 +0000
treeherdermozilla-inbound@bce7955eaa13 [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 r=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
testing/web-platform/meta/html/dom/interfaces.html.ini
testing/web-platform/meta/html/semantics/embedded-content/media-elements/historical.html.ini
--- 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',
--- a/testing/web-platform/meta/html/dom/interfaces.html.ini
+++ b/testing/web-platform/meta/html/dom/interfaces.html.ini
@@ -1268,49 +1268,16 @@
     expected: FAIL
 
   [TextTrack interface: attribute oncuechange]
     expected: FAIL
 
   [TextTrack interface: document.createElement("track").track must inherit property "oncuechange" with the proper type (10)]
     expected: FAIL
 
-  [TextTrackCue interface: existence and properties of interface object]
-    expected: FAIL
-
-  [TextTrackCue interface object length]
-    expected: FAIL
-
-  [TextTrackCue interface: existence and properties of interface prototype object]
-    expected: FAIL
-
-  [TextTrackCue interface: existence and properties of interface prototype object's "constructor" property]
-    expected: FAIL
-
-  [TextTrackCue interface: attribute track]
-    expected: FAIL
-
-  [TextTrackCue interface: attribute id]
-    expected: FAIL
-
-  [TextTrackCue interface: attribute startTime]
-    expected: FAIL
-
-  [TextTrackCue interface: attribute endTime]
-    expected: FAIL
-
-  [TextTrackCue interface: attribute pauseOnExit]
-    expected: FAIL
-
-  [TextTrackCue interface: attribute onenter]
-    expected: FAIL
-
-  [TextTrackCue interface: attribute onexit]
-    expected: FAIL
-
   [TrackEvent must be primary interface of new TrackEvent("addtrack"; {track:document.createElement("track").track})]
     expected: FAIL
 
   [Stringification of new TrackEvent("addtrack"; {track:document.createElement("track").track})]
     expected: FAIL
 
   [TrackEvent interface: new TrackEvent("addtrack"; {track:document.createElement("track").track}) must inherit property "track" with the proper type (0)]
     expected: FAIL
--- a/testing/web-platform/meta/html/semantics/embedded-content/media-elements/historical.html.ini
+++ b/testing/web-platform/meta/html/semantics/embedded-content/media-elements/historical.html.ini
@@ -1,8 +1,5 @@
 [historical.html]
   type: testharness
   [source.media should not be supported]
     expected: FAIL
 
-  [TextTrackCue constructor should not be supported]
-    expected: FAIL
-