diff options
author | Iulian Gabriel Radu <iulian.radu67@gmail.com> | 2020-03-08 00:15:20 +0200 |
---|---|---|
committer | Iulian Gabriel Radu <iulian.radu67@gmail.com> | 2020-03-08 00:15:20 +0200 |
commit | 911b1306cac7b3a6d048227ef0bf5de54836aedc (patch) | |
tree | 512ad344a7e3a0e89440ec7430c0017f07a727cc /components/script/dom/webidls/VTTCue.webidl | |
parent | 30b148c90f77057883e9cfe0b4edd0a6a883a9b6 (diff) | |
download | servo-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.webidl | 30 |
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(); +}; |