Add 'lang' attribute to desc and title elements.
authortbah <tavmjong@free.fr>
Thu, 25 Oct 2012 21:57:58 +0200
changeset 397 59e3920357cb
parent 396 4efb00e645f2
child 400 78f52c402bad
Add 'lang' attribute to desc and title elements.
master/definitions.xml
master/struct.html
--- a/master/definitions.xml	Thu Oct 25 21:00:24 2012 +0200
+++ b/master/definitions.xml	Thu Oct 25 21:57:58 2012 +0200
@@ -167,6 +167,7 @@
     href='struct.html#DescElement'
     contentmodel='any'
     attributecategories='core, style'
+    attributes='lang'
     interfaces='SVGDescElement'/>
 
   <element
@@ -705,6 +706,7 @@
     href='struct.html#TitleElement'
     contentmodel='any'
     attributecategories='core, style'
+    attributes='lang'
     interfaces='SVGTitleElement'/>
 
   <element
@@ -785,6 +787,9 @@
        their 'attribute' attribute.
   -->
 
+  <!-- attributes common to both desc and title -->
+  <attribute name='lang' elements='desc, title' href='fonts.html#GlyphElementLangAttribute'/>
+
   <!-- attributes common to both glyph and missing-glyph -->
   <attribute name='d' elements='glyph, missing-glyph' href='fonts.html#GlyphElementDAttribute'/>
   <attribute name='horiz-adv-x' elements='glyph, missing-glyph' href='fonts.html#GlyphElementHorizAdvXAttribute'/>
--- a/master/struct.html	Thu Oct 25 21:00:24 2012 +0200
+++ b/master/struct.html	Thu Oct 25 21:57:58 2012 +0200
@@ -923,11 +923,18 @@
 <edit:elementsummary name='title'/>
 </div>
 
+<p class="note">The attribute <a>'lang'</a> added to allow internationalization
+of the <a>'desc'</a> and <a>'title element'</a> elements.</p>
+
+<p class="annotation">Adding 'lang' resolved at Rigi Kaltbad face-to-face.
+Removed text that limited number of 'desc' and 'title' elements.</p>
+
 <p class="issue">Is there any updated wording from SVG Tiny 1.2 that we
 should be using wrt tooltips?</p>
 
 <p>Each <a>container element</a> or <a>graphics element</a> in an SVG drawing
-can supply a <a>'desc'</a> and/or a <a>'title'</a> description string where
+can supply one or more <a>'desc'</a> and/or one or more <a>'title'</a> description 
+strings where
 the description is text-only. When the current SVG document fragment is
 rendered as SVG on visual media, <a>'desc'</a> and <a>'title'</a> elements are
 not rendered as part of the graphics. User agents may, however, for example,
@@ -943,14 +950,16 @@
 <p class="issue">I don't think it is easy to use a style sheet to cause
 an element's <a>'title'</a> to be rendered in place of its graphics.</p>
 
-<p>In conforming SVG document fragments, any <a>'title'</a> element should be
-the first child element of its parent.  Note that those implementations that do
-use <a>'title'</a> to display a tooltip often will only do so if the
-<a>'title'</a> is indeed the first child element of its parent.</p>
-
-<p class="issue">Is it a SHOULD or a MUST that the <a>'title'</a> is the first
-element child?  We should check if the statement about implementations looking
-at the first child for a tooltip is still accurate.</p>
+<p>More than one <a>'desc'</a> or <a>'title element'</a> may be
+present with different <a>'lang'</a> attributes. The text displayed
+will be the text from the element where the <a>'lang'</a> attribute
+best matches the language set by the user agent. If no match exists,
+the text from the first element is used (to allow default text to be
+given for legacy renderers). If multiple equally valid matches exist,
+the first match is used.</p>
+
+<p class="issue">'lang' should be defined here (rather than pointing to
+the glyph definition).</p>
 
 <p>The following is an example. In typical operation, the SVG user agent would
 not render the <a>'desc'</a> and <a>'title'</a> elements but would render the
@@ -962,10 +971,9 @@
      version="1.1" width="4in" height="3in">
   <g>
     <title>Company sales by region</title>
-    <desc>
-      This is a bar chart which shows 
-      company sales by region.
-    </desc>
+    <title lang="fr">Chiffre d'affaires par région</title>
+    <desc>Bar chart which shows company sales by region.</desc>
+    <desc lang="fr">Graphique illustrant les ventes par région.</desc>
     <!-- Bar chart defined as vector data -->
   </g>
 </svg>
@@ -1008,31 +1016,8 @@
 available to users. The mechanism for doing so depends on the user agent
 (e.g., as a caption, spoken).</p>
 
-<p>The definitions of many of SVG's elements (particularly,
-container and text elements) place no restriction on the
-placement or number of the <a>'desc'</a> and <a>'title'</a> sub-elements.
-This flexibility is only present so that there will be a consistent
-content model for container elements, because some container
-elements in SVG allow for mixed content, and because
-<a href="http://www.w3.org/TR/2008/REC-xml-20081126/#sec-mixed-content">the mixed content rules for XML</a>
-([<a href="refs.html#ref-XML10">XML10</a>], section 3.2.2)
-do not permit the desired restrictions. Future
-versions of the SVG language might have more restrictive
-mixed content rules. It is strongly recommended that at most
-one <a>'desc'</a> and at most one <a>'title'</a> element appear as a
-child of any particular element, and that these elements appear
-before any other child elements (except possibly
-<a>'metadata'</a> elements) or character data content. If user agents need to
-choose among multiple <a>'desc'</a> or <a>'title'</a> elements for processing
-(e.g., to decide which string to use for a tooltip), the user
-agent shall choose the first one.</p>
-
-<p class="issue">We are no longer using DTDs.  Are we happy to have
-a prose restriction for conforming SVG documents to have at most one
-<a>'title'</a> and <a>'desc'</a> child, and their positions?</p>
-
-<p class="issue">We have this sentence here about tooltips using the
-first element, which is stronger than the earlier note that some
+<p class="issue">We have this sentence here about tooltips
+which is stronger than the earlier note that some
 implementations do this.  We should look at how HTML describes
 the <span class="attr-name">'title'</span> attribute and whether
 a tooltip is required, suggested, etc., and follow that.</p>