Do you want to just handle that all in HTML? I'm not sure there's much value to duplicating either the searching for the title element or the white space collapsing behaviour in SVG itself.
Currently, HTML defines Document.title on SVG documents to defer to
whatever the SVG specification defines for SVGDocument.title. The
SVGDocument interface has gone away, so this will need to be updated.
From some basic testing, it looks like SVG needs the same behaviour as
HTML -- first <title> element in the document, plus the white space
collapsing behaviour.
- [whatwg] Document.title for SVG documents Cameron McCormack
- Re: [whatwg] Document.title for SVG documents Cameron McCormack
- Re: [whatwg] Document.title for SVG documents Dirk Schulze
- Re: [whatwg] Document.title for SVG documents Cameron McCormack
- Re: [whatwg] Document.title for SVG documents Ian Hickson
- Re: [whatwg] Document.title for SVG documents Cameron McCormack
- Re: [whatwg] Document.title for SVG documen... Jonas Sicking
- Re: [whatwg] Document.title for SVG doc... Cameron McCormack
- Re: [whatwg] Document.title for SV... Dirk Schulze
- Re: [whatwg] Document.title for SVG documen... Anne van Kesteren
- Re: [whatwg] Document.title for SVG doc... Ian Hickson