Changeset 71239 in webkit


Ignore:
Timestamp:
Nov 3, 2010 8:00:45 AM (13 years ago)
Author:
andreas.kling@nokia.com
Message:

2010-11-03 Kenneth Rohde Christiansen <kenneth@webkit.org>

Reviewed by Andreas Kling.

Make it possible to delegate scrolling to the UI
https://bugs.webkit.org/show_bug.cgi?id=48907

Enable scrolling delegation when setResizesToContents is active.

  • Api/qgraphicswebview.cpp: (QGraphicsWebView::setResizesToContents):

2010-11-03 Kenneth Rohde Christiansen <kenneth@webkit.org>

Reviewed by Andreas Kling.

Make it possible to delegate scrolling to the UI
https://bugs.webkit.org/show_bug.cgi?id=48907

Add a WebCore setting for delegating scrolling to the actual
WebKit view, which means that setScrollPosition will call
scrollContents directly without going though the scrollbar
code.

  • page/FrameView.cpp: (WebCore::FrameView::delegatesScrolling):
  • page/FrameView.h:
  • page/Settings.cpp: (WebCore::Settings::Settings): (WebCore::Settings::setShouldDelegateScrolling):
  • page/Settings.h: (WebCore::Settings::shouldDelegateScrolling):
  • platform/ScrollView.cpp: (WebCore::ScrollView::setScrollPosition):
  • platform/ScrollView.h: (WebCore::ScrollView::delegatesScrolling):
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r71237 r71239  
     12010-11-03  Kenneth Rohde Christiansen  <kenneth@webkit.org>
     2
     3        Reviewed by Andreas Kling.
     4
     5        Make it possible to delegate scrolling to the UI
     6        https://bugs.webkit.org/show_bug.cgi?id=48907
     7
     8        Add a WebCore setting for delegating scrolling to the actual
     9        WebKit view, which means that setScrollPosition will call
     10        scrollContents directly without going though the scrollbar
     11        code.
     12
     13        * page/FrameView.cpp:
     14        (WebCore::FrameView::delegatesScrolling):
     15        * page/FrameView.h:
     16        * page/Settings.cpp:
     17        (WebCore::Settings::Settings):
     18        (WebCore::Settings::setShouldDelegateScrolling):
     19        * page/Settings.h:
     20        (WebCore::Settings::shouldDelegateScrolling):
     21        * platform/ScrollView.cpp:
     22        (WebCore::ScrollView::setScrollPosition):
     23        * platform/ScrollView.h:
     24        (WebCore::ScrollView::delegatesScrolling):
     25
    1262010-11-03  Patrick Gansterer  <paroga@webkit.org>
    227
  • trunk/WebCore/page/FrameView.cpp

    r71194 r71239  
    350350}
    351351
     352bool FrameView::delegatesScrolling()
     353{
     354    ASSERT(m_frame);
     355
     356    if (parent())
     357        return false;
     358
     359    return m_frame->settings() && m_frame->settings()->shouldDelegateScrolling();
     360}
     361
    352362bool FrameView::avoidScrollbarCreation()
    353363{
  • trunk/WebCore/page/FrameView.h

    r71194 r71239  
    7777    virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation);
    7878
     79    virtual bool delegatesScrolling();
    7980    virtual bool avoidScrollbarCreation();
    8081
  • trunk/WebCore/page/Settings.cpp

    r70975 r71239  
    115115    , m_javaScriptCanAccessClipboard(false)
    116116    , m_shouldPrintBackgrounds(false)
     117    , m_shouldDelegateScrolling(false)
    117118    , m_textAreasAreResizable(false)
    118119#if ENABLE(DASHBOARD_SUPPORT)
     
    366367}
    367368
     369void Settings::setShouldDelegateScrolling(bool shouldDelegateScrolling)
     370{
     371    m_shouldDelegateScrolling = shouldDelegateScrolling;
     372}
     373
    368374void Settings::setTextAreasAreResizable(bool textAreasAreResizable)
    369375{
  • trunk/WebCore/page/Settings.h

    r70714 r71239  
    171171        bool shouldPrintBackgrounds() const { return m_shouldPrintBackgrounds; }
    172172
     173        void setShouldDelegateScrolling(bool);
     174        bool shouldDelegateScrolling() const { return m_shouldDelegateScrolling; }
     175
    173176        void setTextAreasAreResizable(bool);
    174177        bool textAreasAreResizable() const { return m_textAreasAreResizable; }
     
    376379        bool m_javaScriptCanAccessClipboard : 1;
    377380        bool m_shouldPrintBackgrounds : 1;
     381        bool m_shouldDelegateScrolling : 1;
    378382        bool m_textAreasAreResizable : 1;
    379383#if ENABLE(DASHBOARD_SUPPORT)
  • trunk/WebCore/platform/ScrollView.cpp

    r70509 r71239  
    330330    }
    331331
     332    if (delegatesScrolling()) {
     333        scrollContents(IntSize(scrollPoint.x(), scrollPoint.y()));
     334        return;
     335    }
     336
    332337    IntPoint newScrollPosition = scrollPoint.shrunkTo(maximumScrollPosition());
    333338    newScrollPosition.clampNegativeToZero();
  • trunk/WebCore/platform/ScrollView.h

    r70514 r71239  
    105105    bool canHaveScrollbars() const { return horizontalScrollbarMode() != ScrollbarAlwaysOff || verticalScrollbarMode() != ScrollbarAlwaysOff; }
    106106
     107    virtual bool delegatesScrolling() { return false; }
    107108    virtual bool avoidScrollbarCreation() { return false; }
    108109
  • trunk/WebKit/qt/Api/qgraphicswebview.cpp

    r69777 r71239  
    822822        return;
    823823    d->resizesToContents = enabled;
     824    d->page->d->page->settings()->setShouldDelegateScrolling(enabled);
    824825    if (d->page)
    825826        d->updateResizesToContentsForPage();
  • trunk/WebKit/qt/ChangeLog

    r71217 r71239  
     12010-11-03  Kenneth Rohde Christiansen  <kenneth@webkit.org>
     2
     3        Reviewed by Andreas Kling.
     4
     5        Make it possible to delegate scrolling to the UI
     6        https://bugs.webkit.org/show_bug.cgi?id=48907
     7
     8        Enable scrolling delegation when setResizesToContents is active.
     9
     10        * Api/qgraphicswebview.cpp:
     11        (QGraphicsWebView::setResizesToContents):
     12
    1132010-11-03  Daniel Bates  <dbates@rim.com>
    214
Note: See TracChangeset for help on using the changeset viewer.