[ttml2] add tts:rubyOffset attribute (issue 228)
authorGlenn Adams <glenn@skynav.com>
Thu, 02 Oct 2014 15:39:43 -0600
changeset 743 c62837d89619
parent 742 041e1a1148ba
child 744 8fc2c71d339f
[ttml2] add tts:rubyOffset attribute (issue 228)
ttml2/spec/rnc/schema.zip
ttml2/spec/rnc/ttml2-datatypes.rnc
ttml2/spec/rnc/ttml2-styling-attribs.rnc
ttml2/spec/ttml2-changes.html
ttml2/spec/ttml2.xml
ttml2/spec/xmlspec-ttml2.xsl
ttml2/spec/xsd/schema.zip
ttml2/spec/xsd/ttml2-datatypes.xsd
ttml2/spec/xsd/ttml2-styling-attribs.xsd
Binary file ttml2/spec/rnc/schema.zip has changed
--- a/ttml2/spec/rnc/ttml2-datatypes.rnc	Thu Oct 02 08:26:36 2014 -0600
+++ b/ttml2/spec/rnc/ttml2-datatypes.rnc	Thu Oct 02 15:39:43 2014 -0600
@@ -242,6 +242,9 @@
   "spaceBetween" |
   "spaceAround"
 
+TTAF.RubyOffset.datatype =
+  string
+
 TTAF.RubyPosition.datatype =
   "before" |
   "after" |
--- a/ttml2/spec/rnc/ttml2-styling-attribs.rnc	Thu Oct 02 08:26:36 2014 -0600
+++ b/ttml2/spec/rnc/ttml2-styling-attribs.rnc	Thu Oct 02 15:39:43 2014 -0600
@@ -46,6 +46,8 @@
   = attribute tts:ruby { TTAF.Ruby.datatype }?
 TTAF.rubyAlign.attrib
   = attribute tts:rubyAlign { TTAF.RubyAlign.datatype }?
+TTAF.rubyOffset.attrib
+  = attribute tts:rubyOffset { TTAF.RubyOffset.datatype }?
 TTAF.rubyPosition.attrib
   = attribute tts:rubyPosition { TTAF.RubyPosition.datatype }?
 TTAF.showBackground.attrib
--- a/ttml2/spec/ttml2-changes.html	Thu Oct 02 08:26:36 2014 -0600
+++ b/ttml2/spec/ttml2-changes.html	Thu Oct 02 15:39:43 2014 -0600
@@ -72,6 +72,7 @@
 'tts:fontVariantPosition',
 'tts:ruby',
 'tts:rubyAlign',
+'tts:rubyOffset',
 'tts:rubyPosition',
 and
 'tts:textOrientation'
@@ -252,7 +253,7 @@
 
 * In 9.3.2, define inline region processing semantics.
 
-* In 10.2.3, specify that a duration (@dur) of zero is explicitly permitted.
+* In 10.2.2, specify that a duration (@dur) of zero is explicitly permitted.
 
 * In 11.1.1, add 'animation' element in order to support out-of-line animation
   specifications.
@@ -362,9 +363,13 @@
 * In 9.3, insert "Inline Regions" as sub-section 9.3.2, renumbering following
   sub-sections.
 
+* In 10.2, reorder attributue sub-sections to be alphabetic.
+
 * In 10.3, permit metric component to be omitted from offset-time, in which case
   's' (seconds) is implied.
 
+* In 12.1, reorder ttm:* attribute sub-sections to be alphabetic.
+
 * In Appendix H, add (non-normative) reference to CSS Writing Modes Level 3.
 
 * In Appendix H, add (non-normative) reference to Japanese Language Requirements
--- a/ttml2/spec/ttml2.xml	Thu Oct 02 08:26:36 2014 -0600
+++ b/ttml2/spec/ttml2.xml	Thu Oct 02 15:39:43 2014 -0600
@@ -2421,6 +2421,7 @@
 <loc href="#style-attribute-padding">tts:padding</loc>,
 <loc href="#style-attribute-ruby">tts:ruby</loc>,
 <loc href="#style-attribute-rubyAlign">tts:rubyAlign</loc>,
+<loc href="#style-attribute-rubyOffset">tts:rubyOffset</loc>,
 <loc href="#style-attribute-rubyPosition">tts:rubyPosition</loc>,
 <loc href="#style-attribute-showBackground">tts:showBackground</loc>,
 <loc href="#style-attribute-textAlign">tts:textAlign</loc>,
@@ -5089,6 +5090,7 @@
 <item><p><specref ref="style-attribute-padding"/></p></item>
 <item><p><specref ref="style-attribute-ruby"/></p></item>
 <item><p><specref ref="style-attribute-rubyAlign"/></p></item>
+<item><p><specref ref="style-attribute-rubyOffset"/></p></item>
 <item><p><specref ref="style-attribute-rubyPosition"/></p></item>
 <item><p><specref ref="style-attribute-showBackground"/></p></item>
 <item><p><specref ref="style-attribute-textAlign"/></p></item>
@@ -7003,9 +7005,8 @@
 <head>tts:ruby</head>
 <p>The <att>tts:ruby</att> attribute is used to specify the application of ruby
 styling.</p>
-<p>This attribute applies only to <loc href="#content-vocabulary-span"><el>span</el></loc> elements and is not inheritable, so it should
-not be specified on any other element type. If specified elsewhere, then it must be ignored for
-the purpose of presentation processing.</p>
+<p>This attribute may be specified by any element type that permits use of attributes in the TT Style Namespace; however,
+this attribute applies as a style property only to those element types indicated in the following table.</p>
 <table id="style-property-details-ruby" role="common">
 <col width="25%"/>
 <col/>
@@ -7104,6 +7105,85 @@
 </tr>
 </tbody>
 </table>
+<p>When using <att>tts:ruby</att>, the following nesting constraints apply:</p>
+<ulist>
+<item><p>if the computed value of <att>tts:ruby</att> is <code>container</code>, then the
+computed value of <att>tts:ruby</att> of all ancestor elements is <code>none</code>;</p></item>
+<item><p>if the computed value of <att>tts:ruby</att> is <code>container</code>, then 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>if the computed value of <att>tts:ruby</att> is <code>baseContainer</code>, then the
+computed value of <att>tts:ruby</att> of its parent element is <code>container</code>;</p></item>
+<item><p>if the computed value of <att>tts:ruby</att> is <code>baseContainer</code>, then the
+computed value of <att>tts:ruby</att> of its first child element is <code>base</code>;</p></item>
+<item><p>if the computed value of <att>tts:ruby</att> is <code>baseContainer</code>, then its
+preceding sibling is <code>null</code> (i.e., no preceding sibling);</p></item>
+<item><p>if the computed value of <att>tts:ruby</att> is <code>textContainer</code>, then the
+computed value of <att>tts:ruby</att> of its parent element is <code>container</code>;</p></item>
+<item><p>if the computed value of <att>tts:ruby</att> is <code>textContainer</code>, then the
+computed value of <att>tts:ruby</att> of its first child element is <code>text</code>;</p></item>
+<item><p>if the computed value of <att>tts:ruby</att> is <code>textContainer</code>, then the
+computed value of <att>tts:ruby</att> of its preceding sibling is <code>baseContainer</code> or
+<code>textContainer</code>;</p></item>
+<item><p>if the computed value of <att>tts:ruby</att> is <code>textContainer</code>, then the
+computed value of <att>tts:ruby</att> of no more than one sibling is <code>textContainer</code>;</p></item>
+<item><p>if the computed value of <att>tts:ruby</att> is <code>base</code>, then the
+computed value of <att>tts:ruby</att> of its parent element is either <code>container</code> or
+<code>baseContainer</code>;</p></item>
+<item><p>if the computed value of <att>tts:ruby</att> is <code>base</code>, then its
+preceding sibling is either <code>null</code> (i.e., no preceding sibling) or the
+computed value of <att>tts:ruby</att> of its preceding sibling is <code>base</code>;</p></item>
+<item><p>if the computed value of <att>tts:ruby</att> is <code>base</code> and the
+computed value of <att>tts:ruby</att> of its parent element is <code>container</code>,
+then the computed value of <att>tts:ruby</att> of no sibling is <code>base</code>;</p></item>
+<item><p>if the computed value of <att>tts:ruby</att> is <code>base</code>, then the
+computed value of <att>tts:ruby</att> of no descendant element is not <code>none</code>;</p></item>
+<item><p>if the computed value of <att>tts:ruby</att> is <code>text</code>, then the
+computed value of <att>tts:ruby</att> of its parent element is either <code>container</code> or
+<code>textContainer</code>;</p></item>
+<item><p>if the computed value of <att>tts:ruby</att> is <code>text</code>, then the
+computed value of <att>tts:ruby</att> of its preceding sibling is <code>base</code>,
+<code>text</code>, or <code>delimiter</code>;</p></item>
+<item><p>if the computed value of <att>tts:ruby</att> is <code>text</code> and the
+computed value of <att>tts:ruby</att> of its parent element is <code>container</code>,
+then the computed value of <att>tts:ruby</att> of no sibling is <code>text</code>;</p></item>
+<item><p>if the computed value of <att>tts:ruby</att> is <code>text</code>, then the
+computed value of <att>tts:ruby</att> of no descendant element is not <code>none</code>;</p></item>
+<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 its parent element is <code>container</code>;</p></item>
+<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 its preceding sibling is <code>base</code> or
+<code>text</code>;</p></item>
+<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 exactly one sibling is <code>delimiter</code>;</p></item>
+<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>
+</ulist>
+<note role="elaboration">
+<p>The above listed constraints are intended to be interpreted as specifying the following nesting model:</p>
+<eg xml:space="preserve">
+container
+  : baseContainer textContainer textContainer?
+  | base text
+  | base delimiter text delimiter
+
+baseContainer
+  : base+
+
+textContainer
+  : text+
+
+base | text | delimiter
+  : ( #PCDATA | { span - tts:ruby } )*
+</eg>
+<p>This model corresponds to the maximal content model for the <code>ruby</code> element defined by <bibref ref="ruby"/>, &sect;2.1:</p>
+<eg xml:space="preserve">
+((rb, (rt | (rp, rt, rp))) | (rbc, rtc, rtc?))
+</eg>
+</note>
+<p>A validating processor must treat a violation of any of the above constraints as an error.</p>
+<p>For the purpose of presentation processing, the violation of any of these constraints should result in fallback (inline)
+presentation of ruby text annotations, where fallback annotation presentation is considered to be implementation dependent.</p>
 <p>Use of <att>tts:ruby</att> to specify simple ruby annotation is illustrated by the following example.</p>
 <table id="style-attribute-ruby-example-1" role="example">
 <caption>Example Fragment &ndash; Simple Ruby</caption>
@@ -7173,9 +7253,8 @@
 <div3 id="style-attribute-rubyAlign">
 <head>tts:rubyAlign</head>
 <p>The <att>tts:rubyAlign</att> attribute is used to specify the position of ruby text within the inline area generated by the ruby text container annotation.</p>
-<p>This attribute may be specified by any element type that permits use of attributes in the TT Style Namespace; however, this attribute applies
-as a style property only to <loc href="#content-vocabulary-span"><el>span</el></loc> elements on which the computed value of the
-<att>tts:ruby</att> style property is either <code>textContainer</code> or <code>text</code>.</p>
+<p>This attribute may be specified by any element type that permits use of attributes in the TT Style Namespace; however,
+this attribute applies as a style property only to those element types indicated in the following table.</p>
 <table id="style-property-details-rubyAlign" role="common">
 <col width="25%"/>
 <col/>
@@ -7196,7 +7275,7 @@
 <tr>
 <td><emph>Applies to:</emph></td>
 <td>
-<emph>see prose (above)</emph>
+<loc href="#content-vocabulary-span"><el>span</el></loc> only if the computed value of <loc href="#style-attribute-ruby">tts:ruby</loc> is <code>container</code>
 </td>
 </tr>
 <tr>
@@ -7235,13 +7314,64 @@
 renderings shown there apply.</p>
 </note>
 </div3>
+<div3 id="style-attribute-rubyOffset">
+<head>tts:rubyOffset</head>
+<p>The <att>tts:rubyOffset</att> attribute is used to specify the offset (distance) of ruby text with respect to its associated ruby base
+in the block progression dimension.</p>
+<p>This attribute may be specified by any element type that permits use of attributes in the TT Style Namespace; however,
+this attribute applies as a style property only to those element types indicated in the following table.</p>
+<table id="style-property-details-rubyOffset" role="common">
+<col width="25%"/>
+<col/>
+<tbody>
+<tr>
+<td><emph>Values:</emph></td>
+<td>
+<loc href="#style-value-length">&lt;length&gt;</loc>
+</td>
+</tr>
+<tr>
+<td><emph>Initial:</emph></td>
+<td><code>0px</code></td>
+</tr>
+<tr>
+<td><emph>Applies to:</emph></td>
+<td>
+<loc href="#content-vocabulary-span"><el>span</el></loc> only if the computed value of <loc href="#style-attribute-ruby">tts:ruby</loc> is <code>container</code>
+</td>
+</tr>
+<tr>
+<td><emph>Inherited:</emph></td>
+<td>yes</td>
+</tr>
+<tr>
+<td><emph>Percentages:</emph></td>
+<td>relative to this element's font size</td>
+</tr>
+<tr>
+<td><emph>Animatable:</emph></td>
+<td>continuous</td>
+</tr>
+</tbody>
+</table>
+<p></p>
+<p>If specified, the value of <att>tts:rubyOffset</att> expresses the offset (distance) between padding edge <emph>E<sub>1</sub></emph> of the inline area
+generated by a ruby text container (explicit or implied) and padding edge <emph>E<sub>2</sub></emph>  of the inline area generated by a ruby base container (explicit or implied), where
+<emph>E<sub>1</sub></emph> and <emph>E<sub>2</sub></emph> are perpendicular to the block progression direction and are (or would be) adjacent in the absence of
+such an offset.</p>
+<p>Negative length expressions are permitted.</p>
+<ednote>
+<name>Ruby Offset Example</name>
+<date>2014-10-02</date>
+<edtext>Add example and example rendering of tts:rubyOffset.</edtext>
+</ednote>
+</div3>
 <div3 id="style-attribute-rubyPosition">
 <head>tts:rubyPosition</head>
 <p>The <att>tts:rubyPosition</att> attribute is used to specify the position of ruby text in the block progression dimension
 with respect to its associated ruby base.</p>
-<p>This attribute may be specified by any element type that permits use of attributes in the TT Style Namespace; however, this attribute applies
-as a style property only to <loc href="#content-vocabulary-span"><el>span</el></loc> elements on which the computed value of the
-<att>tts:ruby</att> style property is either <code>textContainer</code> or <code>text</code>.</p>
+<p>This attribute may be specified by any element type that permits use of attributes in the TT Style Namespace; however,
+this attribute applies as a style property only to those element types indicated in the following table.</p>
 <table id="style-property-details-rubyPosition" role="common">
 <col width="25%"/>
 <col/>
@@ -7260,7 +7390,7 @@
 <tr>
 <td><emph>Applies to:</emph></td>
 <td>
-<emph>see prose (above)</emph>
+<loc href="#content-vocabulary-span"><el>span</el></loc> only if the computed value of <loc href="#style-attribute-ruby">tts:ruby</loc> is <code>container</code>
 </td>
 </tr>
 <tr>
--- a/ttml2/spec/xmlspec-ttml2.xsl	Thu Oct 02 08:26:36 2014 -0600
+++ b/ttml2/spec/xmlspec-ttml2.xsl	Thu Oct 02 15:39:43 2014 -0600
@@ -55,6 +55,7 @@
 table.example-images-bordered { text-align: center; border: 0px solid black; width: 85%; border-collapse: collapse }
 table.example-images-bordered caption { font-weight: bold; text-align: center; padding-bottom: 0.5em }
 table.example-images-bordered td { border: 1px solid red; text-align: left }
+div.exampleInner { width: 85%; }
 .tbd { background-color: #ffff33; border: 2px solid black; width: 85% }
 .strong { font-weight: bold }
 .deprecated { background-color: #fbaf5c }
Binary file ttml2/spec/xsd/schema.zip has changed
--- a/ttml2/spec/xsd/ttml2-datatypes.xsd	Thu Oct 02 08:26:36 2014 -0600
+++ b/ttml2/spec/xsd/ttml2-datatypes.xsd	Thu Oct 02 15:39:43 2014 -0600
@@ -432,6 +432,12 @@
       <xs:enumeration value="spaceAround"/>
     </xs:restriction>
   </xs:simpleType>
+  <xs:simpleType name="rubyOffset">
+    <xs:annotation>
+      <xs:documentation>length</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
   <xs:simpleType name="rubyPosition">
     <xs:restriction base="xs:token">
       <xs:enumeration value="before"/>
--- a/ttml2/spec/xsd/ttml2-styling-attribs.xsd	Thu Oct 02 08:26:36 2014 -0600
+++ b/ttml2/spec/xsd/ttml2-styling-attribs.xsd	Thu Oct 02 15:39:43 2014 -0600
@@ -24,6 +24,7 @@
   <xs:attribute name="padding" type="ttd:padding"/>
   <xs:attribute name="ruby" type="ttd:ruby"/>
   <xs:attribute name="rubyAlign" type="ttd:rubyAlign"/>
+  <xs:attribute name="rubyOffset" type="ttd:rubyOffset"/>
   <xs:attribute name="rubyPosition" type="ttd:rubyPosition"/>
   <xs:attribute name="showBackground" type="ttd:showBackground"/>
   <xs:attribute name="textAlign" type="ttd:textAlign"/>
@@ -56,6 +57,7 @@
     <xs:attribute ref="tts:showBackground"/>
     <xs:attribute ref="tts:ruby"/>
     <xs:attribute ref="tts:rubyAlign"/>
+    <xs:attribute ref="tts:rubyOffset"/>
     <xs:attribute ref="tts:rubyPosition"/>
     <xs:attribute ref="tts:textAlign"/>
     <xs:attribute ref="tts:textDecoration"/>