From 5a04dec52bd6a7fd9b3ed8f51424acc5c72111b2 Mon Sep 17 00:00:00 2001 From: Jer Noble Date: Thu, 6 Feb 2025 09:33:12 -0800 Subject: [PATCH] Add support for ::cue-container Fixes #516 In order to align the capabilities of WebVTT with CEA standards like 708, add the concept of a "WebVTT block backgound box", which is defined as a block-level wrapper around the WebVTT cue's contents. To allow authors to specify styles that apply to this block background object, add a new selector `::cue-container` that matches it. UAs which provide FCC required styling information for "window background & opacity" can do so via this new selector in UA-provided style sheets. --- index.bs | 43 ++++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/index.bs b/index.bs index 8180371..ff6e3ea 100644 --- a/index.bs +++ b/index.bs @@ -285,8 +285,8 @@ one line except when a line break is definitely necessary.

This section is non-normative.

CSS style sheets that apply to an HTML page that contains a video element can -target WebVTT cues and regions in the video using the ''::cue'', ''::cue()'', ''::cue-region'' and -''::cue-region()'' pseudo-elements.

+target WebVTT cues and regions in the video using the ''::cue'', ''::cue()'', ''::cue-backdrop'', +''::cue-region'' and ''::cue-region()'' pseudo-elements.

@@ -4722,7 +4722,8 @@ constraints: [[!CSS22]]

document, the element must not match any selector that would match the element itself.

This element exists only to be the originating element for the - ''::cue'', ''::cue()'', ''::cue-region'' and ''::cue-region()'' pseudo-elements.

+ ''::cue'', ''::cue()'', ''::cue-backdrop'', ''::cue-region'' and ''::cue-region()'' + pseudo-elements.

  • @@ -4786,7 +4787,11 @@ constraints: [[!CSS22]]

    sheets after their boxes are generated, as described below.)
  • The children of the |nodes| must be wrapped in an anonymous box whose 'display' property has - the value ''display/inline''. This is the WebVTT cue background box.
  • + the value ''display/inline''. This is the WebVTT cue inline background box. + +
  • The WebVTT cue inline background box must be wrapped in an anonymous box whose 'display' + property has the value ''display/block''. This is the WebVTT cue block background + box.
  • Runs of children of WebVTT Ruby Objects that are not WebVTT Ruby Text Objects must be wrapped in anonymous boxes whose @@ -4873,8 +4878,8 @@ corresponding cue's WebVTT cue text alignment:

    The 'color' property on the (root) list of WebVTT Node Objects must be set to ''rgba(255,255,255,1)''. [[!CSS3-COLOR]]

    -

    The 'background' shorthand property on the WebVTT cue background box and on WebVTT Ruby -Text Objects must be set to ''rgba(0,0,0,0.8)''. [[!CSS3-COLOR]]

    +

    The 'background' shorthand property on the WebVTT cue inline background box and on +WebVTT Ruby Text Objects must be set to ''rgba(0,0,0,0.8)''. [[!CSS3-COLOR]]

    The 'white-space' property on the (root) list of WebVTT Node Objects must be set to ''white-space/pre-line''. [[!CSS22]]

    @@ -4957,6 +4962,8 @@ apply to WebVTT. This section does not apply to user agents that do not suppo

    The ''::cue(|selector|)'' pseudo-element represents a cue or element inside a cue that match the given selector.

    +

    The ''::cue-backdrop'' pseudo-element represents the element inside a cue which holds the cue's contents.

    +

    The ''::cue-region'' pseudo-element represents a region.

    The ''::cue-region(|selector|)'' pseudo-element represents a region or element inside a region @@ -5302,10 +5309,10 @@ pseudo-elements defined below won't have any effect according to this specificat

    The ''::cue'' pseudo-element

    -

    The ::cue pseudo-element (with no argument) matches any list of WebVTT Node -Objects constructed for the matched element, with the exception that the properties -corresponding to the 'background' shorthand must be applied to the WebVTT cue background box -rather than the list of WebVTT Node Objects.

    +

    The ::cue pseudo-element (with no argument) matches any list of WebVTT +Node Objects constructed for the matched element, with the exception that the properties +corresponding to the 'background' shorthand must be applied to the WebVTT cue inline background +box rather than the list of WebVTT Node Objects.

    The following properties apply to the ''::cue'' pseudo-element with no argument; other properties set on the pseudo-element must be ignored:

    @@ -5472,8 +5479,22 @@ when the selector does not contain the '':past'' and '':future'' pseudo-classes:

    As a special exception, the properties corresponding to the 'background' shorthand, when they would have been applied to the list of WebVTT Node Objects, must instead be applied to the -WebVTT cue background box.

    +WebVTT cue inline background box.

    + +

    The ''::cue-backdrop'' pseudo-element

    + +

    The ::cue-backdrop pseudo-element matches the WebVTT +cue block background box constructed for the matched element.

    + +

    The following properties apply to the ''::cue-backdrop'' pseudo-element; other +properties set on the pseudo-element must be ignored:

    +
      +
    • the properties corresponding to the 'background' shorthand
    • +
    • 'padding'
    • +
    • the properties corresponding to the 'border' shorthand
    • + +

    The '':past'' and '':future'' pseudo-classes