Bug 1787199 [wpt PR 35620] - Add tests for `VisibilityStateEntry`, a=testonly
[gecko.git] / dom / webidl / VTTCue.webidl
blob92855ac77875fa7b84c1a79cf9350b58af6299c4
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4  * You can obtain one at http://mozilla.org/MPL/2.0/.
5  *
6  * The origin of this IDL file is
7  * http://dev.w3.org/html5/webvtt/#the-vttcue-interface
8  */
10 enum AutoKeyword { "auto" };
12 enum LineAlignSetting {
13   "start",
14   "center",
15   "end"
18 enum PositionAlignSetting {
19   "line-left",
20   "center",
21   "line-right",
22   "auto"
25 enum AlignSetting {
26   "start",
27   "center",
28   "end",
29   "left",
30   "right"
33 enum DirectionSetting {
34   "",
35   "rl",
36   "lr"
39 [Exposed=Window]
40 interface VTTCue : TextTrackCue {
41   [Throws]
42   constructor(double startTime, double endTime, DOMString text);
44   [Pref="media.webvtt.regions.enabled"]
45   attribute VTTRegion? region;
46   attribute DirectionSetting vertical;
47   attribute boolean snapToLines;
48   attribute (double or AutoKeyword) line;
49   [SetterThrows]
50   attribute LineAlignSetting lineAlign;
51   [SetterThrows]
52   attribute (double or AutoKeyword) position;
53   [SetterThrows]
54   attribute PositionAlignSetting positionAlign;
55   [SetterThrows]
56   attribute double size;
57   attribute AlignSetting align;
58   attribute DOMString text;
59   DocumentFragment getCueAsHTML();
62 // Mozilla extensions.
63 partial interface VTTCue {
64   [ChromeOnly]
65   attribute HTMLDivElement? displayState;
66   [ChromeOnly]
67   readonly attribute boolean hasBeenReset;
68   [ChromeOnly]
69   readonly attribute double computedLine;
70   [ChromeOnly]
71   readonly attribute double computedPosition;
72   [ChromeOnly]
73   readonly attribute PositionAlignSetting computedPositionAlign;
74   [ChromeOnly]
75   readonly attribute boolean getActive;