W3C home > Mailing lists > Public > public-svg-wg@w3.org > October to December 2009

intersection test review, struct-dom-11-f.svg

From: Erik Dahlstrom <ed@opera.com>
Date: Fri, 11 Dec 2009 15:01:50 +0100
To: "public-svg-wg@w3.org" <public-svg-wg@w3.org>
Cc: "Cameron McCormack" <cam@mcc.id.au>
Message-ID: <op.u4r089c1geuyw5@localhost>
Hello svg-wg,

I've been reviewing testcases for checkIntersection, getIntersectionList,  
checkEnclosure and getEnclosureList (one of the remaining unreviewed  


I've tested Batik 1.7 and Opera 10.10, and it seems like "initial  
coordinate system" from the definitions of the above methods may have been  
interpreted differently. Opera expects the rectangle that is passed in to  
be in initial viewport coordinates[1], so to pass the test the coordinates  
that are given in the test (which seem to be in user units) need to be  
transformed first. The test works fine if and only if the userspace  
coordinate system matches the initial viewport coordinate system, or in  
other words when the computed size of the svg image matches the viewBox.  
If loading the svg file separately in Opera it fails because the two  
coordinate spaces usually don't match.

Batik seems to not honor the 'pointer-events' property when considering  
which elements to return, while Opera does. The test has a <g> element  
that has visibility="hidden" and it expects the elements inside to be  
intersected. This is not the case unless e.g pointer-events="painted" is  

Opera expects the elements to be within the viewport, while Batik has no  
problems with elements outside the viewport. Anyway, moving the elements  
in the test a bit and adding pointer-events="painted" makes it pass in  
both viewers (as long as the testframe dimensions matches the viewBox). To  
make the test more robust the userspace coordinates used in the 'rect'  
parameter need to be transformed to the initial viewport coordinate system  
before passing it to checkIntersection/getIntersectionList.

/Erik (part of ACTION-2695)

[1] http://www.w3.org/TR/SVG11/coords.html#InitialCoordinateSystem

Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed
Received on Friday, 11 December 2009 14:00:54 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:20:11 UTC