aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webidls
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/webidls')
-rw-r--r--components/script/dom/webidls/HTMLMediaElement.webidl4
-rw-r--r--components/script/dom/webidls/TextTrack.webidl30
-rw-r--r--components/script/dom/webidls/TextTrackCue.webidl18
-rw-r--r--components/script/dom/webidls/TextTrackCueList.webidl12
-rw-r--r--components/script/dom/webidls/TextTrackList.webidl16
5 files changed, 78 insertions, 2 deletions
diff --git a/components/script/dom/webidls/HTMLMediaElement.webidl b/components/script/dom/webidls/HTMLMediaElement.webidl
index fa0459e0921..27e9d79c78d 100644
--- a/components/script/dom/webidls/HTMLMediaElement.webidl
+++ b/components/script/dom/webidls/HTMLMediaElement.webidl
@@ -61,6 +61,6 @@ interface HTMLMediaElement : HTMLElement {
// tracks
// readonly attribute AudioTrackList audioTracks;
// readonly attribute VideoTrackList videoTracks;
- // readonly attribute TextTrackList textTracks;
- // TextTrack addTextTrack(TextTrackKind kind, optional DOMString label = "", optional DOMString language = "");
+ readonly attribute TextTrackList textTracks;
+ TextTrack addTextTrack(TextTrackKind kind, optional DOMString label = "", optional DOMString language = "");
};
diff --git a/components/script/dom/webidls/TextTrack.webidl b/components/script/dom/webidls/TextTrack.webidl
new file mode 100644
index 00000000000..71fc0e84099
--- /dev/null
+++ b/components/script/dom/webidls/TextTrack.webidl
@@ -0,0 +1,30 @@
+/* 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 https://mozilla.org/MPL/2.0/. */
+
+// https://html.spec.whatwg.org/multipage/#texttrack
+
+enum TextTrackMode { "disabled", "hidden", "showing" };
+enum TextTrackKind { "subtitles", "captions", "descriptions", "chapters", "metadata" };
+
+[Exposed=Window]
+interface TextTrack : EventTarget {
+ readonly attribute TextTrackKind kind;
+ readonly attribute DOMString label;
+ readonly attribute DOMString language;
+
+ readonly attribute DOMString id;
+ // readonly attribute DOMString inBandMetadataTrackDispatchType;
+
+ attribute TextTrackMode mode;
+
+ readonly attribute TextTrackCueList? cues;
+ // readonly attribute TextTrackCueList? activeCues;
+
+ [Throws]
+ void addCue(TextTrackCue cue);
+ [Throws]
+ void removeCue(TextTrackCue cue);
+
+ attribute EventHandler oncuechange;
+};
diff --git a/components/script/dom/webidls/TextTrackCue.webidl b/components/script/dom/webidls/TextTrackCue.webidl
new file mode 100644
index 00000000000..20f1bf3f06d
--- /dev/null
+++ b/components/script/dom/webidls/TextTrackCue.webidl
@@ -0,0 +1,18 @@
+/* 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 https://mozilla.org/MPL/2.0/. */
+
+// https://html.spec.whatwg.org/multipage/#texttrackcue
+
+[Exposed=Window]
+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;
+};
diff --git a/components/script/dom/webidls/TextTrackCueList.webidl b/components/script/dom/webidls/TextTrackCueList.webidl
new file mode 100644
index 00000000000..357d8751bc2
--- /dev/null
+++ b/components/script/dom/webidls/TextTrackCueList.webidl
@@ -0,0 +1,12 @@
+/* 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 https://mozilla.org/MPL/2.0/. */
+
+// https://html.spec.whatwg.org/multipage/#texttrackcuelist
+
+[Exposed=Window]
+interface TextTrackCueList {
+ readonly attribute unsigned long length;
+ getter TextTrackCue (unsigned long index);
+ TextTrackCue? getCueById(DOMString id);
+};
diff --git a/components/script/dom/webidls/TextTrackList.webidl b/components/script/dom/webidls/TextTrackList.webidl
new file mode 100644
index 00000000000..33e1bef0ff4
--- /dev/null
+++ b/components/script/dom/webidls/TextTrackList.webidl
@@ -0,0 +1,16 @@
+/* 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 https://mozilla.org/MPL/2.0/. */
+
+// https://html.spec.whatwg.org/multipage/#texttracklist
+
+[Exposed=Window]
+interface TextTrackList : EventTarget {
+ readonly attribute unsigned long length;
+ getter TextTrack (unsigned long index);
+ TextTrack? getTrackById(DOMString id);
+
+ attribute EventHandler onchange;
+ attribute EventHandler onaddtrack;
+ attribute EventHandler onremovetrack;
+};