Changeset 127420 in webkit


Ignore:
Timestamp:
Sep 3, 2012 7:15:03 AM (12 years ago)
Author:
allan.jensen@nokia.com
Message:

Wheel-events fails temporarily after reload
https://bugs.webkit.org/show_bug.cgi?id=94934

Reviewed by Kenneth Rohde Christiansen.

Set fixed visible content rect using visibleContentBounds instead of WebPage::size. Otherwise the
content rect will be incorrectly set to the entire document size, when resizesToContents is active.

Test: UIProcess/API/qt/tests/qmltests/WebView/tst_wheelEventHandling.qml

  • UIProcess/API/qt/tests/qmltests/WebView/tst_wheelEventHandling.qml:
  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r127419 r127420  
     12012-09-03  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
     2
     3        Wheel-events fails temporarily after reload
     4        https://bugs.webkit.org/show_bug.cgi?id=94934
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Set fixed visible content rect using visibleContentBounds instead of WebPage::size. Otherwise the
     9        content rect will be incorrectly set to the entire document size, when resizesToContents is active.
     10
     11        Test: UIProcess/API/qt/tests/qmltests/WebView/tst_wheelEventHandling.qml
     12
     13        * UIProcess/API/qt/tests/qmltests/WebView/tst_wheelEventHandling.qml:
     14        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     15        (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
     16
    1172012-09-03  Jinwoo Song  <jinwoo7.song@samsung.com>
    218
  • trunk/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_wheelEventHandling.qml

    r122321 r127420  
    4343            verify(position == webView.contentY)
    4444        }
     45
     46        function test_wheelScrollEventAfterReload() {
     47            scrollSpy.clear()
     48            webView.reload()
     49            verify(webView.waitForLoadSucceeded())
     50            var centerPoint = Qt.point(webView.width / 2, webView.height / 2)
     51            test.wheelEvent(webView, centerPoint.x, centerPoint.y, -500);
     52            // The signal spy below will time out if the wheel event did not scroll the content.
     53            scrollSpy.wait()
     54        }
    4555    }
     56
    4657}
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r125500 r127420  
    12291229    bool isMainFrame = webPage->mainWebFrame() == m_frame;
    12301230    bool shouldUseFixedLayout = isMainFrame && webPage->useFixedLayout();
     1231    IntRect currentVisibleContentBounds = m_frame->visibleContentBounds();
    12311232
    12321233    const ResourceResponse& response = m_frame->coreFrame()->loader()->documentLoader()->response();
     
    12361237    m_frame->coreFrame()->createView(webPage->size(), backgroundColor, /* transparent */ false, IntSize(), shouldUseFixedLayout);
    12371238    m_frame->coreFrame()->view()->setTransparent(!webPage->drawsBackground());
    1238     if (shouldUseFixedLayout)
    1239         m_frame->coreFrame()->view()->setFixedVisibleContentRect(webPage->bounds());
     1239    if (shouldUseFixedLayout && !currentVisibleContentBounds.isEmpty())
     1240        m_frame->coreFrame()->view()->setFixedVisibleContentRect(currentVisibleContentBounds);
    12401241}
    12411242
Note: See TracChangeset for help on using the changeset viewer.