TTML/changeProposal002

From W3C Wiki
Jump to: navigation, search


Amendments to the extent and origin Attribute - PENDING REVIEW

  • The following is a Change Proposal for Issue 176
  • Owner: Jerry Smith.
  • Date: April 18, 2012.

Summary

A common industry practice today is to apply positioning on a per-caption basis. Carrying positioning information in a succinct manner is therefore essential to successfully replicating 608 in IP delivery.

Since TTML currently models captions as content, styles, and regions, the presentation of an individually positioned caption necessitates the presence of precursor style and region information. This requires the retransmission of this static state at frequent intervals. It also places burden on the client to apply the set of rules for determining temporal positioning and styling by aggregating the three types of data.

CEA-608 captions, in contrast, are flat and self-contained. You can enter the stream at any individual caption and all the information needed to present that caption is sent at the time of presentation. Optional components are not sent, only the attributes which have been selected or overridden.

The proposal would update

to allow a caption in its simplest (and most common form) could be represented by:

   <p begin="nn:nn:nn:nn" end="nn:nn:nn:nn" 
      tts:origin="10% 75%" tts:extent="1em 20em">
      The quick brown fox</p>

This would result in dramatic simplification for this most common case, allowing smaller "headless" TTML documents, reduced XML tree sizes, and easier parsing both by tools and rendering agents.

Furthermore, this will make TTML more amenable to read/write situations where tools needed to import existing TTML and edit it. It is currently difficult to map TTML to today's caption editing experiences. One can envision a day when tools will emerge that facilitate TTML's unique content model, but they do not exist today.

Tools which can import/export many other caption formats would benefit from being able to read TTML with as much ease as alternate formats. Making positioning a direct attribute of content serves this scenario and makes it easier to parse back into discrete caption attributes.

It should be noted that this usage actually validates today under W3C XSD schema for TTML and that large captioning tools providers have already begun producing such TTML, making this a not unlikely de facto practice.

The proposal is that that the specification be updated to formally allow this.


Details

origin and extent applies to

8.2.14 tts:origin and tts:extent would need to have "applies to" amended to include all block elements as well as regions.

Section 9.3.3. step 6 amended as follows

 for each body, div, and p element that is not associated with a tts:display
 style property with the value none, map the element to the equivalent of a
 distinct fo:block element, populating the style properties of fo:block by
 using the computed style set associated with each original TTML content
 element; additionally if the element has an origin or extent attribute,
 place the mapped block element inside an fo:block-container element with
 an absolute-position attribute with value fixed, and where the element's
 position and extent are mapped to equivalent top, left, width, and height
 attributes;

Add section 9.3.5 Elaborated Example 2 (Informative)

An example of the processing steps described above is elaborated below, starting with Example – Sample Source Document.

Example – Sample Source Document

<tt tts:extent="640px 480px" xml:lang="en"
  xmlns="http://www.w3.org/ns/ttml"
  xmlns:tts="http://www.w3.org/ns/ttml#styling">
   <body xml:id="b1">
    <div xml:id="d1" begin="0s" dur="2s">
      <p xml:id="p1" tts:origin="10px 300px" tts:extent="300px 40px">Text 1</p>
      <p xml:id="p2" tts:origin="20px 300px" tts:extent="290px 40px">Text 2</p>
    </div>
  </body>
</tt>

Intermediate

<tt tts:extent="640px 480px" xml:lang="en"
  xmlns="http://www.w3.org/ns/ttml"
  xmlns:tts="http://www.w3.org/ns/ttml#styling">
  <head>
    <layout>
      <region xml:id="default">
        <style tts:origin="0% 0%"/>
        <style tts:extent="100% 100%"/>
   	<body xml:id="b1">
  	  <div xml:id="d1" begin="0s" dur="2s">
  	    <p xml:id="p1" tts:origin="10px 300px" tts:extent="300px 40px">Text 1</p>
  	    <p xml:id="p2" tts:origin="20px 300px" tts:extent="290px 40px">Text 2</p>
 	  </div>
 	</body>
      </region>
    </layout>
  </head>
</tt>

Example – XSL FO Document – [0s,2s)

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="m1"
      page-width="640px" page-height="480px">
      <fo:region-body/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="m1">
    <fo:flow flow-name="xsl-region-body">
      <!-- region (default) -->
      <fo:block-container id="default" absolute-position="fixed"
        left="0%" top="0%" width="100%" height="100%">
        <!-- body (b1) -->
        <fo:block id="b1">
          <!-- div (d1) -->
          <fo:block id="d1">
            <!-- p (p1) -->
            <fo:block-container id="p1-1" absolute-position="fixed"
                  left="20px" top="300px" width="300px" height="40px">
              <fo:block id="p1">
                <fo:inline>Text 1</fo:inline>
              </fo:block>
              <!-- TBD do we need filler here?-->
            </fo:block-container>
            <fo:block-container id="p1-2" absolute-position="fixed"
                   left="10px" top="300px" width="290px" height="40px">
              <fo:block id="p1">
                <fo:inline>Text 2</fo:inline>
              </fo:block>
              <!-- TBD do we need filler here?-->
            </fo:block-container>
          </fo:block>
        </fo:block>
      </fo:block-container>
      <!-- body's space filler -->
      <fo:block
        space-after.optimum="96px"
        space-after.maximum="96px"
        space-after.conditionality="retain"/>
    </fo:flow>
  </fo:page-sequence>
</fo:root>

Impact

  • Brings specification in line with current practice permitted by schema.
  • Produces succinct documents for common case captioning scenarios.
  • Reduces document size and XML tree size.
  • Makes content model more consistent with CSS content positioning behavior.

Resolution

[GA] Implemented in https://dvcs.w3.org/hg/ttml/rev/c9fd49837446.