W3C home > Mailing lists > Public > www-svg@w3.org > June 2006

Re: [SVG12Mobile]: uDOM SVGElement and Element

From: Erik Dahlström <ed@opera.com>
Date: Thu, 15 Jun 2006 16:03:44 +0200
To: www-svg@w3.org
Message-ID: <op.ta6xcizxgqiacl@gnorps.palace.opera.no>

Diego wrote:

> Reading the uDOM idl I don't understand if SVGDocument and SVGElement
> are accessible (in a SVG context) from a Document and Element nodes.
> In particular, if I create an SVG element through the document
> (Document interface) as in the following script:
>
> Function a()
> {
> var mySVGRect = document.createElementNS("SVGNS", "rect");
>
> Then can I use the interface SVGElement on it?
>
> mySVGRect.id = "IDNameOfSVGNode";

Well, first off, "SVGNS" should be "http://www.w3.org/2000/svg" but I'll  
assume you meant that in the first place.

So if this condition is fulfilled the answer to your question is: yes.
If you really meant the string "SVGNS" as namespace, then the answer is:  
no, because the element is not an SVG element in that case.

> It seems reasonable to me working in that way in order to ensure the
> access to svg module from the dom module but it is not clearly
> declared in the SVG1.2t draft.

See http://www.w3.org/TR/SVGMobile12/svgudom.html#svg::SVGElement.
It says that the interface represents an SVG element in the document tree.  
So if you create a valid SVG element with createElementNS then it follows  
that you get this interface on that element.

Please let us know shortly if this does not address your concern.
/Erik, on behalf of the SVG WG

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Received on Thursday, 15 June 2006 14:06:02 GMT

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