[Webkit-unassigned] [Bug 45228] window.scrollBy() scrolls incorrectly when zoomed in/out

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 5 14:15:17 PST 2011


--- Comment #7 from Sneha Bhat <mail.snehabhat at gmail.com>  2011-12-05 14:15:17 PST ---
>>but I dont see pageZoomFactor included in this old code here?

Yes pageZoomFactor was not not applied and hence the issue with window.scrollBy()

So If you look at the function scrollTo, Source/WebCore/page/DOMWindow.cpp:

void DOMWindow::scrollTo(int x, int y) const

    int zoomedX = static_cast<int>(x * m_frame->pageZoomFactor() * m_frame->frameScaleFactor());
    int zoomedY = static_cast<int>(y * m_frame->pageZoomFactor() * m_frame->frameScaleFactor());
    view->setScrollPosition(IntPoint(zoomedX, zoomedY));

The relative scroll distance is multiplied with the zoom factor, same should be done for the API window.scrollBy

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