[ttml2] add schema support for tts:background{Image,Position,Repeat} attributes
authorGlenn Adams <glenn@skynav.com>
Sat, 22 Nov 2014 07:16:43 -0700
changeset 764 67327764d375
parent 763 007626644900
child 765 25035c814da5
[ttml2] add schema support for tts:background{Image,Position,Repeat} attributes
ttml2/spec/rnc/ttml2-datatypes.rnc
ttml2/spec/rnc/ttml2-styling-attribs.rnc
ttml2/spec/xsd/ttml2-datatypes.xsd
ttml2/spec/xsd/ttml2-styling-attribs.xsd
--- a/ttml2/spec/rnc/ttml2-datatypes.rnc	Fri Nov 21 17:46:04 2014 -0700
+++ b/ttml2/spec/rnc/ttml2-datatypes.rnc	Sat Nov 22 07:16:43 2014 -0700
@@ -14,6 +14,19 @@
 TTAF.AnimationValueList.datatype =
   string
 
+TTAF.BackgroundImage.datatype =
+  TTAF.Image.datatype |
+  "none"
+
+TTAF.BackgroundPosition.datatype =
+  string
+
+TTAF.BackgroundRepeat.datatype =
+  "noRepeat" |
+  "repeat" |
+  "repeatX" |
+  "repeatY"
+
 TTAF.Boolean.datatype =
   xsd:boolean
 
@@ -112,6 +125,9 @@
 TTAF.FrameRateMultiplier.datatype =
   xsd:string { pattern = "\p{Nd}+\s+\p{Nd}+" }
 
+TTAF.Image.datatype =
+  TTAF.URI.datatype
+
 TTAF.InferProcessorProfileMethod.datatype =
   "loose" |
   "strict"
--- a/ttml2/spec/rnc/ttml2-styling-attribs.rnc	Fri Nov 21 17:46:04 2014 -0700
+++ b/ttml2/spec/rnc/ttml2-styling-attribs.rnc	Sat Nov 22 07:16:43 2014 -0700
@@ -10,6 +10,12 @@
 
 TTAF.backgroundColor.attrib
   = attribute tts:backgroundColor { TTAF.Color.datatype }?
+TTAF.backgroundImage.attrib
+  = attribute tts:backgroundImage { TTAF.BackgroundImage.datatype }?
+TTAF.backgroundPosition.attrib
+  = attribute tts:backgroundPosition { TTAF.BackgroundPosition.datatype }?
+TTAF.backgroundRepeat.attrib
+  = attribute tts:backgroundRepeat { TTAF.BackgroundRepeat.datatype }?
 TTAF.border.attrib
   = attribute tts:border { TTAF.Border.datatype }?
 TTAF.color.attrib
@@ -80,6 +86,9 @@
 
 TTAF.Styling.attrib.class &=
   TTAF.backgroundColor.attrib,
+  TTAF.backgroundImage.attrib,
+  TTAF.backgroundPosition.attrib,
+  TTAF.backgroundRepeat.attrib,
   TTAF.border.attrib,
   TTAF.color.attrib,
   TTAF.direction.attrib,
--- a/ttml2/spec/xsd/ttml2-datatypes.xsd	Fri Nov 21 17:46:04 2014 -0700
+++ b/ttml2/spec/xsd/ttml2-datatypes.xsd	Sat Nov 22 07:16:43 2014 -0700
@@ -17,6 +17,32 @@
     </xs:annotation>
     <xs:restriction base="xs:string"/>
   </xs:simpleType>
+  <xs:simpleType name="backgroundImage">
+    <xs:union>
+      <xs:simpleType>
+        <xs:restriction base="xs:anyURI"/>
+      </xs:simpleType>
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="none"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:union>
+  </xs:simpleType>
+  <xs:simpleType name="backgroundPosition">
+    <xs:annotation>
+      <xs:documentation>length | length length</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+  <xs:simpleType name="backgroundRepeat">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="noRepeat"/>
+      <xs:enumeration value="repeat"/>
+      <xs:enumeration value="repeatX"/>
+      <xs:enumeration value="repeatY"/>
+    </xs:restriction>
+  </xs:simpleType>
   <xs:simpleType name="border">
     <xs:annotation>
       <xs:documentation>[ borderWidth || borderStyle || borderColor ]</xs:documentation>
--- a/ttml2/spec/xsd/ttml2-styling-attribs.xsd	Fri Nov 21 17:46:04 2014 -0700
+++ b/ttml2/spec/xsd/ttml2-styling-attribs.xsd	Sat Nov 22 07:16:43 2014 -0700
@@ -6,6 +6,9 @@
   <xs:import namespace="http://www.w3.org/ns/ttml#datatype"
     schemaLocation="ttml2-datatypes.xsd"/>
   <xs:attribute name="backgroundColor" type="ttd:color"/>
+  <xs:attribute name="backgroundImage" type="ttd:backgroundImage"/>
+  <xs:attribute name="backgroundPosition" type="ttd:backgroundPosition"/>
+  <xs:attribute name="backgroundRepeat" type="ttd:backgroundRepeat"/>
   <xs:attribute name="border" type="ttd:border"/>
   <xs:attribute name="color" type="ttd:color"/>
   <xs:attribute name="direction" type="ttd:direction"/>
@@ -38,6 +41,9 @@
   <xs:attribute name="zIndex" type="ttd:zIndex"/>
   <xs:attributeGroup name="Styling.attrib.class">
     <xs:attribute ref="tts:backgroundColor"/>
+    <xs:attribute ref="tts:backgroundImage"/>
+    <xs:attribute ref="tts:backgroundPosition"/>
+    <xs:attribute ref="tts:backgroundRepeat"/>
     <xs:attribute ref="tts:border"/>
     <xs:attribute ref="tts:color"/>
     <xs:attribute ref="tts:direction"/>