diff --git a/index.bs b/index.bs index 8ddb0e6..32dfd49 100644 --- a/index.bs +++ b/index.bs @@ -4068,13 +4068,8 @@ manner suiting the user.

  • Let |left| be ''|offset| %''. [[!CSS-VALUES]]

  • -
  • -

    Apply the terms of the CSS specifications to |nodes| with the same constraints that are - used when they are applied to |nodes| of a |cue| that is not part of a region.

    - -

    Let |boxes| be the boxes generated as descendants of the initial containing block, along - with their positions.

    -
  • +
  • Obtain a set of CSS boxes |boxes| positioned relative to an initial containing + block.

  • If there are no line boxes in |boxes|, skip the remainder of these substeps for |cue|. The cue is ignored.

  • @@ -4100,9 +4095,12 @@ manner suiting the user.

    dragging them to another location on the video, or even off the video entirely.

    -

    When the algorithm above requires that the user agent apply WebVTT cue settings to -obtain CSS boxes from a list of WebVTT Node Objects |nodes|, the user agent must run the -following algorithm.

    + +

    Processing cue settings

    + +

    When the processing algorithm above requires that the user agent apply WebVTT cue +settings to obtain CSS boxes from a list of WebVTT Node Objects |nodes|, the user agent +must run the following algorithm.

      @@ -4328,112 +4326,8 @@ following algorithm.

      CSS values used by the next section to set CSS properties for the rendering; ''vw'' and ''vh'' are CSS units.) [[!CSS-VALUES]]

      -
    1. - -

      Apply the terms of the CSS specifications to |nodes| within the following constraints, thus - obtaining a set of CSS boxes positioned relative to an initial containing block: [[!CSS22]]

      - - - -

      Let |boxes| be the boxes generated as descendants of the initial containing block, along with - their positions.

      - -
    2. +
    3. Obtain a set of CSS boxes |boxes| positioned relative to an initial containing + block.

    4. If there are no line boxes in |boxes|, skip the remainder of these substeps for |cue|. The cue is ignored.

    5. @@ -4674,8 +4568,112 @@ following algorithm.

    -

    Applying CSS properties to WebVTT Node Objects

    +

    Obtaining CSS boxes

    + +

    When the processing algorithm above requires that the user agent obtain a set of CSS +boxes |boxes|, then apply the terms of the CSS specifications to |nodes| within the following +constraints: [[!CSS22]]

    + + + +

    Let |boxes| be the boxes generated as descendants of the initial containing block, along with +their positions.

    + + +

    Applying CSS properties to WebVTT Node Objects

    When following the rules for updating the display of WebVTT text tracks, user agents must set properties of WebVTT Node Objects at the CSS user agent cascade diff --git a/index.html b/index.html index b08eaf4..1c561e2 100644 --- a/index.html +++ b/index.html @@ -1569,11 +1569,10 @@

    Table of Contents

  • 7 Rendering
      -
    1. - 7.1 Processing model -
        -
      1. 7.1.1 Applying CSS properties to WebVTT Node Objects -
      +
    2. 7.1 Processing model +
    3. 7.2 Processing cue settings +
    4. 7.3 Obtaining CSS boxes +
    5. 7.4 Applying CSS properties to WebVTT Node Objects
  • 8 CSS extensions @@ -4398,10 +4397,8 @@

    Let left be offset %. [CSS-VALUES]

  • -

    Apply the terms of the CSS specifications to nodes with the same constraints that are - used when they are applied to nodes of a cue that is not part of a region.

    -

    Let boxes be the boxes generated as descendants of the initial containing block, along - with their positions.

    +

    Obtain a set of CSS boxes boxes positioned relative to an initial containing + block.

  • If there are no line boxes in boxes, skip the remainder of these substeps for cue. The cue is ignored.

    @@ -4418,9 +4415,10 @@

    User agents may allow the user to override the above algorithm’s positioning of cues, e.g. by dragging them to another location on the video, or even off the video entirely.

    -

    When the algorithm above requires that the user agent apply WebVTT cue settings to -obtain CSS boxes from a list of WebVTT Node Objects nodes, the user agent must run the -following algorithm.

    +

    7.2. Processing cue settings

    +

    When the processing algorithm above requires that the user agent apply WebVTT cue +settings to obtain CSS boxes from a list of WebVTT Node Objects nodes, the user agent +must run the following algorithm.

    1. If the WebVTT cue writing direction is horizontal, then let writing-mode be "horizontal-tb". Otherwise, if the WebVTT @@ -4561,75 +4559,8 @@

      vw and vh are CSS units.) [CSS-VALUES]

    2. -

      Apply the terms of the CSS specifications to nodes within the following constraints, thus - obtaining a set of CSS boxes positioned relative to an initial containing block: [CSS22]

      -
        -
      • -

        The document tree is the tree of WebVTT Node Objects rooted at nodes.

        -
      • -

        For the purpose of selectors in STYLE blocks of a WebVTT file, the style sheet must apply to - a hypothetical document that contains a single empty element with no explicit name, no - namespace, no attributes, no classes, no IDs, and unknown primary language, that acts like the media element for the text tracks that were sourced from the given WebVTT file. - The selectors must not match other text tracks for the same media element. In this - hypothetical 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.

        -
      • -

        For the purpose of determining the cascade of the declarations in - STYLE blocks of a WebVTT file, the relative order of appearance of the style sheets must be the - same order as they were added to the collection, and the order of appearance of the collection - must be after any style sheets that apply to the associated video element’s - document.

        -
        - -

        For example, given the following (invalid) HTML document:

        -
        <!doctype html>
        -<title>Invalid cascade example</title>
        -<video controls autoplay src="video.webm">
        - <track default src="track.vtt">
        -</video>
        -<style>
        - ::cue { color:red }
        -</style>
        -
        -

        ...and the "track.vtt" file contains:

        -
        WEBVTT
        -
        -STYLE
        -::cue { color:lime }
        -
        -00:00:00.000 --> 00:00:25.000
        -Red or green?
        -
        -

        The color:lime declaration would win, because it is last in the cascade, even though the style element is after the video element in the document order.

        -
        -
      • -

        For the purpose of resolving URLs in STYLE blocks of a WebVTT - file, or any URLs in resources referenced from STYLE blocks of a WebVTT file, if the URL’s - scheme is not "data", then the user agent must act as if the URL failed to - resolve.

        -

        Supporting external resources with @import or background-image would be a new ability for media elements and track elements to issue - network requests as the user watches the video, which could be a privacy issue.

        -
      • -

        For the purposes of processing by the CSS specification, WebVTT Internal Node Objects are equivalent to elements with the same - contents.

        -
      • For the purposes of processing by the CSS specification, WebVTT - Text Objects are equivalent to Text nodes. -
      • No style sheets are associated with nodes. (The nodes are subsequently restyled using style - 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 inline. This is the WebVTT cue background box. -
      • Runs of children of WebVTT Ruby Objects that are not WebVTT Ruby Text Objects must be wrapped in anonymous boxes - whose display property has the value ruby-base. [CSS3-RUBY] -
      • Properties on WebVTT Node Objects 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.) -
      • Text runs must be wrapped according to the CSS line-wrapping rules. -
      • The viewport (and initial containing block) is video’s rendering area. -
      -

      Let boxes be the boxes generated as descendants of the initial containing block, along with - their positions.

      +

      Obtain a set of CSS boxes boxes positioned relative to an initial containing + block.

    3. If there are no line boxes in boxes, skip the remainder of these substeps for cue. The cue is ignored.

      @@ -4775,7 +4706,74 @@

      Done positioning: Return boxes.

    -

    7.1.1. Applying CSS properties to WebVTT Node Objects

    +

    7.3. Obtaining CSS boxes

    +

    When the processing algorithm above requires that the user agent obtain a set of CSS +boxes boxes, then apply the terms of the CSS specifications to nodes within the following +constraints: [CSS22]

    +
      +
    • +

      The document tree is the tree of WebVTT Node Objects rooted at nodes.

      +
    • +

      For the purpose of selectors in STYLE blocks of a WebVTT file, the style sheet must apply to a + hypothetical document that contains a single empty element with no explicit name, no namespace, no + attributes, no classes, no IDs, and unknown primary language, that acts like the media + element for the text tracks that were sourced from the given WebVTT file. The selectors + must not match other text tracks for the same media element. In this hypothetical + 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.

      +
    • +

      For the purpose of determining the cascade of the declarations in STYLE + blocks of a WebVTT file, the relative order of appearance of the style sheets must be the same + order as they were added to the collection, and the order of appearance of the collection must be + after any style sheets that apply to the associated video element’s document.

      +
      + +

      For example, given the following (invalid) HTML document:

      +
      <!doctype html>
      +<title>Invalid cascade example</title>
      +<video controls autoplay src="video.webm">
      + <track default src="track.vtt">
      +</video>
      +<style>
      + ::cue { color:red }
      +</style>
      +
      +

      ...and the "track.vtt" file contains:

      +
      WEBVTT
      +
      +STYLE
      +::cue { color:lime }
      +
      +00:00:00.000 --> 00:00:25.000
      +Red or green?
      +
      +

      The color:lime declaration would win, because it is last in the cascade, even though the style element is after the video element in the document order.

      +
      +
    • +

      For the purpose of resolving URLs in STYLE blocks of a WebVTT + file, or any URLs in resources referenced from STYLE blocks of a WebVTT file, if the URL’s scheme + is not "data", then the user agent must act as if the URL failed to resolve.

      +

      Supporting external resources with @import or background-image would be a new ability for media elements and track elements to issue + network requests as the user watches the video, which could be a privacy issue.

      +
    • +

      For the purposes of processing by the CSS specification, WebVTT Internal Node Objects are equivalent to elements with the same + contents.

      +
    • For the purposes of processing by the CSS specification, WebVTT Text + Objects are equivalent to Text nodes. +
    • No style sheets are associated with nodes. (The nodes are subsequently restyled using style + 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 inline. This is the WebVTT cue background box. +
    • Runs of children of WebVTT Ruby Objects that are not WebVTT Ruby Text Objects must be wrapped in anonymous boxes whose display property has the value ruby-base. [CSS3-RUBY] +
    • Properties on WebVTT Node Objects 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.) +
    • Text runs must be wrapped according to the CSS line-wrapping rules. +
    • The viewport (and initial containing block) is video’s rendering area. +
    +

    Let boxes be the boxes generated as descendants of the initial containing block, along with +their positions.

    +

    7.4. Applying CSS properties to WebVTT Node Objects

    When following the rules for updating the display of WebVTT text tracks, user agents must set properties of WebVTT Node Objects at the CSS user agent cascade layer as defined in this section. [CSS22]

    @@ -5849,7 +5847,7 @@

    align, in §9.1
  • AlignSetting, in §9.1 -
  • apply WebVTT cue settings, in §7.1 +
  • apply WebVTT cue settings, in §7.2
  • attach a WebVTT Internal Node Object, in §6.4
  • auto @@ -5927,6 +5925,7 @@

    List of WebVTT Node Objects, in §6.4
  • "lr", in §9.1
  • lr, in §9.1 +
  • obtain a set of CSS boxes, in §7.3
  • parse a percentage string, in §6.2
  • parse the WebVTT cue settings, in §6.3
  • :past, in §8.2.2 @@ -5978,7 +5977,7 @@

    WebVTT comment block, in §4.1
  • WebVTT cue, in §3.1
  • WebVTT cue automatic position, in §3.1 -
  • WebVTT cue background box, in §7.1 +
  • WebVTT cue background box, in §7.3
  • WebVTT cue block, in §4.1
  • WebVTT cue bold span, in §4.2.2
  • WebVTT cue box, in §3.1 @@ -6458,7 +6457,7 @@

    I
  • 6.6. WebVTT rules for extracting the chapter title
  • 7.1. Processing model (2) -
  • 7.1.1. Applying CSS properties to WebVTT Node Objects (2) +
  • 7.4. Applying CSS properties to WebVTT Node Objects (2)
  • 8.2. Processing model (2) (3)
  • 8.2.2. The :past and :future pseudo-classes (2)
  • 8.2.3. The ::cue-region pseudo-element @@ -6473,7 +6472,7 @@

    I
  • 6.6. WebVTT rules for extracting the chapter title
  • 7.1. Processing model -
  • 7.1.1. Applying CSS properties to WebVTT Node Objects +
  • 7.4. Applying CSS properties to WebVTT Node Objects
  • 9.1. The VTTCue interface (2) (3) (4) (5) (6) (7) (8) @@ -6492,7 +6491,7 @@

    I
  • 4.4. WebVTT cue settings
  • 6.1. WebVTT file parsing
  • 6.3. WebVTT cue timings and settings parsing (2) -
  • 7.1. Processing model (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15) (16) (17) (18) (19) +
  • 7.2. Processing cue settings (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15) (16) (17) (18) (19)
  • 9.1. The VTTCue interface (2) (3) (4) (5) @@ -6501,7 +6500,7 @@

    I @@ -6510,7 +6509,7 @@

    I @@ -6519,7 +6518,7 @@

    I @@ -6529,7 +6528,7 @@

    I
  • 3.1. WebVTT cues (2) (3) (4) (5) (6) (7) (8)
  • 6.1. WebVTT file parsing
  • 6.3. WebVTT cue timings and settings parsing -
  • 7.1. Processing model (2) (3) (4) (5) +
  • 7.2. Processing cue settings (2) (3) (4) (5)
  • 9.1. The VTTCue interface (2) (3) (4) @@ -6554,7 +6553,7 @@

    I #cue-computed-lineReferenced in: @@ -6583,7 +6582,7 @@

    I @@ -6592,7 +6591,7 @@

    I @@ -6617,7 +6616,8 @@

    I @@ -6644,7 +6644,8 @@

    I @@ -6654,7 +6655,8 @@

    I
  • 3.1. WebVTT cues
  • 4.4. WebVTT cue settings
  • 6.3. WebVTT cue timings and settings parsing -
  • 7.1. Processing model (2) (3) (4) +
  • 7.1. Processing model +
  • 7.2. Processing cue settings (2) (3)
  • 9.1. The VTTCue interface (2) @@ -6670,7 +6672,8 @@

    I #cue-computed-position-alignmentReferenced in: @@ -6689,7 +6692,7 @@

    I
  • 3.1. WebVTT cues (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12)
  • 6.1. WebVTT file parsing
  • 6.3. WebVTT cue timings and settings parsing (2) (3) (4) (5) -
  • 7.1.1. Applying CSS properties to WebVTT Node Objects (2) +
  • 7.4. Applying CSS properties to WebVTT Node Objects (2)
  • 9.1. The VTTCue interface (2) (3) (4) (5) @@ -6698,7 +6701,7 @@

    I @@ -6708,7 +6711,7 @@

    I
  • 3.1. WebVTT cues (2) (3) (4)
  • 6.1. WebVTT file parsing
  • 6.3. WebVTT cue timings and settings parsing -
  • 7.1.1. Applying CSS properties to WebVTT Node Objects +
  • 7.4. Applying CSS properties to WebVTT Node Objects
  • 9.1. The VTTCue interface (2) (3) @@ -6717,7 +6720,7 @@

    I @@ -6726,7 +6729,7 @@

    I @@ -6735,7 +6738,7 @@

    I @@ -6759,7 +6762,7 @@

    I
  • 6.2. WebVTT region settings parsing
  • 6.3. WebVTT cue timings and settings parsing
  • 7.1. Processing model (2) (3) -
  • 7.1.1. Applying CSS properties to WebVTT Node Objects +
  • 7.4. Applying CSS properties to WebVTT Node Objects
  • 9.2. The VTTRegion interface (2) (3) (4) (5) (6) (7) (8) (9) (10) @@ -7224,7 +7227,7 @@

    I
  • 6.2. WebVTT region settings parsing
  • 6.5. WebVTT cue text DOM construction rules
  • 7.1. Processing model -
  • 7.1.1. Applying CSS properties to WebVTT Node Objects (2) (3) (4) +
  • 7.4. Applying CSS properties to WebVTT Node Objects (2) (3) (4)
  • 8.1. Introduction (2)
  • 8.2.3. The ::cue-region pseudo-element (2) (3) (4) @@ -7260,8 +7263,8 @@

    I @@ -7343,7 +7347,7 @@

    I @@ -7352,8 +7356,8 @@

    I @@ -7364,8 +7368,8 @@

    I
  • 6.5. WebVTT cue text DOM construction rules
  • 6.6. WebVTT rules for extracting the chapter title -
  • 7.1. Processing model -
  • 7.1.1. Applying CSS properties to WebVTT Node Objects (2) +
  • 7.3. Obtaining CSS boxes +
  • 7.4. Applying CSS properties to WebVTT Node Objects (2)
  • 8.2.1. The ::cue pseudo-element @@ -7401,7 +7405,7 @@

    I
  • 6.5. WebVTT cue text DOM construction rules (2)
  • 6.6. WebVTT rules for extracting the chapter title -
  • 7.1. Processing model +
  • 7.3. Obtaining CSS boxes +