RESOLVED FIXED 96361
getScreenCTM returns different values depending on zoom
https://bugs.webkit.org/show_bug.cgi?id=96361
Summary getScreenCTM returns different values depending on zoom
Hannes
Reported 2012-09-11 00:32:36 PDT
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/
Attachments
Patch (6.44 KB, patch)
2012-09-11 09:32 PDT, Florin Malita
no flags
Patch for landing (6.39 KB, patch)
2012-09-12 06:59 PDT, Florin Malita
no flags
Patch for landing (6.39 KB, patch)
2012-09-12 07:07 PDT, Florin Malita
no flags
Hannes
Comment 1 2012-09-11 00:33:49 PDT
Firefox works fine. Safari, Chrome have problems.
Florin Malita
Comment 2 2012-09-11 08:10:59 PDT
Looks like SVGSVGElement::localCoordinateSpaceTransform() does not adjust for the zoom level factored into localToAbsolute(). Patch to follow.
Florin Malita
Comment 3 2012-09-11 09:32:30 PDT
Dirk Schulze
Comment 4 2012-09-11 20:21:49 PDT
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?
Hannes
Comment 5 2012-09-12 03:32:50 PDT
You guys are fast. Thanks. When will it work for everybody in the whole world?
Florin Malita
Comment 6 2012-09-12 06:59:08 PDT
Created attachment 163618 [details] Patch for landing
Florin Malita
Comment 7 2012-09-12 07:07:16 PDT
Created attachment 163619 [details] Patch for landing
Florin Malita
Comment 8 2012-09-12 07:33:22 PDT
(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.
WebKit Review Bot
Comment 9 2012-09-12 07:36:03 PDT
Comment on attachment 163619 [details] Patch for landing Clearing flags on attachment: 163619 Committed r128309: <http://trac.webkit.org/changeset/128309>
WebKit Review Bot
Comment 10 2012-09-12 07:36:07 PDT
All reviewed patches have been landed. Closing bug.
Philip Rogers
Comment 11 2012-09-14 18:23:27 PDT
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.
Note You need to log in before you can comment on or make changes to this bug.