Re: [whatwg] Document.title for SVG documents

Ian Hickson wrote:
> I'm all for handling it in one place. What precisely do you want the
> behaviour to be? (Consider HTML-in-SVG and SVG-in-HTML also -- "the first
> <svg:title>  element" may come after "the first<html:title>  element", and
> vice versa. Also consider when one or the other is "primary" but the
> relevant element is absent.)

OK, how about: if the document element is an <html:html>, we choose the 
first <html:title> in document order; if the document element is an 
<svg:svg>, we choose the first child <svg:title> of the document 
element; otherwise, null.

This still is going to produce "incorrect" results for things like:

   <!DOCTYPE html>
   <svg>
     <foreignObject>
       <title>blah</title>
     </foreignObject>
   </svg>

but arguably you shouldn't be using <title> in there anyway.

Received on Tuesday, 4 February 2014 00:25:44 UTC