0

Suppose we have the following TTML document:

<tt xml:lang="en" xmlns="http://www.w3.org/ns/ttml" xmlns:tts="http://www.w3.org/ns/ttml#styling">
  <head>
    <layout>
      <region xml:id="a"/>
      <region xml:id="b"/>
    </layout>
  </head>
  <body>
    <div region="a">
      <p region="b">abc</p>
    </div>
  </body>
</tt>

According to 9.3.2 Intermediate Synchronic Document Construction, what visual marks will be produced by regions a and b?

At first I was expecting a to produce nothing and b to produce abc, but the specification seems to contradict this implying that the anonymous span abc will be pruned (directly or indirectly) both when evaluating region a and b, which seems a bit counter-intuitive.

Nigel Megitt
  • 158
  • 5
Michał Trybus
  • 11,526
  • 3
  • 30
  • 42

1 Answers1

1

The algorithm prunes the content and nothing is displayed. This is captured on the W3C TTWG Issue tracker in Issue-341.

Why would you author a document with this behaviour though - I mean, what would you intend to happen? Under which conditions would you not achieve the same thing simply by removing the region reference from the div? I ask for interest - if there's a use case here then we can use it to help drive the spec development in TTML.

Nigel Megitt
  • 158
  • 5
  • At first I thought it could be useful to assign a whole `div` to a region using the region attribute, and then single descendants of that `div` could be "taken out" of the region and put in a different one. But after considering this for a while I got to the realization that this could lead to creation of invalid structure of elements in ISD (for example `span` being placed directly in a `region`) so it seems I understand the reason the spec defines the algorithm this way now. Thanks. – Michał Trybus Aug 26 '15 at 06:38
  • I am wondering if it would be better (for the spec) to completely disallow the use of `region` attribute for elements which already have an ancestor with a specified region, since using the `region` attribute on such elements is equivalent to setting `tts:display` to `none` and that seems a bit counter-intuitive. – Michał Trybus Aug 26 '15 at 06:47
  • That rule could work - in TTML2 it will be a bit more complex because anonymous inline regions can be specified by putting tts:origin and tts:extent attributes for example directly on content elements. But the same general idea can apply. – Nigel Megitt Aug 26 '15 at 08:17