Bug 909993 - Add WebIDL for TextTrackCue and fix link in VTTCue.webidl. r=rillian r=bz

This commit is contained in:
Brendan Long 2015-07-29 12:41:00 +02:00
parent 553469ede1
commit 8be4518086
7 changed files with 29 additions and 49 deletions

View File

@ -45,11 +45,13 @@ SpecialPowers.pushPrefEnv({"set": [["media.webvtt.regions.enabled", true]]},
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.");

View File

@ -1275,6 +1275,8 @@ var interfaceNamesInGlobalScope =
"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!

View File

@ -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;
};

View File

@ -4,7 +4,7 @@
* 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" };
@ -25,13 +25,7 @@ enum DirectionSetting {
[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;
@ -48,10 +42,6 @@ interface VTTCue : EventTarget {
attribute AlignSetting align;
attribute DOMString text;
DocumentFragment getCueAsHTML();
attribute EventHandler onenter;
attribute EventHandler onexit;
};
// Mozilla extensions.

View File

@ -521,6 +521,7 @@ WEBIDL_FILES = [
'TextDecoder.webidl',
'TextEncoder.webidl',
'TextTrack.webidl',
'TextTrackCue.webidl',
'TextTrackCueList.webidl',
'TextTrackList.webidl',
'ThreadSafeChromeUtils.webidl',

View File

@ -1273,39 +1273,6 @@
[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

View File

@ -3,6 +3,3 @@
[source.media should not be supported]
expected: FAIL
[TextTrackCue constructor should not be supported]
expected: FAIL