aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webidls/VTTCue.webidl
diff options
context:
space:
mode:
authorIulian Gabriel Radu <iulian.radu67@gmail.com>2020-03-08 00:15:20 +0200
committerIulian Gabriel Radu <iulian.radu67@gmail.com>2020-03-08 00:15:20 +0200
commit911b1306cac7b3a6d048227ef0bf5de54836aedc (patch)
tree512ad344a7e3a0e89440ec7430c0017f07a727cc /components/script/dom/webidls/VTTCue.webidl
parent30b148c90f77057883e9cfe0b4edd0a6a883a9b6 (diff)
downloadservo-911b1306cac7b3a6d048227ef0bf5de54836aedc.tar.gz
servo-911b1306cac7b3a6d048227ef0bf5de54836aedc.zip
Add base of VTTCue DOM interface
Diffstat (limited to 'components/script/dom/webidls/VTTCue.webidl')
-rw-r--r--components/script/dom/webidls/VTTCue.webidl30
1 files changed, 30 insertions, 0 deletions
diff --git a/components/script/dom/webidls/VTTCue.webidl b/components/script/dom/webidls/VTTCue.webidl
new file mode 100644
index 00000000000..073aa12f79b
--- /dev/null
+++ b/components/script/dom/webidls/VTTCue.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://w3c.github.io/webvtt/#the-vttcue-interface
+
+enum AutoKeyword { "auto"};
+typedef (double or AutoKeyword) LineAndPositionSetting;
+enum DirectionSetting { "" /* horizontal */, "rl", "lr" };
+enum LineAlignSetting { "start", "center", "end" };
+enum PositionAlignSetting { "line-left", "center", "line-right", "auto" };
+enum AlignSetting { "start", "center", "end", "left", "right" };
+
+[Pref="dom.webvtt.enabled", Exposed=Window]
+interface VTTCue : TextTrackCue {
+ constructor(double startTime, double endTime, DOMString text);
+ attribute VTTRegion? region;
+ attribute DirectionSetting vertical;
+ attribute boolean snapToLines;
+ attribute LineAndPositionSetting line;
+ attribute LineAlignSetting lineAlign;
+ [SetterThrows]
+ attribute LineAndPositionSetting position;
+ attribute PositionAlignSetting positionAlign;
+ [SetterThrows]
+ attribute double size;
+ attribute AlignSetting align;
+ attribute DOMString text;
+ DocumentFragment getCueAsHTML();
+};