diff --git a/index.bs b/index.bs
index 6491e90..fe9dfaa 100644
--- a/index.bs
+++ b/index.bs
@@ -362,6 +362,68 @@ CSS comment (e.g. /**/).
This section is non-normative.
+ +WebVTT supports an Attributes block to provide additional information about the rendered text track, and to allow disambiguation of metadata tracks.
+ + + +In this example, an optional WebVTT attributes object is used to differentiate captions from standard subtitles.
++WEBVTT + +ATTRIBUTES +kind: captions +lang: es-mx +label: Español (SDH) + +NOTE +Captions (SDH aka Subtitles for the Deaf and Hard-of-Hearing) +typically include spoken dialog as well as important audible +sounds such as "floor boards creak", "dogs barking", or in +this case, "music". + +1 +00:00:10.123 --> 00:00:15.432 +¡Hola! ¿Qué tál? + +2 +00:00:47.462 --> 00:01:04.028 +[♫ música ♫] ++ +
In this example, a WebVTT attributes object is used to indicate the text track cues represent audible or braille descriptions for the blind. Unlike subtitles or captions, these are not intended to be rendered visually.
++WEBVTT + +ATTRIBUTES +kind: descriptions +lang: en-us +label: English (AD) + +NOTE +VTT-based descriptions are meant to render as text-to-speech audio or braille, +for blind or deafblind audiences, not usually as visual captions on screen. +As such, the option/label might be displayed in an audio menu or elsewhere. + +1 +00:00:10.123 --> 00:00:15.432 +A young girl tiptoes down a dark hallway. ++ +
This section is non-normative.
@@ -671,11 +733,14 @@ signifies the end of the WebVTT cue.In this example, a talk is split into each slide being a chapter.
+In this example, topics mentioned in a talk are provided as URLs for reference.
WEBVTT + ATTRIBUTES + kind: metadata + NOTE Thanks to http://output.jsbin.com/mugibo @@ -704,6 +769,30 @@ signifies the end of the WebVTT cue.
In this example, a sequence of video thumbnails and their text alternative are made available for the playback UI.
+
+WEBVTT
+
+ATTRIBUTES
+kind: metadata
+
+00:00:01.959 --> 00:00:02.938
+{
+ "src": "https://cdn.example.com/thumbnails.jpg#xywh=0,0,284,160",
+ "alt": {
+ "en-us": "Miguel crosses the marigold bridge to the land of the dead.",
+ "es-mx": "Miguel cruza el puente marigold hacia la tierra de los muertos."
+ }
+}
+
+The Timed Text Working Group is discussing a registry for metadata type
+values, such as type: video-thumbnails or type: video-flash-avoidance.
+See WebVTT issues #511 and #512 for more info.
A WebVTT attributes object represents the optional file-level metadata declared in a +WebVTT attributes block. It consists of:
+ +A string giving the text track kind. If present, must be one of "subtitles",
+ "captions", "descriptions", "chapters", or
+ "metadata". Defaults to the empty string.
The kind key is the only required key. Consumers that do not
+ recognise the kind value should treat the entire WebVTT attributes object
+ as opaque.
A string further differentiating the subtype within a kind (for example,
+ distinguishing varieties of metadata tracks). If present, must be either
+ "custom" or a string beginning with "custom-". All other values
+ are reserved for future standardization. Defaults to the empty string.
The type key disambiguates the track kind subtype to resolve
+ naming conflicts for the other common key names often used by different types of metadata.
Authors including
+ custom pairs should provide a non-empty
+ type value to identify the application or schema those pairs belong to.
+ A WebVTT attributes block with non-empty
+ custom pairs and an empty
+ type is valid but parsers may generate a warning.
A string giving the BCP 47 language tag of the track content. Defaults to the empty + string.
+A human-readable string intended for use in a track selection menu. Defaults to the empty + string.
+An ordered list of key/value string pairs for any unrecognized attribute keys. Defaults to + the empty list.
+Custom pairs should be accompanied by a non-empty
+ type value so that consumers can identify the
+ schema to which the pairs belong. If custom pairs are present and type is the
+ empty string, parsing continues normally, but parsers may generate a warning.
The WebVTT attributes object's properties are intended to be used by
+the embedding context (e.g. HTML) to populate the corresponding internal text track concepts.
+How format-provided values interact with values specified in the embedding context (e.g.
+<track> element attributes) is defined by the embedding specification. See
+whatwg/html issue #11665 for the
+ongoing HTML integration work.
A WebVTT chapter cue is a WebVTT cue whose cue text is interpreted as a
@@ -1474,6 +1627,9 @@ with the MIME type text/vtt. [[!RFC3629]]
When interpreted as a number, a WebVTT percentage must be in the range 0..100.
+A WebVTT attributes block consists of the following components, in the given order:
+ATTRIBUTES" (U+0041, U+0054, U+0054, U+0052, U+0049, U+0042, U+0055,
+ U+0054, U+0045, U+0053).The WebVTT attributes block is terminated by a blank line (two consecutive +WebVTT line terminators), exactly as for +WebVTT region definition blocks.
+ +The kind key is the only required key in a
+WebVTT attributes block. It must appear in the block to disambiguate the track kind.
+Without it, consumers cannot determine whether other common key names such as
+language and label apply to a recognized track kind, and may treat
+them as opaque. See WebVTT rules for parsing
+attribute key/value pairs.
A WebVTT attribute key/value pair consists of the following components, +in the given order:
+_) characters, where the first character is either an
+ ASCII alpha character or U+005F LOW
+ LINE (_). In other words, matching the production
+ [A-Za-z_][0-9A-Za-z_]*.:").
 and 
+ respectively.‎).-->" (U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS, U+003E GREATER-THAN SIGN).Keys are restricted to ASCII to ensure consistent case-folding and to avoid +ambiguity in key matching. Values may contain any Unicode characters (subject to the constraints +above) to support multilingual labels, language tags, and other internationalized content.
+ +The numeric character reference escape convention above is the same as that used
+in WebVTT for bidi mark characters in cue payloads (e.g."⁨").
A WebVTT comment block consists of the following components, in the given order:
WebVTT metadata text cues are only useful for scripted applications (e.g. using the +
WebVTT metadata text cues were originally intended for scripted applications (e.g. using the
metadata text track kind in a HTML text track).
A WebVTT parser, given an input byte stream, a text track list of cues -|output|, and a collection of CSS style sheets |stylesheets|, must decode the byte -stream using the UTF-8 decode algorithm, and then must parse the resulting -string according to the WebVTT parser algorithm below. This results in WebVTT cues -being added to |output|, and CSS style sheets being added to |stylesheets|. -[[!RFC3629]]
+|output|, a collection of CSS style sheets |stylesheets|, and optionally a +slot |attributes| for a WebVTT attributes object, must decode the byte stream using the +UTF-8 decode algorithm, and then must parse the resulting string +according to the WebVTT parser algorithm below. This results in WebVTT cues +being added to |output|, CSS style sheets being added to |stylesheets|, and +if a WebVTT attributes block is present, a WebVTT attributes object being set in +|attributes|. [[!RFC3629]]A WebVTT parser, specifically its conversion and parsing steps, is typically run asynchronously, with the input byte stream being updated incrementally as the resource is @@ -2549,6 +2766,9 @@ stream lacks this WebVTT file signature, then the parser aborts.
Otherwise, if |block| is a WebVTT region object, add |block| to |regions|.
Otherwise, if |block| is a WebVTT attributes object, and |attributes| has been + provided to this invocation of the WebVTT parser, let |attributes| be |block|.
collect a sequence of code points that are U+000A LINE FEED (LF) @@ -2589,6 +2809,8 @@ header set, the user agent must run the following steps:
Let |region| be null.
Let |attributes| be null.
Loop: Run these substeps in a loop:
@@ -2770,7 +2992,40 @@ header set, the user agent must run the following steps:Otherwise, if |seen cue| is false and |buffer| starts with the substring
+ "ATTRIBUTES" (U+0041, U+0054, U+0054, U+0052, U+0049, U+0042, U+0055, U+0054,
+ U+0045, U+0053), and the remaining characters in |buffer| (if any) are all ASCII
+ whitespace, then run these substeps:
Attributes creation: Let |attributes| be a new WebVTT attributes + object.
Let |attributes|'s kind be the empty + string.
Let |attributes|'s type be the empty + string.
Let |attributes|'s language be the + empty string.
Let |attributes|'s label be the empty + string.
Let |attributes|'s custom pairs + be an empty list.
Let |buffer| be the empty string.
Otherwise, if |attributes| is not null, then collect WebVTT attributes from + |buffer| using |attributes| for the results, and return |attributes|.
Otherwise, return null.
When the WebVTT parser algorithm says to collect WebVTT attributes +from a string |input| for a WebVTT attributes object |attributes|, the user agent must +run the following steps:
+ +Let |lines| be the result of splitting |input| on U+000A LINE FEED (LF) characters.
For each string |line| in |lines|, run the following substeps:
+If |line| does not contain a U+003A COLON character (:), then jump to
+ the step labeled next line.
Let |name| be the leading substring of |line| up to and excluding the first U+003A + COLON character.
If |name| is not a valid WebVTT attribute key, then jump to the step labeled + next line.
Let |value| be the trailing substring of |line| starting from the character + immediately after the first U+003A COLON character.
If |value| is not empty and its first character is a U+0020 SPACE or U+0009 + CHARACTER TABULATION (tab) character, remove that first character from |value|.
Let |value| be the result of + parsing + character references in |value|, with no additional allowed character.
Run the WebVTT rules for parsing attribute key/value pairs for |name| and + |value| against |attributes|.
Next line: Continue.
If |attributes|'s custom pairs is not + empty and |attributes|'s type is the empty string, + then, parsers may generate a warning.
+When the algorithm above says to collect WebVTT cue timings and settings from a string @@ -4130,6 +4438,83 @@ follows:
+The WebVTT rules for parsing attribute key/value pairs for a |name|/|value| pair +against a WebVTT attributes object |attributes| are as follows:
+ +kind"Let |normalized| be the result of + converting |value| to ASCII + lowercase.
+If |normalized| is one of "subtitles", "captions",
+ "descriptions", "chapters", or "metadata", set
+ |attributes|'s kind to |normalized|.
Otherwise, ignore the pair.
+type"Let |normalized| be the result of + converting |value| to ASCII + lowercase.
+If |normalized| is "custom" or starts with the prefix
+ "custom-" (U+0063, U+0075, U+0073, U+0074, U+006F, U+006D, U+002D), set
+ |attributes|'s type to |normalized|.
Otherwise, if |normalized| is not the empty string, ignore the pair. All non-custom + type values are reserved for future standardization.
+language"label"The kind key is the only required key in a
+WebVTT attributes block. It disambiguates the track kind and guards against naming
+conflicts: consumers that do not recognise a given kind value should treat the
+entire WebVTT attributes object as opaque. The type key further
+differentiates subtypes within a kind (for example, distinguishing varieties of
+metadata tracks). All non-custom type values are reserved for future
+standardization; authors needing custom subtypes must use "custom" or a value
+beginning with "custom-".
The kind, type, language, and
+label keys are matched
+ASCII case-insensitively
+to allow compatibility with implementations already using this pattern in production.
+Unrecognized keys are preserved in the
+custom pairs list for use by consuming
+applications.
The WebVTT attributes object's properties are consumed by the embedding
+context. How kind,
+language, and
+label relate to the corresponding attributes of an
+HTML <track> element is defined by the HTML specification. See
+whatwg/html issue #11665.
This section describes in some detail how to visually render WebVTT caption or