[ttml2] Clarify behaviour of tts:showBackground="whenActive" when xml:space="default" (#1208)

paul-bivol has just created a new issue for https://github.com/w3c/ttml2:

== Clarify behaviour of tts:showBackground="whenActive" when xml:space="default" ==
Given a region having tts:showBackground="whenActive" and the content selected into it has xml:space="default", contains only whitespaces and is temporally active, is the region background visible in this case?
In other words, is whitespace trimming and collapse performed before or after deciding if a region background is rendered or not?

Here is an example:
```
<?xml version="1.0" encoding="UTF-8"?>
<tt xmlns="http://www.w3.org/ns/ttml"
    xmlns:ttp="http://www.w3.org/ns/ttml#parameter"
    xmlns:ebuttm="urn:ebu:tt:metadata"
    xmlns:ebutts="urn:ebu:tt:style"
    xmlns:tts="http://www.w3.org/ns/ttml#styling"
    xml:lang="en"
    ttp:cellResolution="30 30"
    >
    <head>
        <styling>
        </styling>
        <layout>
            <region xml:id="reg1" tts:showBackground="whenActive" tts:origin="25% 5%" tts:extent="20% 40%" tts:backgroundColor="#f09020"/>
            <region xml:id="reg2" tts:showBackground="whenActive" tts:origin="46% 5%" tts:extent="20% 40%" tts:backgroundColor="#30a0f0"/>
            <region xml:id="reg3" tts:showBackground="whenActive" tts:origin="67% 5%" tts:extent="20% 40%" tts:backgroundColor="#10f010"/>
        </layout>
    </head>
    <body>
        <div xml:space="default">
            <p region="reg1" begin="00:00:00.000" end="00:00:10.000" tts:backgroundColor="#000000">
                p11
            </p>
            <p region="reg1" begin="00:00:20.000" end="00:00:30.000" tts:backgroundColor="#000000">
                p12
            </p>

            <p region="reg2" tts:backgroundColor="#000000">
                <span begin="00:00:00.000" end="00:01:00.000">
                </span>
                <span begin="00:00:00.000" end="00:00:10.000">p21</span>
            </p>
            <p region="reg2" tts:backgroundColor="#000000">
                <span begin="00:00:00.000" end="00:01:00.000">
                </span>
                <span begin="00:00:20.000" end="00:00:30.000">p22</span>
            </p>

            <p region="reg3" tts:backgroundColor="#000000" xml:space="preserve">
                <span begin="00:00:00.000" end="00:00:10.000">p31</span>
            </p>
            <p region="reg3" tts:backgroundColor="#000000" xml:space="preserve">
                <span begin="00:00:20.000" end="00:00:30.000">p32</span>
            </p>
        </div>
    </body>
</tt>

```
There is no ambiguity for reg1 as the whitespaces become temporally inactive when the rest of the text does.
There is no ambiguity for reg3 as whitespaces are preserved and should be rendered.
For reg2 there will be two whitespace only anonymous spans and a third whitespace only span surrounding a non-whitespace span that will become temporally inactive. If whitespace trimming happens before deciding if the region background is to be rendered then the background should dissapear. Otherwise it should continue to be rendered.

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

Received on Wednesday, 1 July 2020 09:38:27 UTC