Re: Tests Email and struct-dom-14-f.svg

On Thu, 03 Jun 2010 23:18:44 +0200, Patrick Dengler <patd@microsoft.com>  
wrote:

> I certainly didn't mean to send that email about the test suite so  
> widely (got lost between public=private and vice-versa).
>
> Either way, I think we need to fix these.  I am having my test team look  
> into some proposals.
>
> On another note, we caught a test:
>
> struct-dom-14-f.svg
>
> That was in error.
>
> The spec says nothing about equality of elementInstances
>
>             if (instanceroot.firstChild.correspondingElement !==  
> instanceroot.childNodes.item(0).correspondingElement)
>               throw("failed");
>
> But is clear about correspondingElement; so I presume this is what this  
> test should be testing; I made the change below:
>
>             if (instanceroot.firstChild!==  
> instanceroot.childNodes.item(0)
>               throw("failed");

The type of object returned from correspondingElement is not an  
SVGElementInstance, it's supposed to be the corresponding SVGElement  
object (e.g an SVGRectElement if the corresponding element was a rect,  
which is also exemplified in the text above the interface[2]). I had  
another look at the wording in the spec and it looks to be slightly  
confused about this. On the one hand it's rather clear on what  
correspondingElement should be: "The corresponding element to which this  
object is an instance." [1], but the example that follows is incorrect.

So I'd like to replace the (dis)informative example[1]:
"For example, if a 'use' element references a 'rect' element, then an  
SVGElementInstance is created, with its correspondingElement being the  
SVGElementInstance object for the 'rect' element."
with:
"For example, if a 'use' element references a 'rect' element, then an  
SVGElementInstance is created, with its correspondingElement being the  
SVGRectElement object for the 'rect' element."

I think you may have a point about the SVGElementInstances possibly being  
different in the SVGElementInstanceList vs  
SVGElementInstance.firstChild/lastChild/previousSibling/nextSibling, the  
spec doesn't seem to require strict equality there (even if IMHO it would  
make sense to require that). FWIW both Webkit and Opera treats these  
SVGElementInstances as being strictly equal.

Cheers
/Erik

[1]  
http://dev.w3.org/SVG/profiles/1.1F2/publish/struct.html#__svg__SVGElementInstance__correspondingElement
[2]  
http://dev.w3.org/SVG/profiles/1.1F2/publish/struct.html#InterfaceSVGElementInstance

-- 
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed

Received on Friday, 4 June 2010 08:03:48 UTC