[ttml1] Chained Referential Styling spec vs example mismatch

cconcolato has just created a new issue for https://github.com/w3c/ttml1:

== Chained Referential Styling spec vs example mismatch ==
While reading TTML1 I came on the following sentence in "8.4.1.3 Chained Referential Styling":
"If the same style property is specified in more than one referenced style set, then the last referenced style set applies, where the order of application starts from the affected element and proceeds to referenced style sets, and, in turn, to subsequent referenced style sets."

It talks about the "last" style applying. I wondered what "last" meant, according to which order. The next sentence says the order starts from the element to referenced style sets. This seems to me contradicting the example below in the spec.

I checked the rendering of IMSC.js and TTPE and both render the following code with: "Yellow Monospace" (in yellow) and "White Monospace" (in white).
```xml
<tt xml:lang="" xmlns="http://www.w3.org/ns/ttml">
<head>
<styling xmlns:tts="http://www.w3.org/ns/ttml#styling">
<style xml:id="s1" tts:color="white" tts:fontFamily="monospaceSerif"/>
<style xml:id="s2" style="s1" tts:color="yellow"/>
</styling>
</head>
<body>
<div>
<p style="s1">White Monospace</p>
<p style="s2">Yellow Monospace</p>
</div>
</body>
</tt>
```

This seems contradictory also to the algorithm specified in "8.4.4.2 Specified Style Set Processing", which says (removing unnecessary parts):
```
1. [initialization] initialize the specified style set SSS of E to the empty set;
2. [referential and chained referential styling] for each style element SREF referenced by a style attribute specified on E, and in the order specified in the style attribute, then, if SREF is a descendant of a styling element, merge the specified style set of SREF, SSS(SREF), into the specified style set of E, SSS(E);
4. [inline styling] for each style property P expressed as a specified styling attribute of E, merge P into the specified style set of E, SSS(E);
```

I interpret this as follows:
```
1. SSS(<p style="s2">) = empty
2. get the SSS(s2), i.e:
  1. SSS(s2) = empty
  2. get SSS(s1), i.e.:
     1. SSS(s1) = empty
     4. SSS(s1) = color:white
     merge SSS(s1) into SSS(s2): SSS(s2) = color:white
  4. merge inline property: SSS(s2) = color:yellow
  merge SSS(s2) into SSS(<p style="s2">):  SSS(<p style="s2">) = color:yellow
```

Conclusion: I think the example is correct. The sentence in 8.4.1.3 is wrong. Given that it is duplicating the algorithm of 8.4.4.2, I would suggest removing the sentence in 8.1.4.3. There is no need to duplicate text.

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

Received on Friday, 1 December 2017 00:27:42 UTC