Zooming in the browser, ctr and (+/- button) affects how getScreenCTM returns diffrent values on svg. I made a jsfiddle to show you how. 1. Go to http://jsfiddle.net/sqfzD/ 2. Move the mouse. Se that everything works well. 3. Zoom in the browser. 4. Move the mouse. 5. Se that the box is not at the same place when you did not zoom. What is the expected result? Box should be at the mouse position. What happens instead? The box is offset from the mouse position depending on the zoom. Please provide any additional information below. Attach a screenshot if possible. http://jsfiddle.net/sqfzD/
Firefox works fine. Safari, Chrome have problems.
Looks like SVGSVGElement::localCoordinateSpaceTransform() does not adjust for the zoom level factored into localToAbsolute(). Patch to follow.
Created attachment 163384 [details] Patch
Comment on attachment 163384 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=163384&action=review > Source/WebCore/svg/SVGSVGElement.cpp:441 > + float zoomFactor = 1.0f; just 1?
You guys are fast. Thanks. When will it work for everybody in the whole world?
Created attachment 163618 [details] Patch for landing
Created attachment 163619 [details] Patch for landing
(In reply to comment #4) > > Source/WebCore/svg/SVGSVGElement.cpp:441 > > + float zoomFactor = 1.0f; > > just 1? Done, thanks for reviewing. (In reply to comment #5) > You guys are fast. Thanks. When will it work for everybody in the whole world? This will probably be in Chrome 23 (dev channel after a few days, stable channel 1-2 months). Don't know about Safari.
Comment on attachment 163619 [details] Patch for landing Clearing flags on attachment: 163619 Committed r128309: <http://trac.webkit.org/changeset/128309>
All reviewed patches have been landed. Closing bug.
I think this change caused a 2% regression in our hit testing benchmark: http://webkit-perf.appspot.com/graph.html#tests=[[5167282,2001,173262]]&sel=none&displayrange=30&datatype=running I looked at the profile and I don't think there is much we can do to avoid this, so I'll just note it here for posterity.