Changeset 91064 in webkit


Ignore:
Timestamp:
Jul 15, 2011 5:02:59 AM (13 years ago)
Author:
kenneth@webkit.org
Message:

Upstream QtWebKit/N9 changes related to visibleContentRect
https://bugs.webkit.org/show_bug.cgi?id=64589

Reviewed by Simon Hausmann.

Source/WebCore:

Rename setActualVisibleContentRect to setFixedVisibleContentRect
as that makes it more obvious that it is an override. It is also
consistent with the setFixedLayout which is often used in
conjunction with it.

Make visibleContentRect return the fixed value if set, and remove
all calls to actualVisibleContentRect.

Also updated the documentation.

This is similar to what we have on our QtWebKit/N9 branch and is
pretty well tested.

  • platform/ScrollView.cpp:

(WebCore::ScrollView::visibleContentRect):
If a fixed visibleContentRect is set, return that.
Remove the code returning the contents size when in
paintsEntireContents mode as that is wrong and already
ifdeffed out for EFL.
(WebCore::ScrollView::setScrollPosition):
Do not try to be smart and update the fixed visibleContentsRect
automatically, as the embedder might ignore the scroll request
for various reasons.

  • platform/ScrollView.h:

(WebCore::ScrollView::setFixedVisibleContentRect):
(WebCore::ScrollView::fixedVisibleContentRect):

Source/WebKit/qt:

  • Api/qwebpage.cpp:

(QWebPage::setActualVisibleContentRect):
Change to use setFixedVisibleContentRect.

  • WebCoreSupport/FrameLoaderClientQt.cpp:

(WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage):
Only set fixedVisibleContentRect for the mainframe.

  • symbian/eabi/QtWebKitu.def:

Source/WebKit2:

Rename setActualVisibleContentRect to setFixedVisibleContentRect
as that makes it more obvious that it is an override. It is also
consistent with the setFixedLayout which is often used in
conjunction with it.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::setFixedVisibleContentRect):

  • UIProcess/WebPageProxy.h:
  • UIProcess/qt/qtouchwebpageproxy.cpp:

(QTouchWebPageProxy::setVisibleArea):

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
Only set fixedVisibleContentRect for the mainframe.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::setFixedVisibleContentRect):

  • WebProcess/WebPage/WebPage.h:
  • WebProcess/WebPage/WebPage.messages.in:
Location:
trunk/Source
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r91061 r91064  
     12011-07-15  Kenneth Rohde Christiansen  <kenneth@webkit.org>
     2
     3        Upstream QtWebKit/N9 changes related to visibleContentRect
     4        https://bugs.webkit.org/show_bug.cgi?id=64589
     5
     6        Reviewed by Simon Hausmann.
     7
     8        Rename setActualVisibleContentRect to setFixedVisibleContentRect
     9        as that makes it more obvious that it is an override. It is also
     10        consistent with the setFixedLayout which is often used in
     11        conjunction with it.
     12
     13        Make visibleContentRect return the fixed value if set, and remove
     14        all calls to actualVisibleContentRect.
     15
     16        Also updated the documentation.
     17
     18        This is similar to what we have on our QtWebKit/N9 branch and is
     19        pretty well tested.
     20
     21        * platform/ScrollView.cpp:
     22        (WebCore::ScrollView::visibleContentRect):
     23        If a fixed visibleContentRect is set, return that.
     24        Remove the code returning the contents size when in
     25        paintsEntireContents mode as that is wrong and already
     26        ifdeffed out for EFL.
     27        (WebCore::ScrollView::setScrollPosition):
     28        Do not try to be smart and update the fixed visibleContentsRect
     29        automatically, as the embedder might ignore the scroll request
     30        for various reasons.
     31        * platform/ScrollView.h:
     32        (WebCore::ScrollView::setFixedVisibleContentRect):
     33        (WebCore::ScrollView::fixedVisibleContentRect):
     34
    1352011-07-15  Mike West  <mkwst@chromium.org>
    236
  • trunk/Source/WebCore/platform/ScrollView.cpp

    r90478 r91064  
    229229        return platformVisibleContentRect(includeScrollbars);
    230230
    231 #if !PLATFORM(EFL)
    232     if (paintsEntireContents())
    233         return IntRect(IntPoint(0, 0), contentsSize());
    234 #endif
     231    if (!m_fixedVisibleContentRect.isEmpty())
     232        return m_fixedVisibleContentRect;
    235233
    236234    int verticalScrollbarWidth = verticalScrollbar() && !verticalScrollbar()->isOverlayScrollbar()
     
    384382    if (delegatesScrolling()) {
    385383        hostWindow()->delegatedScrollRequested(scrollPoint);
    386         if (!m_actualVisibleContentRect.isEmpty())
    387             m_actualVisibleContentRect.setLocation(scrollPoint);
    388384        return;
    389385    }
  • trunk/Source/WebCore/platform/ScrollView.h

    r90734 r91064  
    141141    // included.
    142142    // In the situation the client is responsible for the scrolling (ie. with a tiled backing store) it is possible to use
    143     // the actualVisibleContentRect instead, though this must be updated manually, e.g after panning ends.
    144     IntRect visibleContentRect(bool includeScrollbars = false) const;
    145     IntRect actualVisibleContentRect() const { return m_actualVisibleContentRect.isEmpty() ? visibleContentRect() : m_actualVisibleContentRect; }
    146     void setActualVisibleContentRect(const IntRect& actualVisibleContentRect) { m_actualVisibleContentRect = actualVisibleContentRect; }
     143    // the setFixedVisibleContentRect instead for the mainframe, though this must be updated manually, e.g just before resuming the page
     144    // which usually will happen when panning, pinching and rotation ends, or when scale or position are changed manually.
     145    virtual IntRect visibleContentRect(bool includeScrollbars = false) const;
     146    void setFixedVisibleContentRect(const IntRect& visibleContentRect) { m_fixedVisibleContentRect = visibleContentRect; }
    147147    LayoutUnit visibleWidth() const { return visibleContentRect().width(); }
    148148    LayoutUnit visibleHeight() const { return visibleContentRect().height(); }
     
    297297    virtual void visibleContentsResized() = 0;
    298298
     299    IntRect fixedVisibleContentRect() const { return m_fixedVisibleContentRect; }
     300
    299301    IntSize boundsSize() const { return m_boundsSize; }
    300302    void setInitialBoundsSize(const IntSize&);
     
    336338    bool m_canBlitOnScroll;
    337339
    338     IntRect m_actualVisibleContentRect;
     340    IntRect m_fixedVisibleContentRect;
    339341    IntSize m_scrollOffset; // FIXME: Would rather store this as a position, but we will wait to make this change until more code is shared.
    340342    IntPoint m_cachedScrollPosition;
  • trunk/Source/WebKit/qt/Api/qwebpage.cpp

    r90856 r91064  
    26442644
    26452645    WebCore::FrameView* view = frame->d->frame->view();
    2646     view->setActualVisibleContentRect(rect);
     2646    view->setFixedVisibleContentRect(rect);
    26472647}
    26482648
  • trunk/Source/WebKit/qt/ChangeLog

    r90948 r91064  
     12011-07-15  Kenneth Rohde Christiansen  <kenneth@webkit.org>
     2
     3        Upstream QtWebKit/N9 changes related to visibleContentRect
     4        https://bugs.webkit.org/show_bug.cgi?id=64589
     5
     6        Reviewed by Simon Hausmann.
     7
     8        * Api/qwebpage.cpp:
     9        (QWebPage::setActualVisibleContentRect):
     10        Change to use setFixedVisibleContentRect.
     11        * WebCoreSupport/FrameLoaderClientQt.cpp:
     12        (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage):
     13        Only set fixedVisibleContentRect for the mainframe.
     14        * symbian/eabi/QtWebKitu.def:
     15
    1162011-07-13  Joseph Pecoraro  <joepeck@webkit.org>
    217
  • trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp

    r88628 r91064  
    286286    bool vLock = vScrollbar != ScrollbarAuto;
    287287
    288     IntSize currentVisibleContentSize = m_frame->view() ? m_frame->view()->actualVisibleContentRect().size() : IntSize();
     288    IntSize currentVisibleContentSize = m_frame->view() ? m_frame->view()->visibleContentRect().size() : IntSize();
    289289
    290290    m_frame->createView(m_webFrame->page()->viewportSize(),
     
    299299        m_frame->view()->setPaintsEntireContents(page->d->client->viewResizesToContentsEnabled());
    300300        m_frame->view()->setDelegatesScrolling(page->d->client->viewResizesToContentsEnabled());
    301     }
    302 
    303     // The HistoryController will update the scroll position later if needed.
    304     m_frame->view()->setActualVisibleContentRect(IntRect(IntPoint::zero(), currentVisibleContentSize));
     301
     302        // The HistoryController will update the scroll position later if needed.
     303        m_frame->view()->setFixedVisibleContentRect(IntRect(IntPoint::zero(), currentVisibleContentSize));
     304    }
    305305}
    306306
  • trunk/Source/WebKit/qt/symbian/eabi/QtWebKitu.def

    r90276 r91064  
    832832        _ZNK8QWebPage19supportsContentTypeERK7QString @ 831 NONAME
    833833        _ZNK8QWebPage21supportedContentTypesEv @ 832 NONAME
    834         _ZNK8QWebPage27setActualVisibleContentRectERK5QRect @ 833 NONAME
     834        _ZNK8QWebPage26setFixedVisibleContentRectERK5QRect @ 833 NONAME
    835835        _ZN8QWebPage20setFeaturePermissionEP9QWebFrameNS_7FeatureENS_16PermissionPolicyE @ 834 NONAME
    836836        _ZN8QWebPage26featurePermissionRequestedEP9QWebFrameNS_7FeatureE @ 835 NONAME
  • trunk/Source/WebKit2/ChangeLog

    r91062 r91064  
     12011-07-15  Kenneth Rohde Christiansen  <kenneth@webkit.org>
     2
     3        Upstream QtWebKit/N9 changes related to visibleContentRect
     4        https://bugs.webkit.org/show_bug.cgi?id=64589
     5
     6        Reviewed by Simon Hausmann.
     7
     8        Rename setActualVisibleContentRect to setFixedVisibleContentRect
     9        as that makes it more obvious that it is an override. It is also
     10        consistent with the setFixedLayout which is often used in
     11        conjunction with it.
     12
     13        * UIProcess/WebPageProxy.cpp:
     14        (WebKit::WebPageProxy::setFixedVisibleContentRect):
     15        * UIProcess/WebPageProxy.h:
     16        * UIProcess/qt/qtouchwebpageproxy.cpp:
     17        (QTouchWebPageProxy::setVisibleArea):
     18        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     19        (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
     20        Only set fixedVisibleContentRect for the mainframe.
     21        * WebProcess/WebPage/WebPage.cpp:
     22        (WebKit::WebPage::setFixedVisibleContentRect):
     23        * WebProcess/WebPage/WebPage.h:
     24        * WebProcess/WebPage/WebPage.messages.in:
     25
    1262011-07-15  Carlos Garcia Campos  <cgarcia@igalia.com>
    227
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r91012 r91064  
    776776
    777777#if ENABLE(TILED_BACKING_STORE)
    778 void WebPageProxy::setActualVisibleContentRect(const IntRect& rect)
    779 {
    780     if (!isValid())
    781         return;
    782 
    783     process()->send(Messages::WebPage::SetActualVisibleContentRect(rect), m_pageID);
     778void WebPageProxy::setFixedVisibleContentRect(const IntRect& rect)
     779{
     780    if (!isValid())
     781        return;
     782
     783    process()->send(Messages::WebPage::SetFixedVisibleContentRect(rect), m_pageID);
    784784}
    785785#endif
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r91012 r91064  
    338338#endif
    339339#if ENABLE(TILED_BACKING_STORE)
    340     void setActualVisibleContentRect(const WebCore::IntRect& rect);
     340    void setFixedVisibleContentRect(const WebCore::IntRect&);
    341341#endif
    342342
  • trunk/Source/WebKit2/UIProcess/qt/qtouchwebpageproxy.cpp

    r90838 r91064  
    9494    // FIXME: Once we support suspend and resume, this should be delayed until the page is active if the page is suspended.
    9595    IntRect contentVisibleArea = tiledDrawingArea->mapToContents(alignedVisibleArea);
    96     m_webPageProxy->setActualVisibleContentRect(contentVisibleArea);
     96    m_webPageProxy->setFixedVisibleContentRect(contentVisibleArea);
    9797}
    9898
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r90760 r91064  
    11371137
    11381138#if ENABLE(TILED_BACKING_STORE)
    1139     IntSize currentVisibleContentSize = m_frame->coreFrame()->view() ? m_frame->coreFrame()->view()->actualVisibleContentRect().size() : IntSize();
     1139    IntSize currentVisibleContentSize = m_frame->coreFrame()->view() ? m_frame->coreFrame()->view()->visibleContentRect().size() : IntSize();
    11401140    m_frame->coreFrame()->createView(webPage->size(), backgroundColor, false, webPage->resizesToContentsLayoutSize(), isMainFrame && webPage->resizesToContentsEnabled());
    11411141
     
    11431143        m_frame->coreFrame()->view()->setDelegatesScrolling(true);
    11441144        m_frame->coreFrame()->view()->setPaintsEntireContents(true);
    1145     }
    1146 
    1147     // The HistoryController will update the scroll position later if needed.
    1148     m_frame->coreFrame()->view()->setActualVisibleContentRect(IntRect(IntPoint::zero(), currentVisibleContentSize));
     1145        // The HistoryController will update the scroll position later if needed.
     1146        m_frame->coreFrame()->view()->setFixedVisibleContentRect(IntRect(IntPoint::zero(), currentVisibleContentSize));
     1147    }
     1148
    11491149#else
    11501150    const ResourceResponse& response = m_frame->coreFrame()->loader()->documentLoader()->response();
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r91012 r91064  
    638638
    639639#if ENABLE(TILED_BACKING_STORE)
    640 void WebPage::setActualVisibleContentRect(const IntRect& rect)
     640void WebPage::setFixedVisibleContentRect(const IntRect& rect)
    641641{
    642642    Frame* frame = m_page->mainFrame();
    643643
    644     frame->view()->setActualVisibleContentRect(rect);
     644    frame->view()->setFixedVisibleContentRect(rect);
    645645}
    646646
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h

    r91012 r91064  
    291291#if ENABLE(TILED_BACKING_STORE)
    292292    void pageDidRequestScroll(const WebCore::IntPoint&);
    293     void setActualVisibleContentRect(const WebCore::IntRect&);
     293    void setFixedVisibleContentRect(const WebCore::IntRect&);
    294294
    295295    bool resizesToContentsEnabled() const { return !m_resizesToContentsLayoutSize.isEmpty(); }
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in

    r91012 r91064  
    9494
    9595#if ENABLE(TILED_BACKING_STORE)
    96     SetActualVisibleContentRect(WebCore::IntRect rect)
     96    SetFixedVisibleContentRect(WebCore::IntRect rect)
    9797    SetResizesToContentsUsingLayoutSize(WebCore::IntSize size)
    9898#endif
Note: See TracChangeset for help on using the changeset viewer.