THIS DOCUMENT IS OUT-DATED, THE CONTENT HAS BEEN MERGED INTO THE WEBVTT SPEC. IT MERELY EXISTS FOR REFERENCE PURPOSES.
This section is non-normative.
WebVTT [WEBVTT] is a pretty nifty caption format with lots of capabilities for formatting and positioning of cues. From a TV perspective it satisfies the needs of pop-on and paint-on captions. However, the need for rollup captions can only be satisfied with very clunky copying of cues and manual positioning.
This document introduces the concept of "regions" into WebVTT to specify rollup captions following a very similar concept to that used in CEA-708 Digital TV Captioning [CEA-708].
WebVTT currently deals with two layout concepts: the text area that is to be rendered, and the video viewport. (Actually, there is a third: the line box - but it is orthogonal to the issue at hand.) In other caption formats (in particular in CEA-608 and CEA-708), a third concept exists: the concept of a rendering region which holds multiple cues. It is called "window" in CEA-708 [CEA-708].
This specification introduces the CEA-708 "window" concept into WebVTT under the term "region", because the term "window" already bears a different meaning on the Web. This specification's main goal is to allow for a simple implementation of rollup captions, but it also satisfies other use cases:
Many of these features are part of what the US FCC (Federal Communications Commission) has required for Captioning of Internet Video Programming [FCC].
This specification is the result of discussions in the W3C Text Tracks Community Group (CG). The intention is to provide a backwards compatible extension to the WebVTT specification [WEBVTT] such that the lack of support of the "region" feature in video players doesn't stop a WebVTT file with regions from being parsed and displayed on top of the video.
This document specifies the most fundamental concepts. There are many ways in which this "region" specification can be extended and in fact some ideas have been discussed on the W3C Text Tracks CG wiki. We will wait for browser vendors to implement the core features and for developers to provide feedback on their use cases and needs before extending this specification.
The following example shows two regions containing rollup captions for two different speakers. Fred's cues scroll up in a region in the left half of the video, Bill's cues scroll up in a region on the right half of the video. Fred's first cue disappears at 12.5sec even through it is defined until 20sec because its region is limited to 3 lines and at 12.5sec a fourth cue appears:
WEBVTT Region: id=fred width=50% lines=3 regionanchor=0%,100% viewportanchor=10%,90% scroll=up Region: id=bill width=50% lines=3 regionanchor=100%,100% viewportanchor=90%,90% scroll=up 00:00:00.000 --> 00:00:20.000 region:fred align:left Hi, my name is Fred 00:00:02.500 --> 00:00:22.500 region:bill align:right Hi, I'm Bill 00:00:05.000 --> 00:00:25.000 region:fred align:left Would you like to get a coffee? 00:00:07.500 --> 00:00:27.500 region:bill align:right Sure! I've only had one today. 00:00:10.000 --> 00:00:30.000 region:fred align:left This is my fourth! 00:00:12.500 --> 00:00:32.500 region:fred align:left OK, let's go.
Note that regions are only defined for horizontal cues at this time.
All terms used in this specification that are not (re-)defined in this specification rely on terms specified in the WebVTT specification [WEBVTT].
The WebVTT specification references the text track model of the HTML specification [HTML] to define the core terms of the WebVTT specification.
This specification introduces the concepts of a text track region and a text track list of regions, and extends the concept of a text track cue.
A text track region represents a subpart of the video viewport and provides a rendering area for text track cues.
Each text track region consists of:
An arbitrary string.
A number giving the width of the box within which the text of each line of the containing cues is to be rendered, to be interpreted as a percentage of the video width. Defaults to 100.
A number giving the number of lines of the box within which the text of each line of the containing cues is to be rendered. Defaults to 3.
Two numbers giving the x and y coordinates within the region which is anchored to the video viewport and does not change location even when the region does, e.g. because of font size changes. Defaults to (0,100), i.e. the bottom left corner of the region.
Two numbers giving the x and y coordinates within the video viewport to which the region anchor point is anchored. Defaults to (0,100), i.e. the bottom left corner of the viewport.
One of the following:
A list of text track regions . The list of regions of a text track can change dynamically, either because the text track has not yet been loaded or is still loading.
In addition to the existing attributes, each text track cue also consists of:
A string that references by identifier the region that a cue belongs to, if it is not null.
Also, update the following text track cue attribute definitions:
A number giving the position of the text of the cue within each line. If the cue is not within a region, to be interpreted as a percentage of the video, as defined by the writing direction, otherwise to be interpreted as a percentage of the region width.
When a text track cue whose active flag is set has its writing direction, snap-to-lines flag, line position, text position, size, alignment, region identifier or text change value, then the user agent must empty the text track cue display state, and then immediately run the text track's rules for updating the display of WebVTT text tracks.
The WebVTT parser is flexible when parsing the header of a WebVTT file and allows for characters to be present before the first cue in the file. We take advantage of this extension point of the WebVTT spec to introduce the specification of regions in the header of WebTT files.
The specification of a the "WebVTT file body" syntax in the WebVTT specification is extended to the following:
A WebVTT file body consists of the following components, in the following order:
WEBVTT
".A WebVTT metadata header consists of the following components, in the given order:
A WebVTT metadata header name and
a WebVTT metadata header value
each consist of any sequence of zero or more characters other than
U+000A LINE FEED (LF) characters and U+000D CARRIAGE RETURN (CR) characters
except that the entire resulting string must not contain the substring
"-->
" (U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS,
U+003E GREATER-THAN SIGN).
A WebVTT region metadata header is a special kind of WebVTT metadata header where both of the following apply:
Region
".A WebVTT region represents its region settings.
The WebVTT region settings part of a WebVTT region metadata header consists of zero or more of the following components, in any order, separated from each other by one or more U+0020 SPACE characters or U+0009 CHARACTER TABULATION (tab) characters. Each component must not be included more than once per WebVTT region setting string.
WebVTT region settings give configuration options regarding the dimensions, positioning and anchoring of the region. For example, it allows a group of cues within a region to be anchored in the center of the region and the center of the video viewport. In this example, when the font size grows, the region grows uniformly in all directions from the center.
A WebVTT region identifier consists of the following components, in the order given:
The string "id
".
A U+003D EQUALS SIGN character (=).
An arbitrary string of one or more characters other than U+0020 SPACE
or U+0009 CHARACTER TABULATION character. The string must not contain the substring
"-->
" (U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS,
U+003E GREATER-THAN SIGN).
The WebVTT region identifier gives a name to the region so it can be referenced by the cues that belong to the region.
A WebVTT region width setting consists of the following components, in the order given:
The string "width
".
A U+003D EQUALS SIGN character (=).
One or more ASCII digits.
An optional U+002E DOT character (.).
One or more ASCII digits.
A U+0025 PERCENT SIGN character (%).
The WebVTT region width setting provides a fixed width as a percentage of the video width for the region into which cues are rendered and based on which alignment is calculated.
A WebVTT region lines setting consists of the following components, in the order given:
The string "lines
".
A U+003D EQUALS SIGN character (=).
One or more ASCII digits.
The WebVTT region lines setting provides a fixed height as a number of lines for the region into which cues are rendered. As such, it defines the height of the roll-up region if it is a scroll region.
A WebVTT region anchor setting consists of the following components, in the order given:
The string "regionanchor
".
A U+003D EQUALS SIGN character (=).
One or more ASCII digits.
An optional U+002E DOT character (.).
One or more ASCII digits.
A U+0025 PERCENT SIGN character (%).
A U+002C COMMA character (,).
One or more ASCII digits.
An optional U+002E DOT character (.).
One or more ASCII digits.
A U+0025 PERCENT SIGN character (%).
The WebVTT region anchor setting provides a tuple of two percentages that specify the point within the region box that is fixed in location. The first percentage measures the x-dimension and the second percentage y-dimension from the top left corner of the region box. If no WebVTT region anchor setting is given, the anchor defaults to 0%, 100% (i.e. the bottom left corner).
A WebVTT region viewport anchor setting consists of the following components, in the order given:
The string "viewportanchor
".
A U+003D EQUALS SIGN character (=).
One or more ASCII digits.
An optional U+002E DOT character (.).
One or more ASCII digits.
A U+0025 PERCENT SIGN character (%).
A U+002C COMMA character (,).
One or more ASCII digits.
An optional U+002E DOT character (.).
One or more ASCII digits.
A U+0025 PERCENT SIGN character (%).
The WebVTT region viewport anchor setting provides a tuple of two percentages that specify the point within the video viewport that the region anchor point is anchored to. The first percentage measures the x-dimension and the second percentage measures the y-dimension from the top left corner of the video viewport box. If no viewport anchor is given, it defaults to 0%, 100% (i.e. the bottom left corner).
For browsers, the region maps to an absolute positioned CSS box relative to the video viewport, i.e. there is a relative positioned box that represents the video viewport relative to which the regions are absolutely positioned. Overflow is hidden.
A WebVTT region scroll setting consists of the following components, in the order given:
The string "scroll
".
A U+003D EQUALS SIGN character (=).
The string "up
".
The WebVTT region scroll setting specifies whether cues rendered into the region are allowed to move out of their initial rendering place and roll up, i.e. move towards the top of the video viewport. If the scroll setting is omitted, cues do not move from their rendered position.
Cues are added to a region one line at a time below existing cue lines. When an existing rendered cue line is removed, and it was above another already rendered cue line, that cue line moves into its space, thus scrolling in the given direction. If there is not enough space for a new cue line to be added to a region, the top-most cue line is pushed off the visible region (thus slowly becoming invisible as it moves into overflow:hidden). This eventually makes space for the new cue line and allows it to be added.
When there is no scroll direction, cue lines are added in the empty line closest to the line in the bottom of the region. If no empty line is available, the oldest line is replaced.
This specification extends the existing set of WebVTT cue settings with a new setting.
A WebVTT region cue setting consists of the following components, in the order given:
The string "region
".
A U+003A COLON character (:).
An arbitrary string of one or more characters other than U+0020 SPACE
or U+0009 CHARACTER TABULATION character. The string must not contain the substring
"-->
" (U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS,
U+003E GREATER-THAN SIGN).
A WebVTT region cue setting configures a cue to become part of a region by referencing the region's identifier unless the cue has a "vertical", "line" or "size" cue setting. If a cue is part of a region, its cue settings for "position" and "align" are applied to the line boxes in the cue relative to the region box.
The WebVTT parser algorithm is extended to parse the WebVTT region metadata header and the WebVTT region cue setting.
This is an extension of the WebVTT parser algorithm.
Introduce an additional variable regions to be a text track list of regions, which the WebVTT parser will create in addition to the text track list of cues output.
Metadata header creation: Let metadata be a new WebVTT metadata header.
Let metadata's name be the empty string.
Let metadata's value be the empty string.
If line contains the character ":" (A U+003A COLON), then set metadata's name to the substring of line before the first ":" character and metadata's value to the substring after this character.
If metadata's name equals "Region":
Jump back to the step labeled header.
This specification ignores all WebVTT metadata headers that don't specify regions.
We first introduce an algorithm to parse a percentage string and then the algorithm to collect WebVTT region settings.
The rules to parse a percentage string are as follows. This will return a percentage value or, if at any point the algorithm says that it "fails", this means that it is aborted at that point with an IndexSizeError and returns nothing.
Let input be the string being parsed.
If input contains any characters other than U+0025 PERCENT SIGN characters (%), U+002E DOT characters (.) and ASCII digits, then fail.
If input does not contain at least one ASCII digit, then fail.
If input contains more than one U+002E DOT character (.), then fail.
If any character in input other than the last character is a U+0025 PERCENT SIGN character (%), then fail.
If the last character in input is not a U+0025 PERCENT SIGN character (%), then fail.
Ignoring the trailing percent sign, interpret input as a real number. Let that number be the percentage.
If percentage is outside Throws an the range 0.0% .. 100.0%, fail.
Return percentage.
When the algorithm above requires that the user agent collect WebVTT region settings from a string input for a text track, the user agent must run the following algorithm. This algorithm returns a list of WebVTT Region Objects.
Let settings be the result of splitting input on spaces.
If setting does not contain a U+003D EQUALS SIGN character (=), or if the first U+003D EQUALS SIGN character (=) in setting is either the first or last character of setting, then jump to the step labeled next setting.
Let name be the leading substring of setting up to and excluding the first U+003D EQUALS SIGN character (=) in that string.
Let value be the trailing substring of setting starting from the character immediately after the first U+003D EQUALS SIGN character (=) in that string.
Run the appropriate substeps that apply for the value of name, as follows:
If name is a case-sensitive match for "id
"
Let region's identifier be value.
Otherwise if name is a case-sensitive match for "width
"
If parse a percentage string from value returns a percentage, let region's text track region width be percentage.
lines
"If value contains any characters other than ASCII digits, then jump to the step labeled next setting.
Interpret value as an integer, and let number be that number.
Let region's text track region lines be number.
regionanchor
"If value does not contain a U+002C COMMA character (,), then jump to the step labeled next setting.
Let anchorX be the leading substring of value up to and excluding the first U+002C COMMA character (,) in that string.
Let anchorY be the trailing substring of value starting from the character immediately after the first U+002C COMMA character (,) in that string.
If parse a percentage string from anchorX or parse a percentage string from anchorY don't return a percentage, then jump to the step labeled next setting.
Let region's text track region anchor point be the tuple of the percentage values calculated from anchorX and anchorY.
viewportanchor
"If value does not contain a U+002C COMMA character (,), then jump to the step labeled next setting.
Let viewportanchorX be the leading substring of value up to and excluding the first U+002C COMMA character (,) in that string.
Let viewportanchorY be the trailing substring of value starting from the character immediately after the first U+002C COMMA character (,) in that string.
If parse a percentage string from viewportanchorX or parse a percentage string from viewportanchorY don't return a percentage, then jump to the step labeled next setting.
Let region's text track region viewport anchor point be the tuple of the percentage values calculated from viewportanchorX and viewportanchorY.
scroll
"If value is a case-sensitive match for the string "up
", then let region's scroll value be "scroll up".
This is an extension of the WebVTT parser algorithm.
Introduce an additional assignment step after step 28.
This is an extension of the algorithm to parse the WebVTT settings.
Introduce an additional substep for step 4.
region
"Also add an additional step 5 to the algorithm to parse the WebVTT settings:
This makes sure that no matter in which order the cue settings are provided, if the cue has a line position or a size setting or is vertical, the region identifier will be ignored.
A WebVTT region object is a conceptual construct to represent a WebVTT region that is used as a root node for lists of WebVTT node objects.
In addition to the WebVTT cue text DOM construction rules we also need to create nodes for WebVTT region objects and WebVTT region cue span objects.
To convert a WebVTT region object to a DOM tree for Document
owner, user agents must map a WebVTT region object to a DocumentFragment
node.
The rules for updating the display of WebVTT text tracks are defined in the WebVTT specification to render the text tracks of a HTML video element and result in a set of CSS boxes that cover the rendering area of the video element.
These rules are extended with the following steps.
Extend step 7 to include regions and prepare the region list:
Let cues be an empty list of text track cues and regions be an empty list of text track regions. For each track track in tracks append to regions all the regions from track's text track list of regions.
Add the following steps after step 8 to prepare the CSS boxes for regions:
If reset is false, then, for each text track region region in regions let regionNode be a WebVTT region object.
Apply the following steps for each regionNode:
Prepare some variables for the application of CSS properties to regionNode as follows:
Let regionWidth be the text track region width. Let width be 'regionWidth vw' ('vw' is a CSS unit).[CSSVALUES]
Let lineHeight be '0.0533vh' ('vh' is a CSS unit).[CSSVALUES] and regionHeight be the text track region lines. Let lines be 'lineHeight multiplied by regionHeight.
Let viewportAnchorX be the x dimension of the text track region viewport anchor and regionAnchorX be the x dimension of the text track region anchor. Let leftOffset be regionAnchorX multiplied by width divided by 100.0. Let left be leftOffset subtracted from 'viewportAnchorX vw'.
Let viewportAnchorY be the y dimension of the text track region viewport anchor and regionAnchorY be the y dimension of the text track region anchor. Let topOffset be regionAnchorY multiplied by lines divided by 100.0. Let top be topOffset subtracted from 'viewportAnchorY vh'.
Apply the terms of the CSS specifications to regionNode within the following constraints, thus obtaining a CSS box box positioned relative to an initial containing block:
No style sheets are associated with regionNode. (The regionNodes are subsequently restyled using style sheets after their boxes are generated, as described below.)
Properties on regionNode have their values set as defined in the next section. (That section uses some of the variables whose values were calculated earlier in this algorithm.)
The viewport (and initial containing block) is video's rendering area.
Add the CSS box box to output.
Replace step 9 with the following extended step 9:
If reset is false, then, for each text track cue cue in cues: if cue's text track cue display state has a set of CSS boxes, then:
if there is a WebVTT region whose region identifier is identical to cue's text track cue region identifier:
add those boxes to that region's box and remove cue from cues.
otherwise:
add those boxes to output and remove cue from cues.
Make step 10's substeps apply only to text track cues whose text track cue region identifier does not match with the region identifier of a WebVTT region, if any. Add alternative substeps for text track cues in regions:
For each text track cue cue in cues that has not yet had corresponding CSS boxes added to output, in text track cue order, run the following substeps:
If cue has an empty text track cue region identifier or there is no WebVTT region whose region identifier is identical to cue's text track cue region identifier, run the following substeps:
[Run substep 1-17 as defined in the WebVTT spec.]
Otherwise run the following substeps:
Let region be the WebVTT region whose region identifier matches the text track cue region identifier of cue.
If region's text track region scroll setting is 'up
' and region already has one child, set region's 'transition-property' to 'top' and 'transition-duration' to '0.433s'.
Let nodes be the list of WebVTT Node Objects obtained by applying the WebVTT cue text parsing rules to the cue's text track cue text.
Apply the Unicode Bidirectional Algorithm's Paragraph Level steps to the concatenation of the values of each WebVTT Text Object in nodes, in a pre-order, depth-first traversal, excluding WebVTT Ruby Text Objects and their descendants, to determine the paragraph embedding level of the first Unicode paragraph of the cue. [BIDI]
Within a cue, paragraph boundaries are only denoted by Type B characters, such as U+000A LINE FEED (LF), U+0085 NEXT LINE (NEL), and U+2029 PARAGRAPH SEPARATOR. (This means each line of the cue is reordered as if it was a separate paragraph.)
If the paragraph embedding level determined in the previous step is even (the paragraph direction is left-to-right), let direction be 'ltr', otherwise, let it be 'rtl'.
Let offset be the text track cue text position multiplied by the width of the WebVTT region object whose region identifier is identical to cue's text track cue region identifier and divided by 100 (i.e. interpret it as a percentage of the region width).
If direction is 'ltr' and 'text-align' is 'start' or 'left', or if direction is 'rtl' and 'text-align' is 'end' or 'left', let left be offset and let right be 'auto'
If direction is 'ltr' and 'text-align' is 'end' or 'right', or if direction is 'rtl' and 'text-align' is 'start' or 'right', let left be 'auto' and right be offset.
If 'text-align' is 'middle', ignore the offset.
Apply the terms of the CSS specifications to nodes in the same way that they are applied to in step 10, substep 12 is applied to nodes of a cue that is not part of a region, except that the initial containing block is region.
Let boxes be the boxes generated as descendants of the initial containing block, along with their positions.
If there are no line boxes in boxes, skip the remainder of these substeps for cue. The cue is ignored.
Let cue's text track cue display state have the CSS boxes in boxes.
Add the CSS boxes in boxes to region.
When following the extended rules for updating the display of WebVTT text tracks, user agents must set properties of WebVTT region objects at the CSS user agent cascade layer as defined in this section. [CSS]
Every WebVTT region object is initialised with the following CSS settings:
The variables width, height, top, and left are the values with those names determined by the rules for updating the display of WebVTT text tracks for the text track region from which the WebVTT region object was constructed.
The children of every WebVTT region object are not initialised with the CSS properties of (root) List of WebVTT Node Objects but instead with these CSS settings:
All other non-inherited properties must be set to their initial values; inherited properties must inherit their values from the media element for which the text track region is being rendered, if any. If there is no media element (i.e. if the text track is being rendered for another media playback mechanism), then inherited properties on the WebVTT region objects must take their initial values.
If there are style sheets that apply to the media element or other playback mechanism, then they must be interpreted as defined in the next section.
Pseudo-elements apply to elements that are matched by selectors. For the purpose of this section, that element is the matched element. The pseudo-element defined below affects the styling of text track regions that are being rendered for the matched element.
If the matched element is not a video element, the pseudo-element defined below won't have any effect according to this specification.
The '::cue-region' pseudo-element (with no argument) matches any List of WebVTT region objects constructed for the matched element.
The same properties that apply to '::cue' apply to the '::cue-region' pseudo-element with no argument; other properties set on the pseudo-element must be ignored.
When a user agent is rendering one or more text track regions according to the WebVTT cue text rendering rules, WebVTT region objects used in the rendering can be matched by the above pseudo-element. User agents that support the pseudo-element must dynamically update renderings accordingly. When either 'white-space' or one of the properties corresponding to the 'font' shorthand (including 'line-height') changes value, then the text track cue display state of all the text track cues in the region must be emptied and the text track's rules for updating the text track rendering must be immediately rerun.
A CSS user agent that implements the text tracks model must implement the '::cue-region' pseudo-element.
The functionality of the "region" extension of WebVTT should also be available to JavaScript developers of Web applications. Therefore, the HTML TextTrack API is also extended. In particular, the TextTrack and the TextTrackCueobject are extended and TextTrackRegion and TextTrackRegionList objects are introduced.
The following attribute and method are introduced into the TextTrack object:
TextTrackRegionList
object.If the text track mode of the text track that the TextTrack object represents is not the text track disabled mode, then the regions
attribute must return a live TextTrackRegionList object that represents the text track list of regions of the text track. Otherwise, it must return null. When an object is returned, the same object must be returned each time.
The addRegion(region)
method of TextTrack
objects, when invoked, must run the following steps:
If the given region is in a text track list of regions, then remove region from that text track list of regions.
If the method's TextTrack
object's text track list of regions contains a region with the same identifier as region replace the values of that region's width, lines, anchor point, viewport anchor point and scroll attributes with those of region.
Otherwise: add region to the method's TextTrack
object's text track list of regions.
The removeRegion(region)
method of TextTrack
objects, when invoked, must run the following steps:
If the given region is not currently listed in the method's TextTrack
object's text track list of regions, then throw a NotFoundError exception.
Otherwise: remove region from that text track list of regions.
The following attribute is introduced into the TextTrackCue object:
Initialise regionId
in the TextTrackCue constructor with the empty string.
The regionId
attribute, on getting, must return the text track cue region identifier of the text track cue that the TextTrackCue object represents. On setting, the text track region identifier must be set to the new value.
Returns a string representing the text track region scroll as follows:
The empty string.
The string "up
".
Can be set.
The TextTrackRegion()
constructor, when invoked, must run the following steps:
Create a new text track region. Let region be that text track region.
Let region's text track region identifier be the empty string.
Let region's text track region width be 100.
Let region's text track region lines be 3.
Let region's text track region regionAnchorX be 0.
Let region's text track region regionAnchorY be 100.
Let region's text track region viewportAnchorX be 0.
Let region's text track region viewportAnchorY be 100.
Let region's text track region scroll be the empty string.
Return the TextTrackRegion
object representing region.
The track
attribute, on getting, must return the TextTrack
object of the text track in whose list of regions the text track region that the TextTrackRegion
object represents finds itself, if any; or null otherwise.
The width
attribute, on getting, must return the text track region width of the text track region that the TextTrackRegion
object represents, in percent of video width. On setting, the text track region width must be set to the new value, interpreted as a percentage.
The lines
attribute, on getting, must return the text track region lines of the text track region that the TextTrackRegion
object represents, as number of lines. On setting, the text track region lines must be set to the new value, interpreted as a number of lines.
The regionAnchor X
attribute, on getting, must return the text track region anchor X offset of the text track region that the TextTrackRegion
object represents, in percent of region width. On setting, the text track regionAnchor X distance must be set to the new value, interpreted as a percentage.
The regionAnchor Y
attribute, on getting, must return the text track region anchor Y offset of the text track region that the TextTrackRegion
object represents, in percent of region height. On setting, the text track regionAnchor Y distance must be set to the new value, interpreted as a percentage.
The viewportAnchor X
attribute, on getting, must return the text track region viewport anchor X offset of the text track region that the TextTrackRegion
object represents, in percent of video width. On setting, the text track viewportAnchor X distance must be set to the new value, interpreted as a percentage.
The viewportAnchor Y
attribute, on getting, must return the text track region viewport anchor Y offset of the text track region that the TextTrackRegion
object represents, in percent of video height. On setting, the text track viewportAnchor Y distance must be set to the new value, interpreted as a percentage.
The scroll
attribute, on getting, must return the string from the second cell of the row in the table below whose first cell is the text track region scroll setting of the text track region that the TextTrackRegion
object represents:
Text track region scroll setting | scroll value
|
---|---|
None | " " (the empty string)
|
"Up | "up "
|
On setting, the text track scroll must be set to the value given on the first cell of the row in the table above whose second cell is a case-sensitive match for the new value, if any. If none of the values match, then the user agent must instead throw a SyntaxError
exception.
Returns null if none of the regions have the given identifier or if the argument is the empty string.
A TextTrackRegionList
object represents a dynamically updating list of text track regions in a given order.
The length
attribute must return the number of regions in the list represented by the TextTrackRegionList
object.
The supported property indices of a TextTrackRegionList
object at any instant are the numbers from zero to the number of regions in the list represented by the TextTrackRegionList
object minus one, if any. If there are no regions in the list, there are no supported property indices.
To determine the value of an indexed property for a given index index, the user agent must return the index of the text track region in the list represented by the TextTrackRegionList
object.
The getRegionById(id)
method, when called with an argument other than the empty string, must return the first text track region in the list represented by the TextTrackRegionList
object whose text track region identifier is id, if any, or null otherwise. If the argument is the empty string, then the method must return null.