[ttml2] add tts:translate style attribute (issue 224)
authorGlenn Adams <glenn@skynav.com>
Sat, 17 Jan 2015 09:09:39 -0700
changeset 841 abebbd0a303b
parent 840 a5843d9ba23a
child 842 61711f9bb14f
[ttml2] add tts:translate style attribute (issue 224)
ttml2/spec/rnc/ttml2-datatypes.rnc
ttml2/spec/rnc/ttml2-styling-attribs.rnc
ttml2/spec/ttml2-changes.html
ttml2/spec/ttml2.xml
ttml2/spec/xsd/ttml2-datatypes.xsd
ttml2/spec/xsd/ttml2-styling-attribs.xsd
--- a/ttml2/spec/rnc/ttml2-datatypes.rnc	Wed Jan 14 19:34:08 2015 -0700
+++ b/ttml2/spec/rnc/ttml2-datatypes.rnc	Sat Jan 17 09:09:39 2015 -0700
@@ -430,6 +430,9 @@
 TTAF.TimeDuration.datatype =
   string
 
+TTAF.Translate.datatype =
+  string
+
 TTAF.URI.datatype =
   xsd:anyURI
 
--- a/ttml2/spec/rnc/ttml2-styling-attribs.rnc	Wed Jan 14 19:34:08 2015 -0700
+++ b/ttml2/spec/rnc/ttml2-styling-attribs.rnc	Sat Jan 17 09:09:39 2015 -0700
@@ -82,6 +82,8 @@
   = attribute tts:textOutline { TTAF.TextOutline.datatype }?
 TTAF.textShadow.attrib
   = attribute tts:textShadow { TTAF.TextShadow.datatype }?
+TTAF.translate.attrib
+  = attribute tts:translate { TTAF.Translate.datatype }?
 TTAF.unicodeBidi.attrib
   = attribute tts:unicodeBidi { TTAF.UnicodeBidi.datatype }?
 TTAF.visibility.attrib
@@ -139,6 +141,7 @@
   TTAF.textOrientation.attrib,
   TTAF.textOutline.attrib,
   TTAF.textShadow.attrib,
+  TTAF.translate.attrib,
   TTAF.unicodeBidi.attrib,
   TTAF.visibility.attrib,
   TTAF.width.attrib,
--- a/ttml2/spec/ttml2-changes.html	Wed Jan 14 19:34:08 2015 -0700
+++ b/ttml2/spec/ttml2-changes.html	Sat Jan 17 09:09:39 2015 -0700
@@ -102,7 +102,8 @@
   'tts:textCombine,
   'tts:textEmphasis,
   'tts:textOrientation',
-  'tts:textShadow', and
+  'tts:textShadow',
+  'tts:translate, and
   'tts:width'
   to Table 5-5.
 
@@ -234,45 +235,47 @@
 
 * In 10.1.2, add Metadata.class children to 'style' element.
 
-* In 10.2, add 'tts:backgroundImage styling attribute.
+* In 10.2, add 'tts:backgroundImage' styling attribute.
 
-* In 10.2, add 'tts:backgroundPosition styling attribute.
+* In 10.2, add 'tts:backgroundPosition' styling attribute.
 
-* In 10.2, add 'tts:backgroundRepeat styling attribute.
+* In 10.2, add 'tts:backgroundRepeat' styling attribute.
 
 * In 10.2, add 'tts:border' styling attribute.
 
-* In 10.2, add 'tts:fontKerning styling attribute.
+* In 10.2, add 'tts:fontKerning' styling attribute.
 
-* In 10.2, add 'tts:fontSelectionStrategy styling attribute.
+* In 10.2, add 'tts:fontSelectionStrategy' styling attribute.
 
-* In 10.2, add 'tts:fontShear styling attribute.
+* In 10.2, add 'tts:fontShear' styling attribute.
 
 * In 10.2, add 'tts:fontVariantPosition' attribute.
 
-* In 10.2, add 'tts:height styling attribute.
-
-* In 10.2, add 'tts:letterSpacing styling attribute.
-
-* In 10.2, add 'tts:position styling attribute.
-
-* In 10.2, add 'tts:ruby styling attribute.
+* In 10.2, add 'tts:height' styling attribute.
 
-* In 10.2, add 'tts:rubyAlign styling attribute.
-
-* In 10.2, add 'tts:rubyOffset styling attribute.
+* In 10.2, add 'tts:letterSpacing' styling attribute.
 
-* In 10.2, add 'tts:rubyPosition styling attribute.
+* In 10.2, add 'tts:position' styling attribute.
 
-* In 10.2, add 'tts:textCombine styling attribute.
+* In 10.2, add 'tts:ruby' styling attribute.
 
-* In 10.2, add 'tts:textEmphasis styling attribute.
+* In 10.2, add 'tts:rubyAlign' styling attribute.
+
+* In 10.2, add 'tts:rubyOffset' styling attribute.
+
+* In 10.2, add 'tts:rubyPosition' styling attribute.
+
+* In 10.2, add 'tts:textCombine' styling attribute.
+
+* In 10.2, add 'tts:textEmphasis' styling attribute.
 
 * In 10.2, add 'tts:textOrientation' styling attribute.
 
 * In 10.2, add 'tts:textShadow' styling attribute.
 
-* In 10.2, add 'tts:width styling attribute.
+* In 10.2, add 'tts:translate' styling attribute.
+
+* In 10.2, add 'tts:width' styling attribute.
 
 * In 10.2 prologue, add proscription against specifying non-applicable,,
   non-inheritable style attributes on stylable elements.
--- a/ttml2/spec/ttml2.xml	Wed Jan 14 19:34:08 2015 -0700
+++ b/ttml2/spec/ttml2.xml	Sat Jan 17 09:09:39 2015 -0700
@@ -3024,6 +3024,7 @@
 <loc href="#style-attribute-textOrientation">tts:textOrientation</loc>,
 <loc href="#style-attribute-textOutline">tts:textOutline</loc>,
 <loc href="#style-attribute-textShadow">tts:textShadow</loc>,
+<loc href="#style-attribute-translate">tts:translate</loc>,
 <loc href="#style-attribute-unicodeBidi">tts:unicodeBidi</loc>,
 <loc href="#style-attribute-visibility">tts:visibility</loc>,
 <loc href="#style-attribute-width">tts:width</loc>,
@@ -5718,6 +5719,8 @@
   : forced
   | mediaAspectRatio
   | mediaLanguage
+  | stereoLeft
+  | stereoRight
   | userLanguage
 </eg>
 </td>
@@ -5744,6 +5747,20 @@
 <p>Evaluates to a string value equal to the (primary) language of the <loc href="#terms-related-media-object">related media object</loc>.</p>
 </def>
 </gitem>
+<gitem id="bound-parameter-stereoLeft">
+<label><code>stereoLeft</code></label>
+<def>
+<p>Evaluates to a boolean value that denotes if the <loc href="#terms-content-processor">content processor</loc> is processing the
+left image of a stereo presentation.</p>
+</def>
+</gitem>
+<gitem id="bound-parameter-stereoRight">
+<label><code>stereoRight</code></label>
+<def>
+<p>Evaluates to a boolean value that denotes if the <loc href="#terms-content-processor">content processor</loc> is processing the
+right image of a stereo presentation.</p>
+</def>
+</gitem>
 <gitem id="bound-parameter-userLanguage">
 <label><code>userLanguage</code></label>
 <def>
@@ -7308,6 +7325,7 @@
 <item><p><specref ref="style-attribute-textOrientation"/></p></item>
 <item><p><specref ref="style-attribute-textOutline"/></p></item>
 <item><p><specref ref="style-attribute-textShadow"/></p></item>
+<item><p><specref ref="style-attribute-translate"/></p></item>
 <item><p><specref ref="style-attribute-unicodeBidi"/></p></item>
 <item><p><specref ref="style-attribute-visibility"/></p></item>
 <item><p><specref ref="style-attribute-width"/></p></item>
@@ -11224,6 +11242,70 @@
 that defined by <bibref ref="css3-decoration"/>, &sect; 4.</p>
 </note>
 </div3>
+<div3 id="style-attribute-translate">
+<head>tts:translate</head>
+<p>The <att>tts:translate</att> attribute is used to specify <emph>x</emph> and <emph>y</emph> translations (offsets) of a
+region area with respect to the nominal (untranslated) origin of the region.</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-translate" role="common">
+<col width="25%"/>
+<col/>
+<tbody>
+<tr>
+<td><emph>Values:</emph></td>
+<td>
+<loc href="#style-value-length">&lt;length&gt;</loc> <loc href="#style-value-length">&lt;length&gt;</loc>
+</td>
+</tr>
+<tr>
+<td><emph>Initial:</emph></td>
+<td><code>0px 0px</code></td>
+</tr>
+<tr>
+<td><emph>Applies to:</emph></td>
+<td>
+<loc href="#content-vocabulary-div"><el>div</el></loc>,
+<loc href="#content-vocabulary-p"><el>p</el></loc>,
+<loc href="#layout-vocabulary-region"><el>region</el></loc>
+</td>
+</tr>
+<tr>
+<td><emph>Inherited:</emph></td>
+<td>no</td>
+</tr>
+<tr>
+<td><emph>Percentages:</emph></td>
+<td>relative to width and height of <loc href="#terms-root-container-region">root container region</loc></td>
+</tr>
+<tr>
+<td><emph>Animatable:</emph></td>
+<td>discrete, continuous</td>
+</tr>
+</tbody>
+</table>
+<p>If the value of this attribute consists of two <loc href="#style-value-length">&lt;length&gt;</loc> specifications,
+then they must be interpreted as <emph>x</emph> and <emph>y</emph> offsets, where the first specification
+is the <emph>x</emph> offset, and the second specification is the <emph>y</emph> offset, and where negative values mean to the right or bottom of the affected
+region, respectively</p>
+<p>If a <att>tts:translate</att> attribute is specified on a <el>div</el> or <el>p</el> element, then that specification must be considered to be
+equivalent to specifying an anonymous <loc href="#terms-inline-region">inline region</loc> child of the <el>div</el> or <el>p</el> element, where the
+translation of the corresponding region, also referred to as an <loc href="#terms-implied-inline-region">implied inline region</loc>, is equal to the
+value of this attribute.</p>
+<p>If a computed value of the property associated with this attribute is not supported,
+then a <loc href="#terms-presentation-processor">presentation processor</loc> must use the closest supported value.</p>
+<note role="elaboration">
+<p>In this context, the phrase <emph>closest supported value</emph> means the value for which the Euclidean distance between
+the computed translate and the supported translate is minimized. If there are multiple closest supported values equally distant from
+the computed value, then the value least distant from [0,0], i.e., closest to the coordinate space origin, is used.</p>
+</note>
+<ednote>
+<name>Translate Example</name>
+<date>2015-01-17</date>
+<edtext>Insert example fragment and image of tts:translate.</edtext>
+</ednote>
+</div3>
 <div3 id="style-attribute-unicodeBidi">
 <head>tts:unicodeBidi</head>
 <p>The <att>tts:unicodeBidi</att> attribute is used to specify a style property that
--- a/ttml2/spec/xsd/ttml2-datatypes.xsd	Wed Jan 14 19:34:08 2015 -0700
+++ b/ttml2/spec/xsd/ttml2-datatypes.xsd	Sat Jan 17 09:09:39 2015 -0700
@@ -695,6 +695,12 @@
     </xs:annotation>
     <xs:restriction base="xs:string"/>
   </xs:simpleType>
+  <xs:simpleType name="translate">
+    <xs:annotation>
+      <xs:documentation>length length</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
   <xs:simpleType name="unicodeBidi">
     <xs:restriction base="xs:token">
       <xs:enumeration value="normal"/>
--- a/ttml2/spec/xsd/ttml2-styling-attribs.xsd	Wed Jan 14 19:34:08 2015 -0700
+++ b/ttml2/spec/xsd/ttml2-styling-attribs.xsd	Sat Jan 17 09:09:39 2015 -0700
@@ -42,6 +42,7 @@
   <xs:attribute name="textOrientation" type="ttd:textOrientation"/>
   <xs:attribute name="textOutline" type="ttd:textOutline"/>
   <xs:attribute name="textShadow" type="ttd:textShadow"/>
+  <xs:attribute name="translate" type="ttd:translate"/>
   <xs:attribute name="unicodeBidi" type="ttd:unicodeBidi"/>
   <xs:attribute name="visibility" type="ttd:visibility"/>
   <xs:attribute name="width" type="ttd:measure"/>
@@ -86,6 +87,7 @@
     <xs:attribute ref="tts:textOrientation"/>
     <xs:attribute ref="tts:textOutline"/>
     <xs:attribute ref="tts:textShadow"/>
+    <xs:attribute ref="tts:translate"/>
     <xs:attribute ref="tts:unicodeBidi"/>
     <xs:attribute ref="tts:visibility"/>
     <xs:attribute ref="tts:width"/>