[ttml2] Regions association and inheritance clarification (#1274)

alexandercerutti has just created a new issue for https://github.com/w3c/ttml2:

== Regions association and inheritance clarification ==
Hi, I was trying to understand better everything that concerns regions association in a document.

I'm following the [TTML CR Snapshot](https://w3c.github.io/ttml2/).

When building the ISD, first of all the [inline regions are processed](https://w3c.github.io/ttml2/#procedure-process-inline-regions) and converted in out-of-line regions, only if the content element doesn't already belong a `region` attribute.

Then you proceed to associate a region `R` to the element (or make the element flow in to the region, I guess) when the [matching conditions are met](https://w3c.github.io/ttml2/#procedure-associate-region).

About the [[associate-region]](https://w3c.github.io/ttml2/#procedure-associate-region) procedure, I have clear the points:

1 (direct association),
2 (inheritance),
4 (fallback)
5 (default)

But number 3 is what I cannot understand.

> if the element contains a descendant element that specifies a [region](https://w3c.github.io/ttml2/#layout-attribute-region) attribute [...], then the element is associated with the region referenced by that attribute;

Said that element is a Content Element and content elements are those specified in [this list (Content module)](https://w3c.github.io/ttml2/#element-vocab-type-content):

body, br, div, p, span

And said that a `region` attribute can be specified on these elements:

body, div, p, span, image

This paragraph confuses me as hell as in my head, a region should be assigned only from a parent element to all the children (rule number 2).

By the way, although I cannot find a specific reason for that specification (if you know where I can find more details on this, I kindly ask you to link it), I can accept it, even if I'm still in confusion.

Let's assume this snippet, where `<p>` is our Content Element:

```xml
<tt>
    <body>
        <p>
            <span xml:id="el1" region="r1">
                abcd
                <span xml:id="el1.1" region="r2">...</span>
            </span>
            <span xml:id="el2">...</span>
            <span xml:id="el3" region="r3">...</span>
        </p>
    </body>
</tt>
```

According to that paragraph, **if I'm reading it correctly**, the `region="r1"` is hence now applied to `<p>` when composing the ISD.

This leads to a couple of questions:

1) Said that `el1.1` is also a descendant of `p`, I say `r1` is applied but `r2` isn't because, if I understood correctly, by the phrase "if a descendant element" it is intended that the lookup for a region should terminate at the first result.
  1.1) Is this right? If so, what happens to `r2`? Is it applied only to eventual descendant of `el1.1`?

2) Does that mean that the content element becomes `<p region="r1">...</p>` and therefore the rule number 2 of the above list enters in action? This would mean that all the children of `<p>` start to inherit properties from `r1` (every property according to it's inheritance rules).

3) What happens, just like the case above, if two or more children have a region attribute? Do they merge on `<p>`? (so, does `<p>` flow in both?)

3.1) If yes, what if both regions own timing attributes? Who wins?
3.2) If no, I can guess that the lookup ends only at the first found, it doesn't matter the depth of the attribute.

4) The same questions apply if the content element is the `body`.

Thank you very much!

Please view or discuss this issue at https://github.com/w3c/ttml2/issues/1274 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 30 May 2024 22:58:32 UTC