Changeset 128309 in webkit
- Timestamp:
- Sep 12, 2012 7:36:26 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r128306 r128309 1 2012-09-12 Florin Malita <fmalita@chromium.org> 2 3 getScreenCTM returns different values depending on zoom 4 https://bugs.webkit.org/show_bug.cgi?id=96361 5 6 Reviewed by Dirk Schulze. 7 8 * svg/zoom/page/zoom-get-screen-ctm-expected.txt: Added. 9 * svg/zoom/page/zoom-get-screen-ctm.html: Added. 10 1 11 2012-09-12 Allan Sandfeld Jensen <allan.jensen@nokia.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r128307 r128309 1 2012-09-12 Florin Malita <fmalita@chromium.org> 2 3 getScreenCTM returns different values depending on zoom 4 https://bugs.webkit.org/show_bug.cgi?id=96361 5 6 Reviewed by Dirk Schulze. 7 8 SVGSVGElement::localCoordinateSpaceTransform() needs to adjust for the 9 zoom level (which is already factored into CSS coordinates) at the 10 SVG/HTML boundary. 11 12 Test: svg/zoom/page/zoom-get-screen-ctm.html 13 14 * svg/SVGSVGElement.cpp: 15 (WebCore::SVGSVGElement::localCoordinateSpaceTransform): 16 1 17 2012-09-12 Simon Hausmann <simon.hausmann@nokia.com> 2 18 -
trunk/Source/WebCore/svg/SVGSVGElement.cpp
r127474 r128309 439 439 if (RenderObject* renderer = this->renderer()) { 440 440 FloatPoint location; 441 441 float zoomFactor = 1; 442 442 443 // At the SVG/HTML boundary (aka RenderSVGRoot), we apply the localToBorderBoxTransform 443 444 // to map an element from SVG viewport coordinates to CSS box coordinates. 444 445 // RenderSVGRoot's localToAbsolute method expects CSS box coordinates. 445 if (renderer->isSVGRoot()) 446 // We also need to adjust for the zoom level factored into CSS coordinates (bug #96361). 447 if (renderer->isSVGRoot()) { 446 448 location = toRenderSVGRoot(renderer)->localToBorderBoxTransform().mapPoint(location); 447 449 zoomFactor = 1 / renderer->style()->effectiveZoom(); 450 } 451 448 452 // Translate in our CSS parent coordinate space 449 453 // FIXME: This doesn't work correctly with CSS transforms. 450 454 location = renderer->localToAbsolute(location, false, true); 455 location.scale(zoomFactor, zoomFactor); 451 456 452 457 // Be careful here! localToBorderBoxTransform() included the x/y offset coming from the viewBoxToViewTransform(), … … 457 462 if (FrameView* view = document()->view()) { 458 463 LayoutSize scrollOffset = view->scrollOffset(); 464 scrollOffset.scale(zoomFactor); 459 465 transform.translate(-scrollOffset.width(), -scrollOffset.height()); 460 466 }
Note: See TracChangeset
for help on using the changeset viewer.