Skip to content

Commit

Permalink
Merge pull request #1107 from w3c/issue-1105-significant-text-node
Browse files Browse the repository at this point in the history
Define significant text node, text node, and element node (#1105).
  • Loading branch information
skynavga committed Jun 7, 2019
2 parents e26c628 + 029926b commit 92c468c
Showing 1 changed file with 57 additions and 27 deletions.
84 changes: 57 additions & 27 deletions spec/ttml2.xml
Expand Up @@ -778,7 +778,13 @@ content element</loc>.</p>
<label>[character information item]</label>
<def>
<p>Each data character appearing in an XML document corresponds with a character information
item as defined by <bibref ref="infoset"/>, &sect;2.6.</p>
item as defined by <bibref ref="infoset"/>, &sect;2.6.
A sequence of one or more contiguous character information items that share the same parent
<loc href="#terms-element-information-item">element information item</loc> is
referred to as a <termdef id="defs-text-node" term=""><term>text node</term></termdef>.</p>
<note role="seealso">
<p>See <specref ref="reduced-infoset-character"/> for additional information.</p>
</note>
</def>
</gitem>
<gitem id="terms-chunked-data-embedding">
Expand Down Expand Up @@ -1080,7 +1086,11 @@ built-in, programmatic (code-based) schemas will be employed by a <loc href="#te
<label>[element information item]</label>
<def>
<p>Each element appearing in an XML document corresponds with an element information
item as defined by <bibref ref="infoset"/>, &sect;2.2.</p>
item as defined by <bibref ref="infoset"/>, &sect;2.2.
Also referred to as a <termdef id="defs-element-node" term=""><term>element node</term></termdef>.</p>
<note role="seealso">
<p>See <specref ref="reduced-infoset-element"/> for additional information.</p>
</note>
</def>
</gitem>
<gitem id="terms-embedded-content-element">
Expand Down Expand Up @@ -1691,6 +1701,27 @@ content rectangles are coterminous.</p>
in relationship with some external application or presentation context.</p>
</def>
</gitem>
<gitem id="terms-significant-text-node">
<label>[significant text node]</label>
<def>
<p>A significant text node is a <termref def="defs-text-node">text node</termref> that contains at least one
<emph>significant</emph> <termref def="defs-data-character">data character</termref>,
where the determination of whether a <termref def="defs-data-character">data character</termref> is significant or not is determined by the
declared content model and the defined semantics of the element type of the <termref def="defs-text-node">text node's</termref>
parent <termref def="defs-element-node">element node</termref>, more about which see <bibref ref="xml10"/>, &sect;3.2.
In particular, if the content model of the parent's element type is
<loc href="https://www.w3.org/TR/2008/REC-xml-20081126/#sec-element-content">element content</loc>,
then no <termref def="defs-data-character">data character</termref> is significant; however, if the content model of the parent's element type is
<loc href="https://www.w3.org/TR/2008/REC-xml-20081126/#sec-mixed-content">mixed content</loc>,
then the semantics of the parent's element type and its applied style properties (as defined in this specification) determines whether
a <termref def="defs-data-character">data character</termref> is significant (not ignored) or not (ignored) in some context of use.</p>
<note role="clarification">
<p>A <termdef id="defs-data-character" term=""><term>data character</term></termdef> is any character that is
considered to be <loc href="https://www.w3.org/TR/2008/REC-xml-20081126/#dt-chardata">character data</loc> as defined
by <bibref ref="xml10"/>, &sect;2.4, or its equivalent in the case of concrete encodings not based upon <specref ref="concrete-encoding"/>.</p>
</note>
</def>
</gitem>
<gitem id="terms-simple-data-embedding">
<label>[simple data embedding]</label>
<def>
Expand Down Expand Up @@ -7134,7 +7165,7 @@ zero or more elements in the <loc href="#element-vocab-group-metadata"><code>Met
zero or more elements in the <loc href="#element-vocab-group-animation"><code>Animation.class</code></loc> element group, followed by zero or more
<loc href="#embedded-content-vocabulary-source"><el>source</el></loc> elements.</p>
<note role="clarification">
<p>No text node descendant of an <el>audio</el> element is a significant text node for the purpose of performing the
<p>No <termref def="defs-text-node">text node</termref> descendant of an <el>audio</el> element is a <loc href="#terms-significant-text-node">significant text node</loc> for the purpose of performing the
<loc href="#procedure-construct-anonymous-spans">[construct anonymous spans]</loc> procedure.</p>
</note>
<table id="elt-syntax-audio" role="syntax">
Expand Down Expand Up @@ -7297,7 +7328,7 @@ of reference. In this case, the active time interval of the <el>data</el> elemen
identifier is not referenced in other <loc href="#terms-data-binding-context">data binding contexts</loc>, or, if it is, has no binding semantics.</p>
</note>
<p>The <el>data</el> element accepts one of the following three content models:
(1) one or more text nodes (i.e., <code>#PCDATA</code>),
(1) one or more <termref def="defs-text-node">text node</termref>s (i.e., <code>#PCDATA</code>),
(2) zero or more elements in the <loc href="#element-vocab-group-metadata"><code>Metadata.class</code></loc> element group followed by one or more
<loc href="#embedded-content-vocabulary-chunk"><el>chunk</el></loc> elements, or
(3) zero or more elements in the <loc href="#element-vocab-group-metadata"><code>Metadata.class</code></loc> element group followed by one or more
Expand Down Expand Up @@ -7337,7 +7368,7 @@ contain a <loc href="#embedded-content-vocabulary-data"><el>data</el></loc> elem
</tr>
</tbody>
</table>
<p>If simple data embedding is used, i.e., the content of the <el>data</el> element is one or more text nodes, then an
<p>If simple data embedding is used, i.e., the content of the <el>data</el> element is one or more <termref def="defs-text-node">text node</termref>s, then an
<loc href="#embedded-content-attribute-encoding"><att>encoding</att></loc> attribute
may be specified, and, if not specified, must be considered to be <code>base64</code>.
If chunked or sourced data embedding is used, i.e., the content of the <el>data</el> element contains any child
Expand Down Expand Up @@ -7571,7 +7602,7 @@ zero or more elements in the <loc href="#element-vocab-group-metadata"><code>Met
zero or more elements in the <loc href="#element-vocab-group-animation"><code>Animation.class</code></loc> element group, followed by
zero or more <loc href="#embedded-content-vocabulary-source"><el>source</el></loc> elements.</p>
<note role="clarification">
<p>No text node descendant of an <el>image</el> element is a significant text node for the purpose of performing the
<p>No <termref def="defs-text-node">text node</termref> descendant of an <el>image</el> element is a <loc href="#terms-significant-text-node">significant text node</loc> for the purpose of performing the
<loc href="#procedure-construct-anonymous-spans">[construct anonymous spans]</loc> procedure.</p>
</note>
<table id="elt-syntax-image" role="syntax">
Expand Down Expand Up @@ -12095,7 +12126,7 @@ if the computed value of <att>tts:ruby</att> of a <loc href="#content-vocabulary
<item><p>the computed value of <att>tts:ruby</att> of each of its child elements is not <code>none</code>;</p></item>
<item><p>the computed value of <att>tts:ruby</att> of its first child element is <code>baseContainer</code>
or <code>base</code>;</p></item>
<item><p>each of its text node children contain only <loc href="#style-value-lwsp">&lt;lwsp&gt;</loc>,
<item><p>each of its <termref def="defs-text-node">text node</termref> children contain only <loc href="#style-value-lwsp">&lt;lwsp&gt;</loc>,
which must be ignored for the purpose of presentation processing regardless of whether the computed value of the
<loc href="#content-attribute-xml-space"><att>xml:space</att></loc> attribute is <code>preserve</code> or not;</p></item>
</ulist>
Expand All @@ -12106,7 +12137,7 @@ if the computed value of <att>tts:ruby</att> of a <loc href="#content-vocabulary
<item><p>the computed value of <att>tts:ruby</att> of each of its child elements is not <code>none</code>;</p></item>
<item><p>the computed value of <att>tts:ruby</att> of its first child element is <code>base</code>;</p></item>
<item><p>its preceding sibling is <code>null</code> (i.e., no preceding sibling);</p></item>
<item><p>each of its text node children contain only <loc href="#style-value-lwsp">&lt;lwsp&gt;</loc>,
<item><p>each of its <termref def="defs-text-node">text node</termref> children contain only <loc href="#style-value-lwsp">&lt;lwsp&gt;</loc>,
which must be ignored for the purpose of presentation processing regardless of whether the computed value of the
<loc href="#content-attribute-xml-space"><att>xml:space</att></loc> attribute is <code>preserve</code> or not;</p></item>
</ulist>
Expand All @@ -12119,7 +12150,7 @@ if the computed value of <att>tts:ruby</att> of a <loc href="#content-vocabulary
<item><p>the computed value of <att>tts:ruby</att> of its preceding sibling is <code>baseContainer</code> or
<code>textContainer</code>;</p></item>
<item><p>the computed value of <att>tts:ruby</att> of no more than one of its siblings is <code>textContainer</code>;</p></item>
<item><p>each of its text node children contain only <loc href="#style-value-lwsp">&lt;lwsp&gt;</loc>,
<item><p>each of its <termref def="defs-text-node">text node</termref> children contain only <loc href="#style-value-lwsp">&lt;lwsp&gt;</loc>,
which must be ignored for the purpose of presentation processing regardless of whether the computed value of the
<loc href="#content-attribute-xml-space"><att>xml:space</att></loc> attribute is <code>preserve</code> or not;</p></item>
</ulist>
Expand All @@ -12134,7 +12165,7 @@ computed value of <att>tts:ruby</att> of its preceding sibling is <code>base</co
then the computed value of <att>tts:ruby</att> of no sibling is <code>base</code>;</p></item>
<item><p>the computed value of <att>tts:ruby</att> of no descendant element is not <code>none</code>;</p></item>
<item><p>none of its descendant elements is a <loc href="#content-vocabulary-br"><el>br</el></loc> element;</p></item>
<item><p>each of its text node descendants does not contain U+2028 (LINE SEPARATOR) or U+2029 (PARAGRAPH SEPARATOR);</p></item>
<item><p>each of its <termref def="defs-text-node">text node</termref> descendants does not contain U+2028 (LINE SEPARATOR) or U+2029 (PARAGRAPH SEPARATOR);</p></item>
</ulist>
<p>When using <att>tts:ruby</att>, the following nesting constraints apply to <termref def="defs-ruby-text-content">ruby text content</termref>, that is,
if the computed value of <att>tts:ruby</att> of a <loc href="#content-vocabulary-span"><el>span</el></loc> element is <code>text</code>, then:</p>
Expand All @@ -12148,7 +12179,7 @@ computed value of <att>tts:ruby</att> of its preceding sibling is <code>base</co
then the computed value of <att>tts:ruby</att> of no sibling is <code>text</code>;</p></item>
<item><p>the computed value of <att>tts:ruby</att> of no descendant element is not <code>none</code>;</p></item>
<item><p>none of its descendant elements is a <loc href="#content-vocabulary-br"><el>br</el></loc> element;</p></item>
<item><p>each of its text node descendants does not contain U+2028 (LINE SEPARATOR) or U+2029 (PARAGRAPH SEPARATOR);</p></item>
<item><p>each of its <termref def="defs-text-node">text node</termref> descendants does not contain U+2028 (LINE SEPARATOR) or U+2029 (PARAGRAPH SEPARATOR);</p></item>
</ulist>
<p>When using <att>tts:ruby</att>, the following nesting constraints apply to a <termref def="defs-ruby-fallback-delimiter">ruby fallback delimiter</termref>, that is,
if the computed value of <att>tts:ruby</att> of a <loc href="#content-vocabulary-span"><el>span</el></loc> element is <code>delimiter</code>, then:</p>
Expand All @@ -12161,7 +12192,7 @@ computed value of <att>tts:ruby</att> of its preceding sibling is <code>base</co
<item><p>if the computed value of <att>tts:ruby</att> is <code>delimiter</code>, then the
computed value of <att>tts:ruby</att> of no descendant element is not <code>none</code>;</p></item>
<item><p>none of its descendant elements is a <loc href="#content-vocabulary-br"><el>br</el></loc> element;</p></item>
<item><p>each of its text node descendants does not contain U+2028 (LINE SEPARATOR) or U+2029 (PARAGRAPH SEPARATOR).</p></item>
<item><p>each of its <termref def="defs-text-node">text node</termref> descendants does not contain U+2028 (LINE SEPARATOR) or U+2029 (PARAGRAPH SEPARATOR).</p></item>
</ulist>
<p>A <loc href="#terms-validating-content-processor">validating content processor</loc> must treat a violation of any of the above constraints as an error.
For the purpose of presentation processing, the violation of any of these constraints should result in fallback (inline)
Expand Down Expand Up @@ -16179,7 +16210,7 @@ forms of style association.</p>
</tbody>
</table>
<note role="explanation">
<p>In the above example, the two text nodes <code>"White 1 "</code> and
<p>In the above example, the two <termref def="defs-text-node">text node</termref>s <code>"White 1 "</code> and
<code>" White 2"</code>, which are interpreted as <loc href="#terms-anonymous-span">anonymous spans</loc>, are not
associated with a color style property; rather, they inherit their color style
from their parent <el>p</el> element as described in <specref
Expand Down Expand Up @@ -16223,7 +16254,7 @@ by <specref ref="semantics-style-association-inline"/>.</p>
</tbody>
</table>
<note role="explanation">
<p>In the above example, the two text nodes <code>"White 1 "</code> and
<p>In the above example, the two <termref def="defs-text-node">text node</termref>s <code>"White 1 "</code> and
<code>" White 2"</code>, which are interpreted as <loc href="#terms-anonymous-span">anonymous spans</loc>, are not
associated with a color style property; rather, they inherit their color style
from their parent <el>p</el> element as described in <specref
Expand Down Expand Up @@ -17436,7 +17467,7 @@ the <phrase role="strong"><loc href="#procedure-construct-intermediate-document"
<olist>
<item>
<p>optionally, invoke procedure <phrase role="strong"><loc href="#procedure-construct-anonymous-spans">[construct anonymous spans]</loc></phrase>;
otherwise, if not invoked at this time, then resolve the implicit duration for each text node that would have had its
otherwise, if not invoked at this time, then resolve the implicit duration for each <termref def="defs-text-node">text node</termref> that would have had its
implicit duration resolved had this procedure been invoked;</p>
</item>
<item>
Expand All @@ -17451,17 +17482,16 @@ some element becomes temporally active or inactive.</p>
<label>[construct anonymous spans]</label>
<def>
<olist>
<item><p>for each significant text node in a <loc href="#terms-content-element">content element</loc>,
synthesize an <loc href="#terms-anonymous-span">anonymous span</loc> to enclose the text node, substituting
the new <loc href="#terms-anonymous-span">anonymous span</loc> for the original text node child in its sibling
<item><p>for each <loc href="#terms-significant-text-node">significant text node</loc> child of a <loc href="#terms-content-element">content element</loc>,
synthesize an <loc href="#terms-anonymous-span">anonymous span</loc> to enclose the <termref def="defs-text-node">text node</termref>, substituting
the new <loc href="#terms-anonymous-span">anonymous span</loc> for the original <termref def="defs-text-node">text node</termref> child in its sibling
and parent hierarchy;</p></item>
<item><p>for each contiguous sequence of <loc href="#terms-anonymous-span">anonymous spans</loc>, replace the
sequence with a single <loc href="#terms-anonymous-span">anonymous span</loc> which contains a sequence of
text nodes representing the individual text node children of the
<termref def="defs-text-node">text node</termref>s representing the individual <termref def="defs-text-node">text node</termref> children of the
original sequence of <loc href="#terms-anonymous-span">anonymous spans</loc>;</p></item>
<item><p>for each span element whose child is a single <loc href="#terms-anonymous-span">anonymous span</loc>,
replace the <loc href="#terms-anonymous-span">anonymous span</loc> with its sequence of child text
nodes.</p></item>
replace the <loc href="#terms-anonymous-span">anonymous span</loc> with its sequence of child <termref def="defs-text-node">text nodes</termref>.</p></item>
</olist>
</def>
</gitem>
Expand Down Expand Up @@ -17513,7 +17543,7 @@ an element, means that the element is to be removed from its parent's children,
which, in turn, implies that the descendants of the pruned element will no longer
be descendants of the element's parent. When <emph>prune</emph> is used in
reference to an attribute, it means that attribute is to be removed from its
associated (owning) element node.</p>
associated (owning) <termref def="defs-element-node">element node</termref>.</p>
</note>
<note role="clarification">
<p>A compliant presentation processor is permitted to perform early style resolution as a post-processing step of the above procedure,
Expand Down Expand Up @@ -18263,7 +18293,7 @@ is equivalent to zero.</p>
if that element were treated as an <loc href="#terms-anonymous-span">anonymous span</loc>.</p>
</item>
<item>
<p>The implicit duration of a <el>span</el> element with non-mixed content, i.e., only <code>#PCDATA</code> text nodes,
<p>The implicit duration of a <el>span</el> element with non-mixed content, i.e., only <code>#PCDATA</code> <termref def="defs-text-node">text node</termref>s,
is defined to be the same as if the <el>span</el> element were treated as an <loc href="#terms-anonymous-span">anonymous span</loc>.</p>
</item>
<item>
Expand Down Expand Up @@ -19371,7 +19401,7 @@ a specific element instance.</p>
<head>ttm:item</head>
<p>The <el>ttm:item</el> element is used to express arbitrary named metadata items.</p>
<p>The <el>ttm:item</el> element accepts one of the following two content models:
(1) one or more text nodes (i.e., <code>#PCDATA</code>) or
(1) one or more <termref def="defs-text-node">text node</termref>s (i.e., <code>#PCDATA</code>) or
(2) zero or more nested <loc href="#metadata-vocabulary-item">ttm:item</loc> elements.</p>
<table id="elt-syntax-metadata-item" role="syntax">
<caption>XML Representation &ndash; Element Information Item: ttm:item</caption>
Expand Down Expand Up @@ -19400,8 +19430,8 @@ an <loc href="#metadata-value-item-name">&lt;item-name&gt;</loc> value expressio
the definition of a specific named item may further constrain the context of use as well as the potential appearance of multiple items that share the same name.</p>
</note>
<p>The value of a named metadata item is
(1) empty if the element has no child text or element nodes,
(2) the character content of the <el>ttm:item</el> element when that element's children consists solely of text nodes, or
(1) empty if the element has no child text or <termref def="defs-element-node">element node</termref>s,
(2) the character content of the <el>ttm:item</el> element when that element's children consists solely of <termref def="defs-text-node">text node</termref>s, or
(3) a collection of named metadata sub-items.</p>
<note role="elaboration">
<p>The definition of a particular named item will typically constrain the set of permitted values. Furthermore, it may
Expand Down Expand Up @@ -25415,7 +25445,7 @@ and its descendant elements:</p>
<item><p>no <att>timeContainer</att> attribute is specified;</p></item>
<item><p>no attribute in the TT Style Namespaces is specified;</p></item>
<item><p>no <loc href="#animation-vocabulary-set">set</loc> element is present;</p></item>
<item><p>no significant text node, i.e., text node in a #PCDATA context, is not contained in a
<item><p>no <loc href="#terms-significant-text-node">significant text node</loc> is not a child of a
<loc href="#content-vocabulary-span"><el>span</el></loc> element that contains no other child.</p></item>
</ulist>
<p>In addition, for the <loc href="#document-structure-vocabulary-body"><el>body</el></loc> element <emph>B</emph> and
Expand Down

0 comments on commit 92c468c

Please sign in to comment.