Re: SVG 1.1 Does no text exist in the DOM? or why no eggs?

On 10/2/10 8:20 PM, Alex Danilo wrote:
> 	As a guess, the first SVG text node has a single DOM text
> node child containing one space. In the second case, there is no
> child text node since the XML tags butt up against one another.

Correct.

> 	The implementation of 'nodeValue' applying to the parent
> SVG text node should create a new DOM text node child to hold the
> 'eggs' when it is set

No, setting nodeValue on a textnode should simply set the text inside 
the text node.  Setting nodeValue on an element is a silent no-op. 
Setting nodeValue never creates a "new DOM text node child".

> Current code most likely looks for an existing
> child text node and tries to replace the referenced string. It should
> of course see the missing child node and add a new one to host the 'eggs'.

Um, no.  Not at all.  I'd _really_ like to know what part of DOM3 Core 
led you to think the above so it can be rewritten....

> 	But it appears that this case isn't being handled
> correctly in current implementations. Makes for a good test.

I agree it makes for a test, and maybe a good one, but it's certainly 
being handled correctly!

> 	This could be put into an SVG test since it is testing
> the specific case of setting the text child content on an SVG
> text node which is quite different to the HTML world.

Oh, really?  How so?  Citation needed, etc.

-Boris

Received on Sunday, 3 October 2010 01:15:26 UTC