-
https://bugs.webkit.org/show_bug.cgi?id=68081hclam@chromium.org authored
Fix scroll in page scaling mode. Reviewed by Simon Fraser. The following things are done in this patch: 1. Rename Frame::pageScaleFactor() to Frame::frameScaleFactor() to better reflect its purpose. 2. Frame::frameScaleFactor() returns the scale factor of this frame with respect to the container. So for the main frame it'll return the scale factor of the page, inner frames will return 1.0 3. scrollBy(), scrollX() and scrollY() to take into account of the frame scale factor, causing incorrect coordinates reported to Javascript. Tests: fast/events/scale-and-scroll-body.html fast/events/scale-and-scroll-iframe-body.html fast/events/scale-and-scroll-iframe-window.html fast/events/scale-and-scroll-window.html * html/HTMLBodyElement.cpp: (WebCore::adjustForZoom): (WebCore::HTMLBodyElement::setScrollLeft): (WebCore::HTMLBodyElement::setScrollTop): * loader/HistoryController.cpp: (WebCore::HistoryController::saveScrollPositionAndViewStateToItem): * page/DOMWindow.cpp: (WebCore::DOMWindow::scrollX): (WebCore::DOMWindow::scrollY): (WebCore::DOMWindow::scrollTo): * page/Frame.cpp: (WebCore::Frame::frameScaleFactor): Return page's scale factor if this is main frame, otherwise 1.0 * page/Frame.h: * page/FrameView.cpp: (WebCore::FrameView::applyOverflowToViewport): (WebCore::FrameView::scrollXForFixedPosition): (WebCore::FrameView::scrollYForFixedPosition): Source/WebKit2: https://bugs.webkit.org/show_bug.cgi?id=68081 Fix scroll in page scaling mode. Reviewed by Simon Fraser. * WebProcess/Plugins/PluginView.cpp: Rename pageScaleFactor to frameScaleFactor. (WebKit::PluginView::handleEvent): (WebKit::PluginView::viewGeometryDidChange): (WebKit::PluginView::clipRectInWindowCoordinates): LayoutTests: https://bugs.webkit.org/show_bug.cgi?id=68081 Add layout test for page scale and scrolling. Reviewed by Simon Fraser. Add tests to cover the following cases: 1. Scale and scroll window 2. Scale and scroll document.body 3. Scale and scroll iframe's contentWindow 4. Scale and scroll iframe's contentDocument.body * fast/events/scale-and-scroll-body-expected.png: Added. * fast/events/scale-and-scroll-body-expected.txt: Added. * fast/events/scale-and-scroll-body.html: Added. * fast/events/scale-and-scroll-iframe-body-expected.png: Added. * fast/events/scale-and-scroll-iframe-body-expected.txt: Added. * fast/events/scale-and-scroll-iframe-body.html: Added. * fast/events/scale-and-scroll-iframe-window-expected.png: Added. * fast/events/scale-and-scroll-iframe-window-expected.txt: Added. * fast/events/scale-and-scroll-iframe-window.html: Added. * fast/events/scale-and-scroll-window-expected.png: Added. * fast/events/scale-and-scroll-window-expected.txt: Added. * fast/events/scale-and-scroll-window.html: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ecd7a05d