From 28b708c40260b2c418c80d706de833c0a784b15b Mon Sep 17 00:00:00 2001
From: Silvia Pfeiffer /**/).
This example shows how to position cues at explicit positions in the video viewport.
+This example shows how to position cues at explicit positions in the video viewport.
WEBVTT
@@ -474,25 +474,25 @@ CSS comment (e.g. /**/).
Since the cues in these examples are horizontal, the "position" setting refers to a percentage - of the width of the video viewpoint. If the text were vertical, the "position" setting would refer - to the height of the video viewport.
+ of the width of the video viewport. If the text were vertical, the "position" setting would + refer to the height of the video viewport.The "line-left" or "line-right" only refers to the physical side of the box to which the "position" setting applies, in a way which is agnostic regarding the horizontal or vertical direction of the cue. It does not affect or relate to the direction or position of the text itself within the box.
-The cues cover only 35% of the video viewport's width - that's the cue - box's "size" for all three cues.
+The cues cover only 35% of the video viewport's width - that's the cue box's "size" for all three cues.
The first cue has its cue box positioned at the 10% mark. The "line-left" and "line-right" within the "position" setting indicates which side of the cue box the position refers to. Since in this case the text is horizontal, "line-left" refers to the left side of the box, and the cue box is thus positioned between the 10% - and the 45% mark of the video viewport's width, probably underneath a speaker on the left of the - video image. If the cue was vertical, "line-left" positioning would be from the top of the video - viewport's height and the cue box would cover 35% of the video - viewport's height.
+ and the 45% mark of the video viewport's width, probably underneath a speaker on the left of + the video image. If the cue was vertical, "line-left" positioning would be from the top of the + video viewport's height and the cue box would cover 35% of the + video viewport's height.The text within the first cue's cue box is aligned using the "align" cue setting. For
left-to-right rendered text, "start" alignment is the left of that box, for right-to-left rendered
@@ -502,9 +502,9 @@ CSS comment (e.g. /**/).
The second cue has its cue box right aligned at the 90% mark of the - video viewport width ("right" aligned text right aligns the box). The same effect can be achieved - with "position:55%,line-left", which explicitly positions the cue box. The third cue has center - aligned text within the same positioned cue box as the first cue.
+ video viewport width ("right" aligned text right aligns the box). The same effect can be + achieved with "position:55%,line-left", which explicitly positions the cue box. The third cue has + center aligned text within the same positioned cue box as the first cue.The box model of WebVTT consists of three key elements: the video viewport, cues, and -regions. The video viewport is the rendering area into which cues and regions are rendered. Cues are -boxes consisting of a set of cue lines. Regions are subareas of the video viewport that are used to -group cues together. Cues are positioned either inside the video viewport directly or inside a -region, which is positioned inside the video viewport.
+The box model of WebVTT consists of three key elements: the video viewport, cues, and regions. The video viewport is the +rendering area into which cues and regions are rendered. Cues are boxes +consisting of a set of cue lines. Regions are subareas of the video +viewport that are used to group cues together. Cues are positioned either inside the video viewport +directly or inside a region, which is positioned inside the video viewport.
The position of a cue inside the video viewport is defined by a set of cue settings. The position of a region inside the video viewport is defined by a set of region settings. Cues that are inside regions can only use a limited set of their cue settings. Specifically, if the cue has a "vertical", "line" or "size" setting, the cue drops out of the region. Otherwise, the cue's width is -calculated to be relative to the region width rather than the viewport.
+calculated to be relative to the region width rather than the video viewport.WebVTT caption or subtitle cues are rendered as overlays on top of a video viewport or into a -region, which is a subarea of the video viewport.
+WebVTT caption or subtitle cues are rendered as overlays on top of a video viewport or +into a region, which is a subarea of the video viewport.
+ + +The video viewport is the video's rendering area which in the case +of HTML5 is defined by the |video|'s concrete object size.
+A WebVTT cue is a text track cue [[!HTML]] that additionally consist of the -following:
+following:The cue box of a WebVTT cue is a box within which the text of all lines of the cue is to - be rendered. It is either rendered into the video's viewport or a region inside the viewport if - the cue is part of a region.
+ be rendered. It is either rendered into the video viewport or a region inside the video + viewport if the cue is part of a region.The position of the cue box within the video viewport's or region's dimensions depends on the value of the WebVTT cue position and the WebVTT @@ -878,8 +886,8 @@ fragment:
The line offsets the cue box from the - top, the right or left of the video viewport as defined by the writing direction, the snap-to-lines flag, or the lines occupied by any other showing tracks.
@@ -1084,8 +1092,8 @@ fragment:Even for horizontal cues with right-to-left cue text, the cue box is positioned from the left edge of - the video viewport. This allows defining a rendering space template which can be filled with - either left-to-right or right-to-left cue text, or both.
+ the video viewport. This allows defining a rendering space template which can be filled + with either left-to-right or right-to-left cue text, or both.For WebVTT cues that have a size other than 100%, and a text alignment of start @@ -1339,8 +1347,9 @@ cues are the rules for updating the display of WebVTT text tracks.
WebVTT caption or subtitle regions -A WebVTT region represents a subpart of the video viewport and provides a limited -rendering area for WebVTT caption or subtitle cues.
+A WebVTT region represents a subpart of the video viewport and provides a +limited rendering area for WebVTT caption or subtitle +cues.
Regions provide a means to group caption or subtitle cues so the cues can be rendered together, which is particularly important when scrolling up.
@@ -1374,15 +1383,16 @@ together, which is particularly important when scrolling up.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 +
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 video viewport.
+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 video + viewport.
The following diagram illustrates how anchoring of a region to a video viewport works. The black - cross is the anchor, orange explains the anchor's offset within the region and green the anchor's - offset within the video viewport. Think of it as sticking a pin through a note onto a board:
+The following diagram illustrates how anchoring of a region to a video viewport works. + The black cross is the anchor, orange explains the anchor's offset within the region and green the + anchor's offset within the video viewport. Think of it as sticking a pin through a note onto + a board:

Image description: Within the video viewport, there is a WebVTT region. - Inside the region, there is an anchor point marked with a black cross. The vertical and horizontal - distance from the video viewport's edges to the anchor is marked with green arrows, representing - the region viewport anchor X and Y offsets. The vertical and horizontal distance from the region's - edges to the anchor is marked with orange arrows, representing the region anchor X and Y offsets. - The size of the region is represented by the region width for the horizontal axis, and region lines - for the vertical axis.
+Image description: Within the video viewport, there is a WebVTT + region. Inside the region, there is an anchor point marked with a black cross. The vertical and + horizontal distance from the video viewport's edges to the anchor is marked with green arrows, + representing the region viewport anchor X and Y offsets. The vertical and horizontal distance from + the region's edges to the anchor is marked with orange arrows, representing the region anchor X and + Y offsets. The size of the region is represented by the region width for the horizontal axis, and + region lines for the vertical axis.
For parsing, we also need the following:
@@ -1898,8 +1909,9 @@ than once per WebVTT region settings list string.The WebVTT region settings list gives 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.
+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 setting consists of the following components, in the order given:
@@ -1978,14 +1990,14 @@ order given: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 region viewport anchor is given, it defaults to -0%, 100% (i.e. the bottom left corner).
+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. If no region 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.
+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:
@@ -1998,8 +2010,8 @@ given: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.
+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 @@ -2063,7 +2075,7 @@ given:
A WebVTT line cue setting configures the offset of the cue box from the video -viewport's edge in the direction orthogonal to the writing -direction. For horizontal cues, this is the vertical offset from the top of the video viewport, -for vertical cues, it's the horizontal offset. The offset is for the start, center, or end of the cue box, depending on the WebVTT cue line alignment value - start by default. The offset can be given either as a -percentage of the relevant writing-mode dependent video viewport dimension or as a line number. Line -numbers are based on the size of the first line of the cue. Positive line numbers count from the -start of the video viewport (the first line is numbered 0), negative line numbers from the end of -the video viewport (the last line is numbered −1).
+A WebVTT line cue setting configures the offset of the cue box from the +video viewport's edge in the direction orthogonal to the writing direction. For horizontal cues, this is the vertical offset from the top of +the video viewport, for vertical cues, it's the horizontal offset. The offset is for the start, center, +or end of the cue box, depending on the WebVTT cue line +alignment value - start by default. The offset can +be given either as a percentage of the relevant writing-mode dependent video viewport +dimension or as a line number. Line numbers are based on the size of the first line of the cue. +Positive line numbers count from the start of the video viewport (the first line is numbered 0), +negative line numbers from the end of the video viewport (the last line is numbered −1).
A WebVTT position cue setting consists of the following components, in the order given:
@@ -2125,7 +2137,7 @@ given:A WebVTT position cue setting configures the indent position of the cue box in the direction orthogonal to the WebVTT line cue setting. For horizontal cues, this is the horizontal position. The cue position is given as a percentage of -the video viewport. The positioning is for the line-left, center, or line-right of the cue box, depending on the cue's computed position alignment, which is overridden by the WebVTT @@ -2143,7 +2155,7 @@ given:
A WebVTT size cue setting configures the size of the cue box in the same direction as the WebVTT position cue setting. For horizontal cues, this is the width of the cue box. It is given as a percentage of -the width of the video viewport.
+the width of the video viewport.A WebVTT alignment cue setting consists of the following components, in the order given:
@@ -2174,7 +2186,7 @@ lt="WebVTT line cue setting">"line" or "size 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 and the cue box width and height are calculated relative -to the region dimensions rather than the viewport dimensions. +to the region dimensions rather than the video viewport dimensions.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 video viewport (and initial containing block) is video's rendering area.
This example shows how to position cues at explicit positions in the video viewport.
+This example shows how to position cues at explicit positions in the video viewport.
WEBVTT 00:00:00.000 --> 00:00:04.000 position:10%,line-left align:left size:35% @@ -1910,31 +1911,27 @@
Since the cues in these examples are horizontal, the "position" setting refers to a percentage - of the width of the video viewpoint. If the text were vertical, the "position" setting would refer - to the height of the video viewport.
+ of the width of the video viewport. If the text were vertical, the "position" setting would + refer to the height of the video viewport.The "line-left" or "line-right" only refers to the physical side of the box to which the "position" setting applies, in a way which is agnostic regarding the horizontal or vertical direction of the cue. It does not affect or relate to the direction or position of the text itself within the box.
-The cues cover only 35% of the video viewport’s width - that’s the cue - box’s "size" for all three cues.
+The cues cover only 35% of the video viewport’s width - that’s the cue box’s "size" for all three cues.
The first cue has its cue box positioned at the 10% mark. The "line-left" and "line-right" within the "position" setting indicates which side of the cue box the position refers to. Since in this case the text is horizontal, "line-left" refers to the left side of the box, and the cue box is thus positioned between the 10% - and the 45% mark of the video viewport’s width, probably underneath a speaker on the left of the - video image. If the cue was vertical, "line-left" positioning would be from the top of the video - viewport’s height and the cue box would cover 35% of the video - viewport’s height.
+ and the 45% mark of the video viewport’s width, probably underneath a speaker on the left of + the video image. If the cue was vertical, "line-left" positioning would be from the top of the video viewport’s height and the cue box would cover 35% of the video viewport’s height.The text within the first cue’s cue box is aligned using the "align" cue setting. For left-to-right rendered text, "start" alignment is the left of that box, for right-to-left rendered text the right of the box. So, independent of the directionality of the text, it will stay underneath that speaker. Note that "center" position alignment of the cue box is the default for start aligned text, in order to avoid having the box move when the base direction of the text changes (from left-to-right to right-to-left or vice versa) as a result of translation.
-The second cue has its cue box right aligned at the 90% mark of the - video viewport width ("right" aligned text right aligns the box). The same effect can be achieved - with "position:55%,line-left", which explicitly positions the cue box. The third cue has center - aligned text within the same positioned cue box as the first cue.
+The second cue has its cue box right aligned at the 90% mark of the video viewport width ("right" aligned text right aligns the box). The same effect can be + achieved with "position:55%,line-left", which explicitly positions the cue box. The third cue has + center aligned text within the same positioned cue box as the first cue.
The box model of WebVTT consists of three key elements: the video viewport, cues, and -regions. The video viewport is the rendering area into which cues and regions are rendered. Cues are -boxes consisting of a set of cue lines. Regions are subareas of the video viewport that are used to -group cues together. Cues are positioned either inside the video viewport directly or inside a -region, which is positioned inside the video viewport.
+The box model of WebVTT consists of three key elements: the video viewport, cues, and regions. The video viewport is the +rendering area into which cues and regions are rendered. Cues are boxes +consisting of a set of cue lines. Regions are subareas of the video +viewport that are used to group cues together. Cues are positioned either inside the video viewport +directly or inside a region, which is positioned inside the video viewport.
The position of a cue inside the video viewport is defined by a set of cue settings. The position of a region inside the video viewport is defined by a set of region settings. Cues that are inside regions can only use a limited set of their cue settings. Specifically, if the cue has a "vertical", "line" or "size" setting, the cue drops out of the region. Otherwise, the cue’s width is -calculated to be relative to the region width rather than the viewport.
+calculated to be relative to the region width rather than the video viewport.This section is non-normative.
The WebVTT file is a container file for chunks of data that are time-aligned with a video or @@ -2190,26 +2187,29 @@
A WebVTT file must only contain data of one kind, never a mix of different kinds of data. The data kind of a WebVTT file is externally specified, such as in a HTML file’s text track element. The environment is responsible for interpreting the data correctly.
-WebVTT caption or subtitle cues are rendered as overlays on top of a video viewport or into a -region, which is a subarea of the video viewport.
-WebVTT caption or subtitle cues are rendered as overlays on top of a video viewport or +into a region, which is a subarea of the video viewport.
+The video viewport is the video’s rendering area which in the case +of HTML5 is defined by the video’s concrete object size.
+A WebVTT cue is a text track cue [HTML] that additionally consist of the -following:
+following:The raw text of the cue, and rules for its interpretation.
A WebVTT caption or subtitle cue is a WebVTT cue that has the following +
A WebVTT caption or subtitle cue is a WebVTT cue that has the following additional properties allowing the cue text to be rendered and converted to a DOM fragment:
The cue box of a WebVTT cue is a box within which the text of all lines of the cue is to - be rendered. It is either rendered into the video’s viewport or a region inside the viewport if - the cue is part of a region.
+The cue box of a WebVTT cue is a box within which the text of all lines of the cue is to + be rendered. It is either rendered into the video viewport or a region inside the video + viewport if the cue is part of a region.
The position of the cue box within the video viewport’s or region’s dimensions depends on the value of the WebVTT cue position and the WebVTT cue line.
@@ -2219,8 +2219,8 @@A writing direction, either
The line defines positioning of the cue box.
The line offsets the cue box from the - top, the right or left of the video viewport as defined by the writing direction, the snap-to-lines + top, the right or left of the video viewport as defined by the writing direction, the snap-to-lines flag, or the lines occupied by any other showing tracks.
The line is set either as a number of lines, a percentage of the video viewport height or width, or as the special value auto, which means the offset is to depend on the other showing tracks.
By default, the line is set to auto.
If the writing direction is horizontal, then the line percentages are relative to the height of the video, otherwise to the width of the video.
-A WebVTT cue has a computed line whose value is that +
A WebVTT cue has a computed line whose value is that returned by the following algorithm, which is defined in terms of the other aspects of the cue:
If the line is numeric, the WebVTT cue snap-to-lines flag of the WebVTT cue is false, and the line is negative or +
If the line is numeric, the WebVTT cue snap-to-lines flag of the WebVTT cue is false, and the line is negative or greater than 100, then return 100 and abort these steps.
Although the WebVTT parser will not set the line to a number outside the range 0..100 and also set the WebVTT cue snap-to-lines
flag to false, this can happen when using the DOM API’s snapToLines and line attributes.
If the WebVTT cue snap-to-lines flag of the WebVTT cue is false, return the +
If the WebVTT cue snap-to-lines flag of the WebVTT cue is false, return the value 100 and abort these steps. (The line is the special value auto.)
Let cue be the WebVTT cue.
+Let cue be the WebVTT cue.
If cue is not in a list of cues of a text
track, or if that text track is not in the list of text tracks of a media
@@ -2292,7 +2292,7 @@ Return n.3.3.
For example, if two text tracks are showing at the same time in one media element, and each text track currently has an active WebVTT cue whose line are both auto, then the first text track’s cue’s computed line will be −1 and the second will be −2.
+For example, if two text tracks are showing at the same time in one media element, and each text track currently has an active WebVTT cue whose line are both auto, then the first text track’s cue’s computed line will be −1 and the second will be −2.
An alignment for the cue box’s line, one @@ -2314,12 +2314,12 @@
The position is either a number giving the position of the cue box as a percentage value or the special value auto, which means the position is to depend on the text alignment of the cue.
-If the cue is not within a region, the percentage value is to be +
If the cue is not within a region, the percentage value is to be interpreted as a percentage of the video dimensions, otherwise as a percentage of the region dimensions.
By default, the position is set to auto.
If the writing direction is horizontal, then the position percentages are relative to the width of the video, otherwise to the height of the video.
-A WebVTT cue has a computed position whose value +
A WebVTT cue has a computed position whose value is that returned by the following algorithm, which is defined in terms of the other aspects of the cue:
Since the default value of the WebVTT cue position alignment is center, if there is no WebVTT cue text alignment setting for a cue, the WebVTT cue position defaults to 50%.
Even for horizontal cues with right-to-left cue text, the cue box is positioned from the left edge of - the video viewport. This allows defining a rendering space template which can be filled with - either left-to-right or right-to-left cue text, or both.
-For WebVTT cues that have a size other than 100%, and a text alignment of start or end, authors must not use the default auto position.
+ the video viewport. This allows defining a rendering space template which can be filled + with either left-to-right or right-to-left cue text, or both. +For WebVTT cues that have a size other than 100%, and a text alignment of start or end, authors must not use the default auto position.
When the text alignment is start or end, the auto position is 50%. This is different
from left and right aligned text, where the auto position is 0% and 100%, respectively. The above requirement is present because it
can be surprising that automatic positioning doesn’t work for start or end aligned text. Since cue
@@ -2358,7 +2358,7 @@ 3.3.
By default, the position alignment is set to auto.
-A WebVTT cue has a computed position
+ A WebVTT cue has a computed position
alignment whose value is that returned by the following algorithm, which is defined in terms
of other aspects of the cue:
@@ -2480,22 +2480,23 @@
3.3.
its lines' base direction.
An optional WebVTT region to which a cue belongs.
-By default, the region is set to null.
+An optional WebVTT region to which a cue belongs.
+By default, the region is set to null.
-The associated rules for updating the text track rendering of WebVTT
+ The associated rules for updating the text track rendering of WebVTT
cues are the rules for updating the display of WebVTT text tracks. When a WebVTT cue whose active flag is set has its writing direction, snap-to-lines flag, line, line alignment, position, position alignment, size, text alignment, region, or text change value, then the user agent must empty the text track cue display state, and then
+ When a WebVTT cue whose active flag is set has its writing direction, snap-to-lines flag, line, line alignment, position, position alignment, size, text alignment, region, 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. A WebVTT region represents a subpart of the video viewport and provides a limited
-rendering area for WebVTT caption or subtitle cues. A WebVTT region represents a subpart of the video viewport and provides a
+limited rendering area for WebVTT caption or subtitle
+cues. Regions provide a means to group caption or subtitle cues so the cues can be rendered
together, which is particularly important when scrolling up. Each WebVTT region consists of: Each WebVTT region consists of:3.4. WebVTT caption or subtitle regions
- 3.5. WebVTT caption or subtitle regions
+
3.
for non-scrolling regions it happens at the bottom.
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 +
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 video viewport.
+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 video + viewport.
One of the following:
@@ -2536,32 +2538,33 @@The following diagram illustrates how anchoring of a region to a video viewport works. The black - cross is the anchor, orange explains the anchor’s offset within the region and green the anchor’s - offset within the video viewport. Think of it as sticking a pin through a note onto a board:
+The following diagram illustrates how anchoring of a region to a video viewport works. + The black cross is the anchor, orange explains the anchor’s offset within the region and green the + anchor’s offset within the video viewport. Think of it as sticking a pin through a note onto + a board:

Image description: Within the video viewport, there is a WebVTT region. - Inside the region, there is an anchor point marked with a black cross. The vertical and horizontal - distance from the video viewport’s edges to the anchor is marked with green arrows, representing - the region viewport anchor X and Y offsets. The vertical and horizontal distance from the region’s - edges to the anchor is marked with orange arrows, representing the region anchor X and Y offsets. - The size of the region is represented by the region width for the horizontal axis, and region lines - for the vertical axis.
+Image description: Within the video viewport, there is a WebVTT + region. Inside the region, there is an anchor point marked with a black cross. The vertical and + horizontal distance from the video viewport’s edges to the anchor is marked with green arrows, + representing the region viewport anchor X and Y offsets. The vertical and horizontal distance from + the region’s edges to the anchor is marked with orange arrows, representing the region anchor X and + Y offsets. The size of the region is represented by the region width for the horizontal axis, and + region lines for the vertical axis.
For parsing, we also need the following:
A list of zero or more WebVTT regions.
+A list of zero or more WebVTT regions.
A WebVTT chapter cue is a WebVTT cue whose cue text is interpreted as a +
A WebVTT chapter cue is a WebVTT cue whose cue text is interpreted as a chapter title that describes the chapter as a navigation target.
Chapter cues mark up the timeline of a audio or video file in consecutive, non-overlapping intervals. It is further possible to subdivide these intervals into sub-chapters building a navigation tree.
-A WebVTT metadata cue is a WebVTT cue whose cue text is interpreted as +
A WebVTT metadata cue is a WebVTT cue whose cue text is interpreted as time-aligned metadata.
-->" (U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS, U+003E GREATER-THAN SIGN),
nor containing any U+000A LINE FEED (LF) characters or U+000D CARRIAGE RETURN (CR) characters.
- A WebVTT cue identifier must be unique amongst all the WebVTT cue identifiers of all WebVTT cues of a WebVTT
+ A WebVTT cue identifier must be unique amongst all the WebVTT cue identifiers of all WebVTT cues of a WebVTT
file. A WebVTT cue identifier can be used to reference a specific cue, for example
from script or CSS. A WebVTT cue settings list can contain a reference to a WebVTT region. To define a
+ A WebVTT cue settings list can contain a reference to a WebVTT region. To define a
region, a WebVTT region definition block is specified. The WebVTT region settings list consists of zero or more of the following components,
in any order, separated from each other by one or more U+0020 SPACE characters, U+0009 CHARACTER
@@ -2876,8 +2879,9 @@ HTML character reference [HTML]
4.3. WebVTT region settings
- The WebVTT region settings list gives 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 setting consists of the following components, in the order given:
A WebVTT region identifier setting must be unique amongst all the WebVTT region identifier settings of all WebVTT
+ A WebVTT region identifier setting must be unique amongst all the WebVTT region identifier settings of all WebVTT
regions of a WebVTT file. A WebVTT region identifier setting must be present in each WebVTT cue settings
-list. Without an identifier, it is not possible to associate a WebVTT cue with a WebVTT region in the syntax.
The WebVTT region identifier setting 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 @@ -2955,13 +2959,12 @@
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 region 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.
+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. If no region 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:
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 @@ -3028,7 +3031,7 @@
When a user agent is rendering one or more WebVTT cues according to the rules for updating the display of WebVTT text tracks, WebVTT Node
+ When a user agent is rendering one or more WebVTT cues according to the rules for updating the display of WebVTT text tracks, WebVTT Node
Objects in the list of WebVTT Node Objects used in the rendering can be matched by
certain pseudo-selectors as defined below. These selectors can begin or stop matching individual WebVTT Node Objects while a cue is being
rendered, even in between applications of the rules for updating the display of WebVTT text
tracks (which are only run when the set of active cues changes). User agents that support the
-pseudo-element described below 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 WebVTT cue’s text track cue display state must
+pseudo-element described below 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 WebVTT cue’s text track cue display state must
be emptied and the text track’s rules for updating the text track rendering must be
immediately rerun. Pseudo-elements apply to elements that are matched by selectors. For the purpose of this section,
that element is the matched element. The pseudo-elements defined in the following sections
-affect the styling of parts of WebVTT cues that are being rendered for the matched element.
If the matched element is not a video element, the pseudo-elements defined below won’t have any effect according to this specification.
A CSS user agent that implements the text tracks model must implement the ::cue, ::cue(selector), ::cue-region and ::cue-region(selector) pseudo-elements, and the :past and :future pseudo-classes.
@@ -5366,13 +5367,13 @@The :past pseudo-class only matches WebVTT Node Objects that are in the past.
A WebVTT Node Object c is in the past if, in a -pre-order, depth-first traversal of the WebVTT cue’s list of WebVTT Node Objects, +pre-order, depth-first traversal of the WebVTT cue’s list of WebVTT Node Objects, there exists a WebVTT Timestamp Object whose value is less than the current playback position of the media element that is the matched element, entirely after the WebVTT Node Object c.
The :future pseudo-class only matches WebVTT Node Objects that are in the future.
A WebVTT Node Object c is in the future if, in a -pre-order, depth-first traversal of the WebVTT cue’s list of WebVTT Node Objects, +pre-order, depth-first traversal of the WebVTT cue’s list of WebVTT Node Objects, there exists a WebVTT Timestamp Object whose value is greater than the current playback position of the media element that is the matched element, entirely before the WebVTT Node Object c.
VTTCue(startTime, endTime, text) constructor, when invoked, must run the following steps:
Create a new WebVTT cue. Let cue be that WebVTT cue.
+Create a new WebVTT cue. Let cue be that WebVTT cue.
Let cue’s text track cue start time be the value of the startTime argument, interpreted as a time in seconds.
@@ -5571,12 +5572,12 @@Return the VTTCue object representing cue.
The region attribute, on getting, must return the VTTRegion object representing the WebVTT cue region of the WebVTT cue that the VTTCue object
+
The region attribute, on getting, must return the VTTRegion object representing the WebVTT cue region of the WebVTT cue that the VTTCue object
represents, if any; or null otherwise. On setting, the WebVTT cue region must be set to the
new value.
The vertical attribute, on getting, must return the string from
the second cell of the row in the table below whose first cell is the WebVTT cue writing
-direction of the WebVTT cue that the VTTCue object represents:
VTTCue object represents: