W3C home > Mailing lists > Public > www-svg@w3.org > July 2011

Behaviour of empty SVGTitleElements

From: Klaus Förster <klaus.foerster@uibk.ac.at>
Date: Fri, 01 Jul 2011 14:59:15 +0200
Message-ID: <4E0DC4A3.9010502@uibk.ac.at>
To: www-svg@w3.org
Hello group,

How should an empty SVGTitleElement of an element be treated, if its 
parent node has a non emtpy SVGTitleElement?

<g>
   <title>title of g</title>
   <rect>
     <title></title><!-- empty string as title here -->
   </rect>
</g>

Firefox and Chrome seem to eliminate the rectangles empty title element 
and resolve the title element of the group as tooltip instead [1]. Is 
this the desired behaviour? The Spec at 
http://www.w3.org/TR/SVG/struct.html#TitleElement is not clear about 
this case, it only states: "If user agents need to choose among multiple 
‘desc’ or ‘title’ elements for processing (e.g., to decide which string 
to use for a tooltip), the user agent shall choose the first one." It 
does not say, whether empty titles should be stripped prior to making 
this choice or not.

The consequence of this behaviour is, that you are not able to "reset" 
titles (and thus tooltips) as soon as you have specified a title on the 
parent node. Setting <title> </title> seems like a poor hack to overcome 
this situation.

Any thoughts on this topic?

greetings
Klaus

[1] http://svg.cc/posts/emptyTitleBehaviour.svg
-- 
Klaus Förster
Department of Geography
University of Innsbruck
A-6020 Innsbruck, Innrain 52
Received on Friday, 1 July 2011 12:59:39 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:48 GMT