Changeset 238266 in webkit


Ignore:
Timestamp:
Nov 15, 2018 9:02:56 PM (5 years ago)
Author:
Simon Fraser
Message:

Overlay with -webkit-overflow-scrolling:touch doesn't become scrollable after added text makes it taller
https://bugs.webkit.org/show_bug.cgi?id=158342
rdar://problem/26652811

Reviewed by Zalan Bujtas.
Source/WebCore:

Patch partly by Frédéric Wang.

This commit fixes an issue when resizing the content of a -webkit-overflow-scrolling: touch
overflow node on iOS. Indeed, the RenderLayerBacking's scrolling layer may not be properly
created and hence the UIProcess receives a null UIScrollView pointer. This triggers an
assertion in debug mode and prevents the user from scrolling the overflow node in release
mode. This was partially fixed by the refactoring of bug 90342 but this commit addresses
the remaining issues by forcing a configuration update after layout in order to ensure that
RenderLayerBacking's scrolling layer is available. For an overflow element that is not yet
composited, trigger a post-layout update that is necessary to check if we need to make it
composited when it gains scrollable overflow.

Tests: fast/scrolling/ios/change-scrollability-on-content-resize-nested.html

fast/scrolling/ios/change-scrollability-on-content-resize.html

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::updateScrollInfoAfterLayout): Force a configuration update so that
RenderLayerCompositor::updateBackingAndHierarchy will later instantiate
RenderLayerBacking::m_scrollingLayer.

LayoutTests:

Patch partly by Frédéric Wang.

Add a test to check that scrollability of composited/non-composited overflow divs is properly
updated. This test used to fail and assert before #238090. A second test with nested divs
stills exhibit the issue and is fixed by the present commit.

  • fast/scrolling/ios/change-scrollability-on-content-resize-expected.txt: Added.
  • fast/scrolling/ios/change-scrollability-on-content-resize-nested-expected.txt: Added.
  • fast/scrolling/ios/change-scrollability-on-content-resize-nested.html: Added.
  • fast/scrolling/ios/change-scrollability-on-content-resize.html: Added.
Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r238262 r238266  
     12018-11-15  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Overlay with -webkit-overflow-scrolling:touch doesn't become scrollable after added text makes it taller
     4        https://bugs.webkit.org/show_bug.cgi?id=158342
     5        rdar://problem/26652811
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        Patch partly by Frédéric Wang.
     10
     11        Add a test to check that scrollability of composited/non-composited overflow divs is properly
     12        updated. This test used to fail and assert before #238090. A second test with nested divs
     13        stills exhibit the issue and is fixed by the present commit.
     14
     15        * fast/scrolling/ios/change-scrollability-on-content-resize-expected.txt: Added.
     16        * fast/scrolling/ios/change-scrollability-on-content-resize-nested-expected.txt: Added.
     17        * fast/scrolling/ios/change-scrollability-on-content-resize-nested.html: Added.
     18        * fast/scrolling/ios/change-scrollability-on-content-resize.html: Added.
     19
    1202018-11-15  Truitt Savell  <tsavell@apple.com>
    221
  • trunk/Source/WebCore/ChangeLog

    r238263 r238266  
     12018-11-15  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Overlay with -webkit-overflow-scrolling:touch doesn't become scrollable after added text makes it taller
     4        https://bugs.webkit.org/show_bug.cgi?id=158342
     5        rdar://problem/26652811
     6
     7        Reviewed by Zalan Bujtas.
     8       
     9        Patch partly by Frédéric Wang.
     10
     11        This commit fixes an issue when resizing the content of a -webkit-overflow-scrolling: touch
     12        overflow node on iOS. Indeed, the RenderLayerBacking's scrolling layer may not be properly
     13        created and hence the UIProcess receives a null UIScrollView pointer. This triggers an
     14        assertion in debug mode and prevents the user from scrolling the overflow node in release
     15        mode. This was partially fixed by the refactoring of bug 90342 but this commit addresses
     16        the remaining issues by forcing a configuration update after layout in order to ensure that
     17        RenderLayerBacking's scrolling layer is available. For an overflow element that is not yet
     18        composited, trigger a post-layout update that is necessary to check if we need to make it
     19        composited when it gains scrollable overflow.
     20
     21        Tests: fast/scrolling/ios/change-scrollability-on-content-resize-nested.html
     22               fast/scrolling/ios/change-scrollability-on-content-resize.html
     23
     24        * rendering/RenderLayer.cpp:
     25        (WebCore::RenderLayer::updateScrollInfoAfterLayout): Force a configuration update so that
     26        RenderLayerCompositor::updateBackingAndHierarchy will later instantiate
     27        RenderLayerBacking::m_scrollingLayer.
     28
    1292018-11-15  Fujii Hironori  <Hironori.Fujii@sony.com>
    230
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r238108 r238266  
    35723572        scrollToOffsetWithoutAnimation(IntPoint(scrollOffset()));
    35733573
    3574     if (isComposited())
     3574    if (isComposited()) {
    35753575        setNeedsCompositingGeometryUpdate();
     3576        setNeedsCompositingConfigurationUpdate();
     3577    }
     3578
     3579#if PLATFORM(IOS_FAMILY)
     3580    if (canUseAcceleratedTouchScrolling())
     3581        setNeedsPostLayoutCompositingUpdate();
     3582#endif
    35763583
    35773584    updateScrollSnapState();
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r238212 r238266  
    719719        layerConfigChanged = true;
    720720
    721     // Requires layout.
    722721    if (updateOverflowControlsLayers(requiresHorizontalScrollbarLayer(), requiresVerticalScrollbarLayer(), requiresScrollCornerLayer()))
    723722        layerConfigChanged = true;
Note: See TracChangeset for help on using the changeset viewer.