[Webkit-unassigned] [Bug 27183] New: SVG mouse event clientX/Y not converted to SVG space properly using screen CTM

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jul 11 15:11:50 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=27183

           Summary: SVG mouse event clientX/Y not converted to SVG space
                    properly using screen CTM
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh
        OS/Version: Mac OS X 10.4
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: SVG
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: gbrauen at connect.carleton.ca
                CC: ahayes at polkaroo.net, bugzilla at fiset.ca


Created an attachment (id=32619)
 --> (https://bugs.webkit.org/attachment.cgi?id=32619)
SVG test document.

The following javascript should convert the clientX/Y coordinates for a mouse
event to SVG coordinate space:

var m = document.documentElement.getScreenCTM();
var p = document.documentElement.createSVGPoint(); 
p.x = evt.clientX;
p.y = evt.clientY; 
p = p.matrixTransform(m.inverse());

In Safari 4.0.2 and all webkit nightlies since r43284 (May 6, 2009) this
coordinate transformation does not work properly.  The transformation depends
on how the SVG viewport fits in the browser window.  If the SVG viewport
exactly matches, the transformation seems to be alright but if you stretch the
browser window horizontally or vertically, the transformation is off.

I'll attach a SVG document that demonstrates the problem by displaying a
tooltip showing the SVG coordinates for mouse events when the cursor is
positioned over a rectangle in the document.

What works, what doesn't:

Defect appeared in latest Safari 4 (4.0.2).  Safari 4.0.1 was fine.
Firefox 3 is fine.

Also tested webkit nightlies:
r45754 (July 11, 2009): broken
r45423 (July 1, 2009): broken
r44341 (June 4, 2009): broken
r43796 (May 16, 2009): broken
r43436 (May 9, 2009): broken
r43284 (May 6, 2009): broken
r43163 (May 3, 2009): fine
r43110 (May 1, 2009): fine

To reporoduce: 

Download and open the attached SVG (ScreenCoordinates.svg).  Mouseover the
rectangle and check the position and content of the tooltip displayed - it
should be located on (above and to the right of) the cursor.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list