Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify anonymous span construction and implicit duration semantics #318

Merged
merged 4 commits into from
Jan 21, 2018

Conversation

palemieux
Copy link
Contributor

@palemieux palemieux commented Jan 4, 2018

Closes #193
Closes #310

Copy link
Contributor

@cconcolato cconcolato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe changing "timing semantics" to "timing behavior"?

@nigelmegitt
Copy link
Contributor

Copy link
Contributor

@nigelmegitt nigelmegitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting a formatting change but more importantly I don't agree with the given explanation for the behaviour (I do agree with the described behaviour though!).

spec/ttml1.xml Outdated
@@ -8094,6 +8094,30 @@ based timing or event based timing in <bibref ref="smil21"/>, where the specific
<specref ref="time-expression-semantics-smpte"/> apply.</p>
</item>
</ulist>
<p>The following example illustrates the timing semantics of anonymous spans that are children of sequential time containers. The words <emph>Hello</emph> and <emph>Allo</emph> are both contained in anonymous spans that are children of a sequential time container (the <code>p</code> element). As such, neither <emph>Hello</emph> nor <emph>Allo</emph> will be displayed since the implicit duration of the anonymous spans is 0. In contrast, the word <emph>Bonjour</emph> is contained within an anonymous span that is the child of a parallel time container (the <code>span</code> element). As such, <emph>Bonjour</emph> will be displayed since the implicit duration of the anonymous span is indefinite, resulting in the implicit duration of its <code>span</code>, <code>p</code>, <code>div</code> and <code>body</code> ancestors to also be indefinite. </p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the normal editorial practice is to put the explanation in a Note beneath the example.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is true that the word "Bonjour" is contained in an anonymous span. The text in §7.1.5 p:

If a sequence of children of a p element consists solely of character information items, then that sequence must be considered to be an anonymous span for the purpose of applying style properties that apply to span elements.

does not appear in 7.1.6 span so I don't think it applies.

Rather, the reason the word Bonjour appears indefinitely is because the explicit span's implicit duration is indefinite.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please disregard the previous comment - I've gone and checked and read it again properly and realise that 7.1.6 does have text that provides this behaviour:

The span element accepts as its children zero or more elements in the Metadata.class element group, followed by zero or more elements in the Animation.class element group, followed by zero or more intermixed span elements, br elements, or text nodes interpreted as anonymous spans.

(my emphasis added)

Sorry for the noise.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nigelmegitt In fact, I think you were right in your first thought. In 9.3.3 it actually says:

for each span element whose child is a single anonymous span, replace the anonymous span with its sequence of child text nodes;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cconcolato This clause applies when constructing ISDs, which happens after timing is resolved.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@palemieux I'm confused. The creation of 'anonymous spans' is only defined in 9.3.3, therefore for me it does not make sense to talk about timing of an anonymous span, because as you say timing has been resolved already in 9.3.3.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@palemieux TTML2 has a note that covers that:

Note: A compliant presentation processor is permitted to perform the previous step (anonymous span generation) and this step (style resolution) as post-processing steps while performing the [construct intermediate document] procedure, in which case each intermediate synchronic document produced by 11.3.1.3 Intermediate Synchronic Document Construction will contain anonymously generated spans and computed

but I couldn't find this text in TTML1. Maybe this should be backported.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to understand why that note was added to TTML2.

In fact, TTML2 changed the sentence the span element accepts as its children zero or more elements in the Metadata.class element group, followed by zero or more elements in the Animation.class element group, followed by zero or more intermixed span elements, br elements, or text nodes interpreted as anonymous spans to remove the mention of anonymous spans.

This is a problem since TTML2 also states that If no timeContainer attribute is specified on a span element, then it must be interpreted as having parallel time containment semantics., which leaves the implicit duration of a span undefined if the span element does not contain anonymous spans.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does seem that we should not have a discrepancy here between TTML1 and TTML2 if at all possible. I've added an agenda item for this, but perhaps it is something that can be covered in offline discussions before the F2F on Tuesday?

@nigelmegitt nigelmegitt dismissed their stale review January 5, 2018 14:09

Disagreeing with myself

Copy link
Contributor

@nigelmegitt nigelmegitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The formatting is a little inconsistent but I'm basically happy with the content here.

Clarify procedure for creating anonymous spans (#193)
Clarify implicit duration of <span> that contain only text nodes (#193)
@palemieux palemieux changed the title Add example illustrating anon spans in seq containers Clarify anonymous span construction and implicit duration semantics Jan 16, 2018
@palemieux
Copy link
Contributor Author

Notes on e093565 :

  • the implicit duration of set elements follows the semantics of anonymous spans
  • anonymous span construction and pruning has been factored out
  • the implicit duration of span elements that contain only text nodes follow the semantics of anonymous spans. This means that:
  1. <p><span>hello</span></p> behaves the same as <p>hello</p>
  2. anonymous span construction and pruning can take place once for both timing resolution and style resolution
  • mentions of text nodes being converted to anonymous spans are removed from p and span sections per TTML2
  • the example in Section 10.4 was updated accordingly

Copy link
Contributor

@nigelmegitt nigelmegitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One editorial point, one technical issue in the example that certainly needs to be fixed, and one possibly hypothetical or irrelevant question that I'd like to be more certain about before moving forwards with this change.

spec/ttml1.xml Outdated
<p>The implicit duration of a <el>body</el>, <el>div</el>, <el>p</el>,
or <el>span</el> element is determined in accordance to (1) whether
<p>The implicit duration of a <el>body</el> element, <el>div</el> element, <el>p</el> element,
or <el>span</el> element (but not of a <el>span</el> element whose children
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than the parentheses it would be consistent with the previous bullet, and clearer, to say "or span element whose children are not exclusively text nodes".

spec/ttml1.xml Outdated
@@ -8106,7 +8123,7 @@ based timing or event based timing in <bibref ref="smil21"/>, where the specific
&lt;div&gt;
&lt;p timeContainer=&quot;seq&quot;&gt;
Hello
&lt;span&gt;Bonjour&lt;/span&gt;
&lt;p&gt;Bonjour&lt;/p&gt;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not valid TTML - a p cannot contain a p.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nigelmegitt Thanks for the catch!

spec/ttml1.xml Outdated
@@ -8094,7 +8110,8 @@ based timing or event based timing in <bibref ref="smil21"/>, where the specific
<specref ref="time-expression-semantics-smpte"/> apply.</p>
</item>
</ulist>
<p>The following example illustrates the timing semantics of anonymous spans that are children of sequential time containers. The words <emph>Hello</emph> and <emph>Allo</emph> are both contained in anonymous spans that are children of a sequential time container (the <code>p</code> element). As such, neither <emph>Hello</emph> nor <emph>Allo</emph> will be displayed since the implicit duration of the anonymous spans is 0. In contrast, the word <emph>Bonjour</emph> is contained within an anonymous span that is the child of a parallel time container (the <code>span</code> element). As such, <emph>Bonjour</emph> will be displayed since the implicit duration of the anonymous span is indefinite, resulting in the implicit duration of its <code>span</code>, <code>p</code>, <code>div</code> and <code>body</code> ancestors to also be indefinite. </p>
<p>For the purposes of performing presentation processing, the <phrase role="strong">[construct anonymous spans]</phrase> procedure is applied before resolving begin and end times of content elements.</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is all of [construct anonymous spans] performed before resolving begin and end times? Consider:

<p>
Wibble
<span begin="2s" end="3s">Wobble</span>
Wibble
</p>

Before 2s and after 3s, if you resolve the timing before step 2 of [construct anonymous spans] there are two contiguous anonymous spans that get replaced by a single anonymous span in step 2. Between 2s and 3s the anonymous spans are not contiguous.

If you resolve the timing after completing [construct anonymous spans] then the anonymous spans are never contiguous.

The next question is: does it ever make any difference? I think it makes no difference, but then I wonder what the point of step 2 is at all, and suspect I've missed something... Any further thoughts or ideas @palemieux @skynavga ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but then I wonder what the point of step 2 is at all, and suspect I've missed something

FWIW, I think of step (2) as a clean-up pass that create a single anonymous span from the multiple text nodes that an XML element can have.

@nigelmegitt
Copy link
Contributor

Thanks @palemieux those changes fix the main issues. I'd like to cover #318 (comment) on the call later today, hopefully briefly, before I approve this pull.

Copy link
Contributor

@nigelmegitt nigelmegitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See also the point discussed today (minutes); following that discussion, I'm approving this.

@palemieux palemieux removed the agenda label Jan 21, 2018
@palemieux palemieux merged commit 62ca221 into master Jan 21, 2018
@skynavga skynavga deleted the issue-193-anon-span-implicit-duration branch March 11, 2018 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants