W3C home > Mailing lists > Public > www-svg@w3.org > May 2000

SVGDocument::title

From: Steve Dickson <sdickson@savagesoftware.com>
Date: Mon, 29 May 2000 15:57:22 -0700
Message-id: <fc.0085846d00006b170085846d00006b17.6b2d@savagesoftware.com>
To: www-svg@w3.org
In the SVG WD spec of 2000/03/03, section B.4 describes the
SVGDOMImplementation interface, which contains a factory method for
creating SVGDocument instances.  The method signature is as follows:
	SVGDocument		createSVGDocument(in DOMString title);
but the description underneath says that the method takes no parameters.

Since the method signature is specified in two separate locations (B.4
above and also in the Appendix C IDL definitions) and both show a
DOMString title parameter, I assume that the 'no parameter' text in the
B.4 description is a typo.

However, attempting to assign a title to a document when it is created
leads to some problems.  

Section 6.10 describes SVGDocument::title as follows:
	attribute DOMString title
	The title of a document as specified by the title sub-element of the
'svg' root element (i.e., 
	<svg><title>Here is the title</title>...</svg>)

That is, the document root <svg> element must be in place before the
<title> sub-element can be set.  This root element will not be in place
when the document is created, so setting <title> must be deferred until
the root element is in place.  It is not immediately obvious when and how
this deferred assignment can be made.  For instance, the implementor could
check for a valid root element and, if one exists, perform the deferred
title assignment in SVGDocument::getTitle(), SVGDocument::getRootElement()
and/or another appropriate method.  This mechanism would probably work
just fine, as long as the user uses only SVG provided methods.  However,
the user may choose to use DOM calls such as getChildNodes(),
getFirstChild(), getNextSibling() etc, to access the SVGDOM tree nodes, in
which case this deferred check/assignment mechanism will not work.  In
this case, each of the DOM node accessor functions would need to perform
the check/deferred assignment as well.  This would obviously be a messy
and convoluted solution.

Does anyone have any pointers on how the <title> element assignment can be
performed cleanly and (hopefully) easily?

S.
Received on Monday, 29 May 2000 18:57:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 5 November 2012 23:52:47 GMT