| Differences between
and this patch
- a/LayoutTests/ChangeLog +10 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2011-12-02  Sneha R Bhat  <sneha.bhat@sencha.com>
2
3
        window.scrollBy() scrolls incorrectly when zoomed in/out
4
        https://bugs.webkit.org/show_bug.cgi?id=45228
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * fast/dom/zoom-scroll-page-test-expected.txt: Added.
9
        * fast/dom/zoom-scroll-page-test.html: Added.
10
1
2011-11-14  Tony Chang  <tony@chromium.org>
11
2011-11-14  Tony Chang  <tony@chromium.org>
2
12
3
        Remove the CSS3_FLEXBOX compile time flag and enable on all ports
13
        Remove the CSS3_FLEXBOX compile time flag and enable on all ports
- a/LayoutTests/fast/dom/zoom-scroll-page-test-expected.txt +1 lines
Line 0 a/LayoutTests/fast/dom/zoom-scroll-page-test-expected.txt_sec1
1
PASS - The window scrolls by 200px when the zoom factor is applied
- a/LayoutTests/fast/dom/zoom-scroll-page-test.html +33 lines
Line 0 a/LayoutTests/fast/dom/zoom-scroll-page-test.html_sec1
1
<html>
2
<head>
3
    <style type="text/css">
4
        body    { position: relative; height: 2000px; }
5
    </style>
6
</head>
7
<script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
8
<script type="text/javascript" charset="utf-8">
9
    function testScroll() { 
10
        var x = 200;        
11
        if (window.layoutTestController) {
12
            layoutTestController.dumpAsText();
13
            layoutTestController.waitUntilDone();
14
            
15
            eventSender.zoomPageIn();
16
           
17
            window.scrollBy(0, x)
18
            var offset = window.pageYOffset;
19
                       
20
            var resultString = '';
21
            if(offset >= 199)
22
                resultString += " PASS - " + "The window scrolls by " + x + "px when the zoom factor is applied"    ;
23
            else
24
                resultString += " FAIL - " + "The window has to scroll by " + x + "px but " +"has scrolled by " + offset + " px";
25
                       
26
            document.body.appendChild(document.createTextNode(resultString));
27
            layoutTestController.notifyDone();
28
        }
29
    }
30
</script>
31
<body onload="testScroll()";>
32
    <div id="target"></div>
33
</body>
- a/Source/WebCore/ChangeLog +14 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2011-12-02  Sneha R Bhat  <sneha.bhat@sencha.com>
2
3
        window.scrollBy() scrolls incorrectly when zoomed in/out
4
        https://bugs.webkit.org/show_bug.cgi?id=45228
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Test: fast/dom/zoom-scroll-page-test.html
9
        
10
        The relative scroll distance must take the zoom factor into account.
11
12
        * page/DOMWindow.cpp:
13
        (WebCore::DOMWindow::scrollBy):
14
1
2011-11-14  Tony Chang  <tony@chromium.org>
15
2011-11-14  Tony Chang  <tony@chromium.org>
2
16
3
        Remove the CSS3_FLEXBOX compile time flag and enable on all ports
17
        Remove the CSS3_FLEXBOX compile time flag and enable on all ports
- a/Source/WebCore/page/DOMWindow.cpp -2 / +3 lines
Lines 1437-1444 void DOMWindow::scrollBy(int x, int y) const a/Source/WebCore/page/DOMWindow.cpp_sec1
1437
    FrameView* view = m_frame->view();
1437
    FrameView* view = m_frame->view();
1438
    if (!view)
1438
    if (!view)
1439
        return;
1439
        return;
1440
1440
    int zoomedX = static_cast<int>(x * m_frame->pageZoomFactor() * m_frame->frameScaleFactor());
1441
    view->scrollBy(IntSize(x, y));
1441
    int zoomedY = static_cast<int>(y * m_frame->pageZoomFactor() * m_frame->frameScaleFactor());
1442
    view->scrollBy(IntSize(zoomedX, zoomedY));
1442
}
1443
}
1443
1444
1444
void DOMWindow::scrollTo(int x, int y) const
1445
void DOMWindow::scrollTo(int x, int y) const

Return to Bug 45228