⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 173523 in webkit


Ignore:
Timestamp:
Sep 11, 2014, 11:48:21 AM (12 years ago)
Author:
Beth Dakin
Message:

Support rubber-banding in sub-frames
​https://bugs.webkit.org/show_bug.cgi?id=136726
-and corresponding-
rdar://problem/10011924

Reviewed by Tim Horton.

Source/WebCore:

Set the appropriate scroll elasticity for all frames! As long as its enabled, sub-
frames want an elasticity of ScrollElasticityAutomatic, which will allow for
latching.

  • page/FrameView.cpp:

(WebCore::FrameView::FrameView):

Account for rubber-banding in sub-frames.
(WebCore::FrameView::isScrollableOrRubberbandable):
(WebCore::FrameView::hasScrollableOrRubberbandableAncestor):

This patch also re-names rubberBandingForOverflowScrollEnabled to
rubberBandingForSubScrollableRegionsEnabled

  • page/Settings.in:
  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::overhangAmount):
(WebCore::RenderLayer::setHasHorizontalScrollbar):
(WebCore::RenderLayer::setHasVerticalScrollbar):

Source/WebKit/mac:

rubberBandingForOverflowScrollEnabled is re-named to
rubberBandingForSubScrollableRegionsEnabled

  • WebView/WebView.mm:

(-[WebView _preferencesChanged:]):

LayoutTests:

  • platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-expected.txt:
  • platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler-expected.txt:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r173520 r173523  
     12014-09-11  Beth Dakin  <bdakin@apple.com>
     2
     3        Support rubber-banding in sub-frames
     4        https://bugs.webkit.org/show_bug.cgi?id=136726
     5        -and corresponding-
     6        rdar://problem/10011924
     7
     8        Reviewed by Tim Horton.
     9
     10        * platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-expected.txt:
     11        * platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler-expected.txt:
     12
    1132014-09-11  Jer Noble  <jer.noble@apple.com>
    214
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-expected.txt

    r169700 r173523  
    1212Mouse moved to (28, 566)
    1313Page before: 0, IFrame before: 416
    14 Page after:  0, IFrame after: 496
     14Page after:  0, IFrame after: 486
    1515PASS Page did not receive wheel events.
    1616(GraphicsLayer
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler-expected.txt

    r172832 r173523  
    1212Mouse moved to (28, 566)
    1313Page before: 0, IFrame before: 416
    14 Page after:  0, IFrame after: 496
     14Page after:  0, IFrame after: 486
    1515PASS Page did not receive wheel events.
    16 Document was initial target for 2 of the wheel events.
     16Document was initial target for 0 of the wheel events.
    1717(GraphicsLayer
    1818  (anchor 0.00 0.00)
  • trunk/Source/WebCore/ChangeLog

    r173521 r173523  
     12014-09-11  Beth Dakin  <bdakin@apple.com>
     2
     3        Support rubber-banding in sub-frames
     4        https://bugs.webkit.org/show_bug.cgi?id=136726
     5        -and corresponding-
     6        rdar://problem/10011924
     7
     8        Reviewed by Tim Horton.
     9
     10        Set the appropriate scroll elasticity for all frames! As long as its enabled, sub-
     11        frames want an elasticity of ScrollElasticityAutomatic, which will allow for
     12        latching.
     13        * page/FrameView.cpp:
     14        (WebCore::FrameView::FrameView):
     15
     16        Account for rubber-banding in sub-frames.
     17        (WebCore::FrameView::isScrollableOrRubberbandable):
     18        (WebCore::FrameView::hasScrollableOrRubberbandableAncestor):
     19
     20        This patch also re-names rubberBandingForOverflowScrollEnabled to
     21        rubberBandingForSubScrollableRegionsEnabled
     22        * page/Settings.in:
     23        * rendering/RenderLayer.cpp:
     24        (WebCore::RenderLayer::overhangAmount):
     25        (WebCore::RenderLayer::setHasHorizontalScrollbar):
     26        (WebCore::RenderLayer::setHasVerticalScrollbar):
     27
    1282014-09-11  Myles C. Maxfield <mmaxfield@apple.com>  <litherum@gmail.com>
    229
  • trunk/Source/WebCore/page/FrameView.cpp

    r173344 r173523  
    201201    init();
    202202
    203     if (frame.isMainFrame()) {
    204         ScrollableArea::setVerticalScrollElasticity(m_frame->page() ? m_frame->page()->verticalScrollElasticity() : ScrollElasticityAllowed);
    205         ScrollableArea::setHorizontalScrollElasticity(m_frame->page() ? m_frame->page()->horizontalScrollElasticity() : ScrollElasticityAllowed);
    206     }
     203#if ENABLE(RUBBER_BANDING)
     204    ScrollElasticity verticalElasticity = ScrollElasticityNone;
     205    ScrollElasticity horizontalElasticity = ScrollElasticityNone;
     206    if (m_frame->isMainFrame()) {
     207        verticalElasticity = m_frame->page() ? m_frame->page()->verticalScrollElasticity() : ScrollElasticityAllowed;
     208        horizontalElasticity = m_frame->page() ? m_frame->page()->horizontalScrollElasticity() : ScrollElasticityAllowed;
     209    } else if (m_frame->settings().rubberBandingForSubScrollableRegionsEnabled()) {
     210        verticalElasticity = ScrollElasticityAutomatic;
     211        horizontalElasticity = ScrollElasticityAutomatic;
     212    }
     213
     214    ScrollableArea::setVerticalScrollElasticity(verticalElasticity);
     215    ScrollableArea::setHorizontalScrollElasticity(horizontalElasticity);
     216#endif
    207217}
    208218
    … …  
    33493359bool FrameView::isScrollableOrRubberbandable()
    33503360{
    3351     return frame().isMainFrame() ? isScrollable(Scrollability::ScrollableOrRubberbandable) : isScrollable(Scrollability::Scrollable);
     3361    return isScrollable(Scrollability::ScrollableOrRubberbandable);
    33523362}
    33533363
    … …  
    33553365{
    33563366    if (frame().isMainFrame())
    3357         return isScrollable(Scrollability::ScrollableOrRubberbandable);
    3358 
    3359     FrameView* parentFrameView = this->parentFrameView();
    3360     if (!parentFrameView)
    3361         return false;
    3362 
    3363     RenderView* parentRenderView = parentFrameView->renderView();
    3364     if (!parentRenderView)
    3365         return false;
    3366 
    3367     RenderLayer* enclosingLayer = parentRenderView->enclosingLayer();
    3368     return enclosingLayer && enclosingLayer->hasScrollableOrRubberbandableAncestor();
     3367        return isScrollableOrRubberbandable();
     3368
     3369    for (FrameView* parent = this->parentFrameView(); parent; parent = parent->parentFrameView()) {
     3370        Scrollability frameScrollability = parent->frame().isMainFrame() ? Scrollability::ScrollableOrRubberbandable : Scrollability::Scrollable;
     3371        if (parent->isScrollable(frameScrollability))
     3372            return true;
     3373    }
     3374
     3375    return false;
    33693376}
    33703377
  • trunk/Source/WebCore/page/Settings.in

    r172832 r173523  
    9595acceleratedCompositingForFixedPositionEnabled initial=defaultAcceleratedCompositingForFixedPositionEnabled
    9696acceleratedCompositingForOverflowScrollEnabled initial=false
    97 rubberBandingForOverflowScrollEnabled initial=true, conditional=RUBBER_BANDING
     97rubberBandingForSubScrollableRegionsEnabled initial=true, conditional=RUBBER_BANDING
    9898
    9999experimentalNotificationsEnabled initial=false
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r173484 r173523  
    26512651{
    26522652#if ENABLE(RUBBER_BANDING)
    2653     if (!renderer().frame().settings().rubberBandingForOverflowScrollEnabled())
     2653    if (!renderer().frame().settings().rubberBandingForSubScrollableRegionsEnabled())
    26542654        return IntSize();
    26552655
    … …  
    30063006        m_hBar = createScrollbar(HorizontalScrollbar);
    30073007#if ENABLE(RUBBER_BANDING)
    3008         ScrollElasticity elasticity = scrollsOverflow() && renderer().frame().settings().rubberBandingForOverflowScrollEnabled() ? ScrollElasticityAutomatic : ScrollElasticityNone;
     3008        ScrollElasticity elasticity = scrollsOverflow() && renderer().frame().settings().rubberBandingForSubScrollableRegionsEnabled() ? ScrollElasticityAutomatic : ScrollElasticityNone;
    30093009        ScrollableArea::setHorizontalScrollElasticity(elasticity);
    30103010#endif
    … …  
    30373037        m_vBar = createScrollbar(VerticalScrollbar);
    30383038#if ENABLE(RUBBER_BANDING)
    3039         ScrollElasticity elasticity = scrollsOverflow() && renderer().frame().settings().rubberBandingForOverflowScrollEnabled() ? ScrollElasticityAutomatic : ScrollElasticityNone;
     3039        ScrollElasticity elasticity = scrollsOverflow() && renderer().frame().settings().rubberBandingForSubScrollableRegionsEnabled() ? ScrollElasticityAutomatic : ScrollElasticityNone;
    30403040        ScrollableArea::setVerticalScrollElasticity(elasticity);
    30413041#endif
  • trunk/Source/WebKit/mac/ChangeLog

    r173443 r173523  
     12014-09-11  Beth Dakin  <bdakin@apple.com>
     2
     3        Support rubber-banding in sub-frames
     4        https://bugs.webkit.org/show_bug.cgi?id=136726
     5        -and corresponding-
     6        rdar://problem/10011924
     7
     8        Reviewed by Tim Horton.
     9
     10        rubberBandingForOverflowScrollEnabled is re-named to
     11        rubberBandingForSubScrollableRegionsEnabled
     12        * WebView/WebView.mm:
     13        (-[WebView _preferencesChanged:]):
     14
    1152014-09-09  Benjamin Poulain  <bpoulain@apple.com>
    216
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r173265 r173523  
    22852285#if ENABLE(RUBBER_BANDING)
    22862286    // FIXME: https://bugs.webkit.org/show_bug.cgi?id=136131
    2287     settings.setRubberBandingForOverflowScrollEnabled(false);
     2287    settings.setRubberBandingForSubScrollableRegionsEnabled(false);
    22882288#endif
    22892289
Note: See TracChangeset for help on using the changeset viewer.