Changeset 240916 in webkit


Ignore:
Timestamp:
Feb 3, 2019 11:49:33 PM (5 years ago)
Author:
Antti Koivisto
Message:

[iOS] Tiles not created in large scrollable iframes
https://bugs.webkit.org/show_bug.cgi?id=193665

Reviewed by Simon Fraser.

Source/WebCore:

We are not syncing scroll position back to the graphics layer tree correctly.

Test by Frédéric Wang.

  • page/scrolling/AsyncScrollingCoordinator.cpp:

(WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
(WebCore::AsyncScrollingCoordinator::reconcileScrollPosition):

Factor setting and syncing scrolling layer positions into a function.
Use bounds.origin scrolling mechanic when scrollContainerLayer is present.

(WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
(WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
(WebCore::AsyncScrollingCoordinator::updateScrollLayerPosition): Deleted.

  • page/scrolling/AsyncScrollingCoordinator.h:
  • page/scrolling/ScrollingCoordinator.cpp:

(WebCore::ScrollingCoordinator::scrollContainerLayerForFrameView):
(WebCore::ScrollingCoordinator::scrolledContentsLayerForFrameView):
(WebCore::ScrollingCoordinator::scrollLayerForFrameView): Deleted.

  • page/scrolling/ScrollingCoordinator.h:
  • rendering/RenderLayerCompositor.cpp:

Rename scrollLayer to scrolledContentsLayer according to out preferred naming scheme and use it in that role only.
Add scrollContainerLayer as a separate layer. It is only constructed when using async scrolling on iOS.

(WebCore::RenderLayerCompositor::~RenderLayerCompositor):
(WebCore::RenderLayerCompositor::customPositionForVisibleRectComputation const):
(WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
(WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
(WebCore::RenderLayerCompositor::frameViewDidChangeSize):
(WebCore::RenderLayerCompositor::updateScrollLayerPosition):
(WebCore::RenderLayerCompositor::frameViewDidScroll):
(WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForHeader):
(WebCore::RenderLayerCompositor::updateLayerForFooter):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
(WebCore::RenderLayerCompositor::ensureRootLayer):
(WebCore::RenderLayerCompositor::destroyRootLayer):
(WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):

  • rendering/RenderLayerCompositor.h:

Source/WebKit:

  • UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:

(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):

  • UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:

(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren):

We now use scrollContainerLayer consistently so remove the special cases.

LayoutTests:

Test by Frédéric Wang.

  • fast/scrolling/ios/scroll-iframe-expected.html:
  • fast/scrolling/ios/scroll-iframe.html:
  • platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt:
  • platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt:
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r240911 r240916  
     12019-02-03  Antti Koivisto  <antti@apple.com>
     2
     3        [iOS] Tiles not created in large scrollable iframes
     4        https://bugs.webkit.org/show_bug.cgi?id=193665
     5
     6        Reviewed by Simon Fraser.
     7
     8        Test by Frédéric Wang.
     9
     10        * fast/scrolling/ios/scroll-iframe-expected.html:
     11        * fast/scrolling/ios/scroll-iframe.html:
     12        * platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt:
     13        * platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt:
     14        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
     15
    1162019-02-03  John Wilander  <wilander@apple.com>
    217
  • trunk/LayoutTests/fast/scrolling/ios/scroll-iframe-expected.html

    r240233 r240916  
    1919        <div class=testdiv></div>
    2020        <div class=testdiv></div>
     21        <div class=testdiv></div>
    2122    </div>
    2223</body>
  • trunk/LayoutTests/fast/scrolling/ios/scroll-iframe.html

    r240233 r240916  
    2525         await touchAndDragFromPointToPoint(c.x, c.y, c.x - 150, c.y);
    2626         await liftUpAtPoint(c.x - 150, c.y);
     27
    2728         c = centerOf("maxScrollY");
    2829         await touchAndDragFromPointToPoint(c.x, c.y, c.x, c.y - 150);
    2930         await liftUpAtPoint(c.x, c.y - 150);
     31         
    3032         c = centerOf("maxScrollXY");
    3133         await touchAndDragFromPointToPoint(c.x, c.y, c.x - 150, c.y - 150);
    3234         await liftUpAtPoint(c.x - 150, c.y - 150);
     35
     36         c = centerOf("largeContent");
     37         await touchAndDragFromPointToPoint(c.x, c.y, c.x, c.y - 2000);
     38         await liftUpAtPoint(c.x, c.y - 2000);
    3339
    3440         // Wait for scrolling to stabilize and for scrollbars to disappear.
     
    3642       }
    3743
    38        var frameToLoadCount = 3;
     44       var frameToLoadCount = 4;
    3945       function newFrameLoaded() {
    4046           frameToLoadCount--;
     
    7177            </body>" onload="newFrameLoaded()">
    7278        </iframe>
     79        <iframe id="largeContent" scrolling="yes" srcdoc="
     80            <body style='margin: 0;'>
     81            <div style='width: 100px; height: 500px; background: red;'></div>
     82            <div style='width: 100px; height: 500px; background: blue;'></div>
     83            <div style='width: 100px; height: 500px; background: red;'></div>
     84            <div style='width: 100px; height: 500px; background: blue;'></div>
     85            <div style='width: 100px; height: 500px; background: green;'></div>
     86            </body>" onload="newFrameLoaded()">
     87        </iframe>
    7388    </div>
    7489</body>
  • trunk/LayoutTests/platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt

    r240677 r240916  
    2121                  (children 1
    2222                    (GraphicsLayer
    23                       (position -80.00 -80.00)
    2423                      (anchor 0.00 0.00)
    2524                      (children 1
  • trunk/LayoutTests/platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt

    r240677 r240916  
    4545                  (backingStoreAttached 1)
    4646                  (visible rect 0.00, 0.00 300.00 x 150.00)
    47                   (coverage rect -10.00, -10.00 800.00 x 600.00)
     47                  (coverage rect 0.00, 0.00 300.00 x 150.00)
    4848                  (intersects coverage rect 1)
    4949                  (contentsScale 2.00)
     
    5151                    (GraphicsLayer
    5252                      (anchor 0.00 0.00)
    53                       (bounds 400.00 300.00)
    54                       (backingStoreAttached 1)
    55                       (visible rect 0.00, 0.00 400.00 x 300.00)
    56                       (coverage rect 0.00, 0.00 400.00 x 300.00)
    57                       (intersects coverage rect 1)
     53                      (backingStoreAttached 0)
     54                      (visible rect 0.00, 0.00 0.00 x 0.00)
     55                      (coverage rect 0.00, 0.00 300.00 x 150.00)
     56                      (intersects coverage rect 0)
    5857                      (contentsScale 2.00)
    5958                      (children 1
    6059                        (GraphicsLayer
     60                          (anchor 0.00 0.00)
    6161                          (bounds 400.00 300.00)
    62                           (drawsContent 1)
    6362                          (backingStoreAttached 1)
    64                           (visible rect 0.00, 0.00 400.00 x 300.00)
    65                           (coverage rect 0.00, 0.00 400.00 x 300.00)
     63                          (visible rect 0.00, 0.00 300.00 x 150.00)
     64                          (coverage rect 0.00, 0.00 300.00 x 150.00)
    6665                          (intersects coverage rect 1)
    6766                          (contentsScale 2.00)
    68                           (tile cache coverage 0, 0 400 x 300)
    69                           (tile size 512 x 512)
    70                           (top left tile 0, 0 tiles grid 1 x 1)
    71                           (in window 1)
    7267                          (children 1
    7368                            (GraphicsLayer
    74                               (backingStoreAttached 0)
    75                               (visible rect 0.00, 0.00 0.00 x 0.00)
    76                               (coverage rect 0.00, 0.00 400.00 x 300.00)
    77                               (intersects coverage rect 0)
     69                              (bounds 400.00 300.00)
     70                              (drawsContent 1)
     71                              (backingStoreAttached 1)
     72                              (visible rect 0.00, 0.00 300.00 x 150.00)
     73                              (coverage rect 0.00, 0.00 300.00 x 150.00)
     74                              (intersects coverage rect 1)
    7875                              (contentsScale 2.00)
     76                              (tile cache coverage 0, 0 400 x 300)
     77                              (tile size 512 x 512)
     78                              (top left tile 0, 0 tiles grid 1 x 1)
     79                              (in window 1)
     80                              (children 1
     81                                (GraphicsLayer
     82                                  (backingStoreAttached 0)
     83                                  (visible rect 0.00, 0.00 0.00 x 0.00)
     84                                  (coverage rect 0.00, 0.00 300.00 x 150.00)
     85                                  (intersects coverage rect 0)
     86                                  (contentsScale 2.00)
     87                                )
     88                              )
    7989                            )
    8090                          )
     
    111121                  (backingStoreAttached 1)
    112122                  (visible rect 0.00, 0.00 300.00 x 150.00)
    113                   (coverage rect -318.00, -10.00 800.00 x 600.00)
     123                  (coverage rect 0.00, 0.00 300.00 x 150.00)
    114124                  (intersects coverage rect 1)
    115125                  (contentsScale 2.00)
     
    117127                    (GraphicsLayer
    118128                      (anchor 0.00 0.00)
    119                       (bounds 400.00 300.00)
    120                       (backingStoreAttached 1)
    121                       (visible rect 0.00, 0.00 400.00 x 300.00)
    122                       (coverage rect 0.00, 0.00 400.00 x 300.00)
    123                       (intersects coverage rect 1)
     129                      (backingStoreAttached 0)
     130                      (visible rect 0.00, 0.00 0.00 x 0.00)
     131                      (coverage rect 0.00, 0.00 300.00 x 150.00)
     132                      (intersects coverage rect 0)
    124133                      (contentsScale 2.00)
    125134                      (children 1
    126135                        (GraphicsLayer
     136                          (anchor 0.00 0.00)
    127137                          (bounds 400.00 300.00)
    128                           (drawsContent 1)
    129138                          (backingStoreAttached 1)
    130                           (visible rect 0.00, 0.00 400.00 x 300.00)
    131                           (coverage rect 0.00, 0.00 400.00 x 300.00)
     139                          (visible rect 0.00, 0.00 300.00 x 150.00)
     140                          (coverage rect 0.00, 0.00 300.00 x 150.00)
    132141                          (intersects coverage rect 1)
    133142                          (contentsScale 2.00)
    134                           (tile cache coverage 0, 0 400 x 300)
    135                           (tile size 512 x 512)
    136                           (top left tile 0, 0 tiles grid 1 x 1)
    137                           (in window 1)
    138143                          (children 1
    139144                            (GraphicsLayer
    140                               (backingStoreAttached 0)
    141                               (visible rect 0.00, 0.00 0.00 x 0.00)
    142                               (coverage rect 0.00, 0.00 400.00 x 300.00)
    143                               (intersects coverage rect 0)
     145                              (bounds 400.00 300.00)
     146                              (drawsContent 1)
     147                              (backingStoreAttached 1)
     148                              (visible rect 0.00, 0.00 300.00 x 150.00)
     149                              (coverage rect 0.00, 0.00 300.00 x 150.00)
     150                              (intersects coverage rect 1)
    144151                              (contentsScale 2.00)
     152                              (tile cache coverage 0, 0 400 x 300)
     153                              (tile size 512 x 512)
     154                              (top left tile 0, 0 tiles grid 1 x 1)
     155                              (in window 1)
     156                              (children 1
     157                                (GraphicsLayer
     158                                  (backingStoreAttached 0)
     159                                  (visible rect 0.00, 0.00 0.00 x 0.00)
     160                                  (coverage rect 0.00, 0.00 300.00 x 150.00)
     161                                  (intersects coverage rect 0)
     162                                  (contentsScale 2.00)
     163                                )
     164                              )
    145165                            )
    146166                          )
     
    177197                  (backingStoreAttached 1)
    178198                  (visible rect 0.00, 0.00 300.00 x 150.00)
    179                   (coverage rect -10.00, -169.00 800.00 x 600.00)
     199                  (coverage rect 0.00, 0.00 300.00 x 150.00)
    180200                  (intersects coverage rect 1)
    181201                  (contentsScale 2.00)
     
    183203                    (GraphicsLayer
    184204                      (anchor 0.00 0.00)
    185                       (bounds 400.00 300.00)
    186                       (backingStoreAttached 1)
    187                       (visible rect 0.00, 0.00 400.00 x 300.00)
    188                       (coverage rect 0.00, 0.00 400.00 x 300.00)
    189                       (intersects coverage rect 1)
     205                      (backingStoreAttached 0)
     206                      (visible rect 0.00, 0.00 0.00 x 0.00)
     207                      (coverage rect 0.00, 0.00 300.00 x 150.00)
     208                      (intersects coverage rect 0)
    190209                      (contentsScale 2.00)
    191210                      (children 1
    192211                        (GraphicsLayer
     212                          (anchor 0.00 0.00)
    193213                          (bounds 400.00 300.00)
    194                           (drawsContent 1)
    195214                          (backingStoreAttached 1)
    196                           (visible rect 0.00, 0.00 400.00 x 300.00)
    197                           (coverage rect 0.00, 0.00 400.00 x 300.00)
     215                          (visible rect 0.00, 0.00 300.00 x 150.00)
     216                          (coverage rect 0.00, 0.00 300.00 x 150.00)
    198217                          (intersects coverage rect 1)
    199218                          (contentsScale 2.00)
    200                           (tile cache coverage 0, 0 400 x 300)
    201                           (tile size 512 x 512)
    202                           (top left tile 0, 0 tiles grid 1 x 1)
    203                           (in window 1)
    204219                          (children 1
    205220                            (GraphicsLayer
    206                               (backingStoreAttached 0)
    207                               (visible rect 0.00, 0.00 0.00 x 0.00)
    208                               (coverage rect 0.00, 0.00 400.00 x 300.00)
    209                               (intersects coverage rect 0)
     221                              (bounds 400.00 300.00)
     222                              (drawsContent 1)
     223                              (backingStoreAttached 1)
     224                              (visible rect 0.00, 0.00 300.00 x 150.00)
     225                              (coverage rect 0.00, 0.00 300.00 x 150.00)
     226                              (intersects coverage rect 1)
    210227                              (contentsScale 2.00)
     228                              (tile cache coverage 0, 0 400 x 300)
     229                              (tile size 512 x 512)
     230                              (top left tile 0, 0 tiles grid 1 x 1)
     231                              (in window 1)
     232                              (children 1
     233                                (GraphicsLayer
     234                                  (backingStoreAttached 0)
     235                                  (visible rect 0.00, 0.00 0.00 x 0.00)
     236                                  (coverage rect 0.00, 0.00 300.00 x 150.00)
     237                                  (intersects coverage rect 0)
     238                                  (contentsScale 2.00)
     239                                )
     240                              )
    211241                            )
    212242                          )
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt

    r240713 r240916  
    6969                  (children 1
    7070                    (GraphicsLayer
    71                       (position 0.00 -120.00)
    7271                      (anchor 0.00 0.00)
    7372                      (children 1
  • trunk/Source/WebCore/ChangeLog

    r240912 r240916  
     12019-02-03  Antti Koivisto  <antti@apple.com>
     2
     3        [iOS] Tiles not created in large scrollable iframes
     4        https://bugs.webkit.org/show_bug.cgi?id=193665
     5
     6        Reviewed by Simon Fraser.
     7
     8        We are not syncing scroll position back to the graphics layer tree correctly.
     9
     10        Test by Frédéric Wang.
     11
     12        * page/scrolling/AsyncScrollingCoordinator.cpp:
     13        (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
     14        (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
     15        (WebCore::AsyncScrollingCoordinator::reconcileScrollPosition):
     16
     17        Factor setting and syncing scrolling layer positions into a function.
     18        Use bounds.origin scrolling mechanic when scrollContainerLayer is present.
     19
     20        (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
     21        (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
     22        (WebCore::AsyncScrollingCoordinator::updateScrollLayerPosition): Deleted.
     23        * page/scrolling/AsyncScrollingCoordinator.h:
     24        * page/scrolling/ScrollingCoordinator.cpp:
     25        (WebCore::ScrollingCoordinator::scrollContainerLayerForFrameView):
     26        (WebCore::ScrollingCoordinator::scrolledContentsLayerForFrameView):
     27        (WebCore::ScrollingCoordinator::scrollLayerForFrameView): Deleted.
     28        * page/scrolling/ScrollingCoordinator.h:
     29        * rendering/RenderLayerCompositor.cpp:
     30
     31        Rename scrollLayer to scrolledContentsLayer according to out preferred naming scheme and use it in that role only.
     32        Add scrollContainerLayer as a separate layer. It is only constructed when using async scrolling on iOS.
     33
     34        (WebCore::RenderLayerCompositor::~RenderLayerCompositor):
     35        (WebCore::RenderLayerCompositor::customPositionForVisibleRectComputation const):
     36        (WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
     37        (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
     38        (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
     39        (WebCore::RenderLayerCompositor::updateScrollLayerPosition):
     40        (WebCore::RenderLayerCompositor::frameViewDidScroll):
     41        (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
     42        (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
     43        (WebCore::RenderLayerCompositor::updateLayerForHeader):
     44        (WebCore::RenderLayerCompositor::updateLayerForFooter):
     45        (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
     46        (WebCore::RenderLayerCompositor::ensureRootLayer):
     47        (WebCore::RenderLayerCompositor::destroyRootLayer):
     48        (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
     49        * rendering/RenderLayerCompositor.h:
     50
    1512019-02-03  Simon Fraser  <simon.fraser@apple.com>
    252
  • trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp

    r240861 r240916  
    227227
    228228    auto* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollingNodeID()));
    229     node->setScrolledContentsLayer(scrollLayerForFrameView(frameView));
     229    node->setScrollContainerLayer(scrollContainerLayerForFrameView(frameView));
     230    node->setScrolledContentsLayer(scrolledContentsLayerForFrameView(frameView));
    230231    node->setRootContentsLayer(rootContentsLayerForFrameView(frameView));
    231232    node->setCounterScrollingLayer(counterScrollingLayerForFrameView(frameView));
     
    414415    }
    415416
    416     auto* scrollLayer = scrollLayerForFrameView(frameView);
    417     if (!scrollLayer)
     417    if (!scrolledContentsLayerForFrameView(frameView))
    418418        return;
    419419
     
    439439
    440440    if (programmaticScroll || scrollingLayerPositionAction == ScrollingLayerPositionAction::Set) {
    441         scrollLayer->setPosition(-frameView.scrollPosition());
     441        reconcileScrollPosition(frameView, ScrollingLayerPositionAction::Set);
     442
    442443        if (counterScrollingLayer)
    443444            counterScrollingLayer->setPosition(scrollPositionForFixed);
     
    453454            footerLayer->setPosition(positionForFooterLayer);
    454455    } else {
    455         scrollLayer->syncPosition(-frameView.scrollPosition());
     456        reconcileScrollPosition(frameView, ScrollingLayerPositionAction::Sync);
     457
    456458        if (counterScrollingLayer)
    457459            counterScrollingLayer->syncPosition(scrollPositionForFixed);
     
    469471}
    470472
     473void AsyncScrollingCoordinator::reconcileScrollPosition(FrameView& frameView, ScrollingLayerPositionAction scrollingLayerPositionAction)
     474{
     475#if PLATFORM(IOS_FAMILY)
     476    // Doing all scrolling like this (UIScrollView style) would simplify code.
     477    auto* scrollContainerLayer = scrollContainerLayerForFrameView(frameView);
     478    if (!scrollContainerLayer)
     479        return;
     480    if (scrollingLayerPositionAction == ScrollingLayerPositionAction::Set)
     481        scrollContainerLayer->setBoundsOrigin(frameView.scrollPosition());
     482    else
     483        scrollContainerLayer->syncBoundsOrigin(frameView.scrollPosition());
     484#else
     485    auto* scrolledContentsLayer = scrolledContentsLayerForFrameView(frameView);
     486    if (!scrolledContentsLayer)
     487        return;
     488    if (scrollingLayerPositionAction == ScrollingLayerPositionAction::Set)
     489        scrolledContentsLayer->setPosition(-frameView.scrollPosition());
     490    else
     491        scrolledContentsLayer->syncPosition(-frameView.scrollPosition());
     492#endif
     493}
     494
    471495void AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange(ScrollableArea& scrollableArea, ScrollbarOrientation orientation)
    472496{
     
    481505        else
    482506            scrollingNode.setHorizontalScrollbarLayer(scrollableArea.layerForHorizontalScrollbar());
    483 
    484507    }
    485508
     
    660683    // in order to avoid layer positioning bugs.
    661684    if (reasons)
    662         updateScrollLayerPosition(frameView);
     685        reconcileScrollPosition(frameView, ScrollingLayerPositionAction::Set);
    663686    scrollingStateNode->setSynchronousScrollingReasons(reasons);
    664 }
    665 
    666 void AsyncScrollingCoordinator::updateScrollLayerPosition(FrameView& frameView)
    667 {
    668     ASSERT(isMainThread());
    669     if (auto* scrollLayer = scrollLayerForFrameView(frameView))
    670         scrollLayer->setPosition(-frameView.scrollPosition());
    671687}
    672688
  • trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h

    r240861 r240916  
    114114
    115115    WEBCORE_EXPORT void reconcileScrollingState(FrameView&, const FloatPoint&, const LayoutViewportOriginOrOverrideRect&, bool programmaticScroll, ViewportRectStability, ScrollingLayerPositionAction) override;
     116    void reconcileScrollPosition(FrameView&, ScrollingLayerPositionAction);
    116117
    117118    bool isRubberBandInProgress() const override;
     
    130131
    131132    void ensureRootStateNodeForFrameView(FrameView&);
    132     void updateScrollLayerPosition(FrameView&);
    133133
    134134    void updateScrollPositionAfterAsyncScrollTimerFired();
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp

    r240891 r240916  
    225225}
    226226
    227 GraphicsLayer* ScrollingCoordinator::scrollLayerForFrameView(FrameView& frameView)
    228 {
    229     if (auto* renderView = frameView.frame().contentRenderer())
    230         return renderView->compositor().scrollLayer();
     227GraphicsLayer* ScrollingCoordinator::scrollContainerLayerForFrameView(FrameView& frameView)
     228{
     229    if (auto* renderView = frameView.frame().contentRenderer())
     230        return renderView->compositor().scrollContainerLayer();
     231    return nullptr;
     232}
     233
     234GraphicsLayer* ScrollingCoordinator::scrolledContentsLayerForFrameView(FrameView& frameView)
     235{
     236    if (auto* renderView = frameView.frame().contentRenderer())
     237        return renderView->compositor().scrolledContentsLayer();
    231238    return nullptr;
    232239}
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h

    r240891 r240916  
    193193    explicit ScrollingCoordinator(Page*);
    194194
    195     GraphicsLayer* scrollLayerForFrameView(FrameView&);
     195    GraphicsLayer* scrollContainerLayerForFrameView(FrameView&);
     196    GraphicsLayer* scrolledContentsLayerForFrameView(FrameView&);
    196197    GraphicsLayer* counterScrollingLayerForFrameView(FrameView&);
    197198    GraphicsLayer* insetClipLayerForFrameView(FrameView&);
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r240912 r240916  
    292292    // Take care that the owned GraphicsLayers are deleted first as their destructors may call back here.
    293293    m_clipLayer = nullptr;
    294     m_scrollLayer = nullptr;
     294    m_scrolledContentsLayer = nullptr;
    295295    ASSERT(m_rootLayerAttachment == RootLayerUnattached);
    296296}
     
    412412void RenderLayerCompositor::customPositionForVisibleRectComputation(const GraphicsLayer* graphicsLayer, FloatPoint& position) const
    413413{
    414     if (graphicsLayer != m_scrollLayer.get())
     414    if (graphicsLayer != m_scrolledContentsLayer.get())
    415415        return;
    416416
     
    454454    return frameView.exposedContentRect();
    455455#else
    456     // Having a m_scrollLayer indicates that we're doing scrolling via GraphicsLayers.
    457     FloatRect visibleRect = m_scrollLayer ? FloatRect({ }, frameView.sizeForVisibleContent()) : frameView.visibleContentRect();
     456    // Having a m_scrolledContentsLayer indicates that we're doing scrolling via GraphicsLayers.
     457    FloatRect visibleRect = m_scrolledContentsLayer ? FloatRect({ }, frameView.sizeForVisibleContent()) : frameView.visibleContentRect();
    458458
    459459    if (frameView.viewExposedRect())
     
    550550        // FIXME: would be nice to not have to special-case the root.
    551551        ScrollingCoordinator::NodeLayers nodeLayers;
    552         if (layer.isRenderViewLayer()) {
    553             // FIXME: Reorganize the layers and pass the scrollContainerLayer.
    554             nodeLayers = { nullptr, nullptr, m_scrollLayer.get(), fixedRootBackgroundLayer(), clipLayer(), m_rootContentsLayer.get() };
    555         } else
     552        if (layer.isRenderViewLayer())
     553            nodeLayers = { nullptr, scrollContainerLayer(), scrolledContentsLayer(), fixedRootBackgroundLayer(), clipLayer(), rootContentsLayer() };
     554        else
    556555            nodeLayers = { layer.backing()->graphicsLayer(), backing->scrollContainerLayer(), backing->scrolledContentsLayer() };
    557556
     
    18021801        layer->setNeedsCompositingGeometryUpdate();
    18031802
    1804     if (m_scrollLayer) {
     1803    if (m_scrolledContentsLayer) {
    18051804        updateScrollLayerClipping();
    18061805        frameViewDidScroll();
     
    18251824void RenderLayerCompositor::updateScrollLayerPosition()
    18261825{
    1827     ASSERT(m_scrollLayer);
     1826    ASSERT(!hasCoordinatedScrolling());
     1827    ASSERT(m_scrolledContentsLayer);
    18281828
    18291829    auto& frameView = m_renderView.frameView();
    18301830    IntPoint scrollPosition = frameView.scrollPosition();
    18311831
    1832     m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y()));
     1832    m_scrolledContentsLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y()));
    18331833
    18341834    if (auto* fixedBackgroundLayer = fixedRootBackgroundLayer())
     
    18571857void RenderLayerCompositor::frameViewDidScroll()
    18581858{
    1859     if (!m_scrollLayer)
     1859    if (!m_scrolledContentsLayer)
    18601860        return;
    18611861
     
    31253125        m_layerForTopOverhangArea = GraphicsLayer::create(graphicsLayerFactory(), *this);
    31263126        m_layerForTopOverhangArea->setName("top overhang");
    3127         m_scrollLayer->addChildBelow(*m_layerForTopOverhangArea, m_rootContentsLayer.get());
     3127        m_scrolledContentsLayer->addChildBelow(*m_layerForTopOverhangArea, m_rootContentsLayer.get());
    31283128    }
    31293129
     
    31443144        m_layerForBottomOverhangArea = GraphicsLayer::create(graphicsLayerFactory(), *this);
    31453145        m_layerForBottomOverhangArea->setName("bottom overhang");
    3146         m_scrollLayer->addChildBelow(*m_layerForBottomOverhangArea, m_rootContentsLayer.get());
     3146        m_scrolledContentsLayer->addChildBelow(*m_layerForBottomOverhangArea, m_rootContentsLayer.get());
    31473147    }
    31483148
     
    31723172        m_layerForHeader = GraphicsLayer::create(graphicsLayerFactory(), *this);
    31733173        m_layerForHeader->setName("header");
    3174         m_scrollLayer->addChildAbove(*m_layerForHeader, m_rootContentsLayer.get());
     3174        m_scrolledContentsLayer->addChildAbove(*m_layerForHeader, m_rootContentsLayer.get());
    31753175        m_renderView.frameView().addPaintPendingMilestones(DidFirstFlushForHeaderLayer);
    31763176    }
     
    32093209        m_layerForFooter = GraphicsLayer::create(graphicsLayerFactory(), *this);
    32103210        m_layerForFooter->setName("footer");
    3211         m_scrollLayer->addChildAbove(*m_layerForFooter, m_rootContentsLayer.get());
     3211        m_scrolledContentsLayer->addChildAbove(*m_layerForFooter, m_rootContentsLayer.get());
    32123212    }
    32133213
     
    33433343            m_contentShadowLayer->setCustomAppearance(GraphicsLayer::CustomAppearance::ScrollingShadow);
    33443344
    3345             m_scrollLayer->addChildBelow(*m_contentShadowLayer, m_rootContentsLayer.get());
     3345            m_scrolledContentsLayer->addChildBelow(*m_contentShadowLayer, m_rootContentsLayer.get());
    33463346        }
    33473347    } else
     
    34343434    if (requiresScrollLayer(expectedAttachment)) {
    34353435        if (!m_overflowControlsHostLayer) {
    3436             ASSERT(!m_scrollLayer);
     3436            ASSERT(!m_scrolledContentsLayer);
    34373437            ASSERT(!m_clipLayer);
    34383438
     
    34413441            m_overflowControlsHostLayer->setName("overflow controls host");
    34423442
    3443             auto scrollLayerType = GraphicsLayer::Type::Normal;
     3443            m_scrolledContentsLayer = GraphicsLayer::create(graphicsLayerFactory(), *this);
     3444            m_scrolledContentsLayer->setName("scrolled contents layer");
     3445            m_scrolledContentsLayer->setAnchorPoint({ });
     3446
    34443447#if PLATFORM(IOS_FAMILY)
    3445             if (m_renderView.settings().asyncFrameScrollingEnabled())
    3446                 scrollLayerType = GraphicsLayer::Type::Scrolling;
    3447 #endif
    3448             m_scrollLayer = GraphicsLayer::create(graphicsLayerFactory(), *this, scrollLayerType);
    3449             m_scrollLayer->setName("frame scrolling");
    3450             m_scrollLayer->setAnchorPoint({ });
    3451 
    3452             if (scrollLayerType == GraphicsLayer::Type::Scrolling) {
    3453                 // Scroll layer clips so there is no need for a separate clipping layer.
    3454                 m_overflowControlsHostLayer->addChild(*m_scrollLayer);
    3455             } else {
     3448            if (m_renderView.settings().asyncFrameScrollingEnabled()) {
     3449                m_scrollContainerLayer = GraphicsLayer::create(graphicsLayerFactory(), *this, GraphicsLayer::Type::Scrolling);
     3450
     3451                m_scrollContainerLayer->setName("scroll containers layer");
     3452                m_scrollContainerLayer->setMasksToBounds(true);
     3453                m_scrollContainerLayer->setAnchorPoint({ });
     3454
     3455                m_scrollContainerLayer->addChild(*m_scrolledContentsLayer);
     3456                m_overflowControlsHostLayer->addChild(*m_scrollContainerLayer);
     3457            }
     3458#endif
     3459            if (!m_scrollContainerLayer) {
    34563460                m_clipLayer = GraphicsLayer::create(graphicsLayerFactory(), *this);
    34573461                m_clipLayer->setName("frame clipping");
     
    34593463                m_clipLayer->setAnchorPoint({ });
    34603464
    3461                 m_clipLayer->addChild(*m_scrollLayer);
     3465                m_clipLayer->addChild(*m_scrolledContentsLayer);
    34623466                m_overflowControlsHostLayer->addChild(*m_clipLayer);
    34633467            }
    34643468
    3465             m_scrollLayer->addChild(*m_rootContentsLayer);
     3469            m_scrolledContentsLayer->addChild(*m_rootContentsLayer);
    34663470
    34673471            updateScrollLayerClipping();
     
    34773481            GraphicsLayer::unparentAndClear(m_overflowControlsHostLayer);
    34783482            GraphicsLayer::unparentAndClear(m_clipLayer);
    3479             GraphicsLayer::unparentAndClear(m_scrollLayer);
     3483            GraphicsLayer::unparentAndClear(m_scrollContainerLayer);
     3484            GraphicsLayer::unparentAndClear(m_scrolledContentsLayer);
    34803485        }
    34813486    }
     
    35233528        GraphicsLayer::unparentAndClear(m_overflowControlsHostLayer);
    35243529        GraphicsLayer::unparentAndClear(m_clipLayer);
    3525         GraphicsLayer::unparentAndClear(m_scrollLayer);
    3526     }
    3527     ASSERT(!m_scrollLayer);
     3530        GraphicsLayer::unparentAndClear(m_scrollContainerLayer);
     3531        GraphicsLayer::unparentAndClear(m_scrolledContentsLayer);
     3532    }
     3533    ASSERT(!m_scrolledContentsLayer);
    35283534    GraphicsLayer::unparentAndClear(m_rootContentsLayer);
    35293535
     
    40144020
    40154021        if (changes & ScrollingNodeChangeFlags::Layer)
    4016             scrollingCoordinator->setNodeLayers(newNodeID, { nullptr, nullptr, m_scrollLayer.get(), fixedRootBackgroundLayer(), clipLayer(), m_rootContentsLayer.get() });
     4022            scrollingCoordinator->setNodeLayers(newNodeID, { nullptr, scrollContainerLayer(), scrolledContentsLayer(), fixedRootBackgroundLayer(), clipLayer(), rootContentsLayer() });
    40174023
    40184024        if (changes & ScrollingNodeChangeFlags::LayerGeometry) {
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.h

    r240800 r240916  
    242242    GraphicsLayer* rootGraphicsLayer() const;
    243243
    244     GraphicsLayer* scrollLayer() const { return m_scrollLayer.get(); }
     244    GraphicsLayer* scrollContainerLayer() const { return m_scrollContainerLayer.get(); }
     245    GraphicsLayer* scrolledContentsLayer() const { return m_scrolledContentsLayer.get(); }
    245246    GraphicsLayer* clipLayer() const { return m_clipLayer.get(); }
    246247    GraphicsLayer* rootContentsLayer() const { return m_rootContentsLayer.get(); }
    247248
    248     GraphicsLayer* layerForClipping() const {  return m_clipLayer ? m_clipLayer.get() : m_scrollLayer.get();  }
     249    GraphicsLayer* layerForClipping() const {  return m_clipLayer ? m_clipLayer.get() : m_scrollContainerLayer.get();  }
    249250
    250251#if ENABLE(RUBBER_BANDING)
     
    565566    // Enclosing clipping layer for iframe content
    566567    RefPtr<GraphicsLayer> m_clipLayer;
    567     RefPtr<GraphicsLayer> m_scrollLayer;
     568    RefPtr<GraphicsLayer> m_scrollContainerLayer;
     569    RefPtr<GraphicsLayer> m_scrolledContentsLayer;
    568570
    569571    // Enclosing layer for overflow controls and the clipping layer
  • trunk/Source/WebKit/ChangeLog

    r240914 r240916  
     12019-02-03  Antti Koivisto  <antti@apple.com>
     2
     3        [iOS] Tiles not created in large scrollable iframes
     4        https://bugs.webkit.org/show_bug.cgi?id=193665
     5
     6        Reviewed by Simon Fraser.
     7
     8        * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
     9        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
     10        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
     11        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren):
     12
     13        We now use scrollContainerLayer consistently so remove the special cases.
     14
    1152019-02-03  Fujii Hironori  <Hironori.Fujii@sony.com>
    216
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm

    r240861 r240916  
    5353    ScrollingTreeFrameScrollingNodeIOS::commitStateBeforeChildren(stateNode);
    5454
    55     // FIXME: Should be ScrollContainerLayer.
    56     if (stateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) {
    57         if (scrolledContentsLayer() && [[scrolledContentsLayer() delegate] isKindOfClass:[UIScrollView self]])
     55    if (stateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer)) {
     56        if (scrollContainerLayer())
    5857            m_scrollingNodeDelegate = std::make_unique<ScrollingTreeScrollingNodeDelegateIOS>(*this);
    5958        else
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm

    r240875 r240916  
    216216void ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren(const ScrollingStateScrollingNode& scrollingStateNode)
    217217{
    218     if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer)) {
    219         RetainPtr<CALayer> layer;
    220         layer = scrollingStateNode.scrollContainerLayer();
    221         if ([[layer delegate] isKindOfClass:[UIScrollView self]])
    222             m_scrollLayer = layer;
    223     }
    224 
    225     // FIMXE: ScrollContainerLayer should always be the UIScrollView layer.
    226     if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) {
    227         RetainPtr<CALayer> layer;
    228         layer = scrollingStateNode.scrolledContentsLayer();
    229         if ([[layer delegate] isKindOfClass:[UIScrollView self]])
    230             m_scrollLayer = layer;
    231     }
     218    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer))
     219        m_scrollLayer = scrollingStateNode.scrollContainerLayer();
    232220}
    233221
Note: See TracChangeset for help on using the changeset viewer.