Changeset 127620 in webkit


Ignore:
Timestamp:
Sep 5, 2012 11:53:29 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Enable/disable composited scrolling based on overflow
https://bugs.webkit.org/show_bug.cgi?id=95323

Patch by Sami Kyostila <skyostil@google.com> on 2012-09-05
Reviewed by Simon Fraser.

Source/WebCore:

When an overflow:{auto,overlay} and -webkit-overflow-scrolling:touch
element gains or loses overflow, we should correspondingly enable and
disable composited scrolling depending on whether the element can be
scrolled or not.

The previous logic in RenderLayer::usesCompositedScrolling() already
checked for actual overflow, but we also need to recompute the
compositing requirements when the amount of overflow changes during
layout. Additionally, layers using composited scrolling are marked as
self-painting to ensure they are always promoted to composited layers
when needed.

Test: compositing/overflow/overflow-auto-with-touch-toggle.html

Note that the behavior for maintaining a stacking context even without
the presense of overflow is covered by platform/chromium/compositing/overflow/overflow-scrolling-touch-stacking-context.html.

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::updateScrollInfoAfterLayout):
(WebCore::RenderLayer::shouldBeSelfPaintingLayer):

LayoutTests:

Added a new test for making sure composited scrolling is enabled when overflow
is introduced.

Note that this test will pass only if OVERFLOW_SCROLLING is enabled.

  • compositing/overflow/overflow-auto-with-touch-toggle-expected.txt: Added.
  • compositing/overflow/overflow-auto-with-touch-toggle.html: Added.
  • platform/chromium/TestExpectations:
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r127615 r127620  
     12012-09-05  Sami Kyostila  <skyostil@google.com>
     2
     3        Enable/disable composited scrolling based on overflow
     4        https://bugs.webkit.org/show_bug.cgi?id=95323
     5
     6        Reviewed by Simon Fraser.
     7
     8        Added a new test for making sure composited scrolling is enabled when overflow
     9        is introduced.
     10
     11        Note that this test will pass only if OVERFLOW_SCROLLING is enabled.
     12
     13        * compositing/overflow/overflow-auto-with-touch-toggle-expected.txt: Added.
     14        * compositing/overflow/overflow-auto-with-touch-toggle.html: Added.
     15        * platform/chromium/TestExpectations:
     16
    1172012-09-05  Max Vujovic  <mvujovic@adobe.com>
    218
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r127615 r127620  
    34543454BUGWK94353 LINUX ANDROID : compositing/overflow/nested-scrolling.html = IMAGE+TEXT PASS
    34553455BUGWK94353 : compositing/overflow/overflow-auto-with-touch.html = TEXT
     3456BUGWK94353 : compositing/overflow/overflow-auto-with-touch-toggle.html = TEXT
    34563457BUGWK94353 : compositing/overflow/overflow-overlay-with-touch.html = TEXT
    34573458
  • trunk/Source/WebCore/ChangeLog

    r127613 r127620  
     12012-09-05  Sami Kyostila  <skyostil@google.com>
     2
     3        Enable/disable composited scrolling based on overflow
     4        https://bugs.webkit.org/show_bug.cgi?id=95323
     5
     6        Reviewed by Simon Fraser.
     7
     8        When an overflow:{auto,overlay} and -webkit-overflow-scrolling:touch
     9        element gains or loses overflow, we should correspondingly enable and
     10        disable composited scrolling depending on whether the element can be
     11        scrolled or not.
     12
     13        The previous logic in RenderLayer::usesCompositedScrolling() already
     14        checked for actual overflow, but we also need to recompute the
     15        compositing requirements when the amount of overflow changes during
     16        layout. Additionally, layers using composited scrolling are marked as
     17        self-painting to ensure they are always promoted to composited layers
     18        when needed.
     19
     20        Test: compositing/overflow/overflow-auto-with-touch-toggle.html
     21
     22        Note that the behavior for maintaining a stacking context even without
     23        the presense of overflow is covered by platform/chromium/compositing/overflow/overflow-scrolling-touch-stacking-context.html.
     24
     25        * rendering/RenderLayer.cpp:
     26        (WebCore::RenderLayer::updateScrollInfoAfterLayout):
     27        (WebCore::RenderLayer::shouldBeSelfPaintingLayer):
     28
    1292012-09-05  Mike Fenton  <mifenton@rim.com>
    230
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r127608 r127620  
    26562656    if (originalScrollOffset != scrollOffset())
    26572657        scrollToOffsetWithoutAnimation(toPoint(scrollOffset()));
     2658
     2659#if USE(ACCELERATED_COMPOSITING)
     2660    // Composited scrolling may need to be enabled or disabled if the amount of overflow changed.
     2661    if (renderer()->view() && compositor()->updateLayerCompositingState(this))
     2662        compositor()->setCompositingLayersNeedRebuild();
     2663#endif
    26582664}
    26592665
     
    48484854    return !isNormalFlowOnly()
    48494855        || hasOverlayScrollbars()
     4856        || usesCompositedScrolling()
    48504857        || renderer()->hasReflection()
    48514858        || renderer()->hasMask()
Note: See TracChangeset for help on using the changeset viewer.