| Differences between
and this patch
- a/LayoutTests/fast/scrolling/ios/reconcile-layer-position-iframe-expected.txt +118 lines
Line 0 a/LayoutTests/fast/scrolling/ios/reconcile-layer-position-iframe-expected.txt_sec1
1
2
(GraphicsLayer
3
  (anchor 0.00 0.00)
4
  (bounds 800.00 600.00)
5
  (visible rect 0.00, 0.00 800.00 x 600.00)
6
  (coverage rect 0.00, 0.00 800.00 x 600.00)
7
  (intersects coverage rect 1)
8
  (contentsScale 2.00)
9
  (children 1
10
    (GraphicsLayer
11
      (bounds 800.00 600.00)
12
      (contentsOpaque 1)
13
      (visible rect 0.00, 0.00 800.00 x 600.00)
14
      (coverage rect 0.00, 0.00 1056.00 x 856.00)
15
      (intersects coverage rect 1)
16
      (contentsScale 2.00)
17
      (tile cache coverage 0, 0 800 x 600)
18
      (tile size 800 x 600)
19
      (top left tile 0, 0 tiles grid 1 x 1)
20
      (in window 1)
21
      (children 2
22
        (GraphicsLayer
23
          (position 8.00 8.00)
24
          (bounds 304.00 304.00)
25
          (drawsContent 1)
26
          (visible rect 0.00, 0.00 304.00 x 304.00)
27
          (coverage rect -8.00, -8.00 1056.00 x 856.00)
28
          (intersects coverage rect 1)
29
          (contentsScale 2.00)
30
          (children 1
31
            (GraphicsLayer
32
              (position 2.00 2.00)
33
              (visible rect 0.00, 0.00 0.00 x 0.00)
34
              (coverage rect -10.00, -10.00 1056.00 x 856.00)
35
              (intersects coverage rect 0)
36
              (contentsScale 2.00)
37
              (children 1
38
                (GraphicsLayer
39
                  (anchor 0.00 0.00)
40
                  (bounds 300.00 300.00)
41
                  (visible rect 0.00, 0.00 300.00 x 300.00)
42
                  (coverage rect 0.00, 0.00 300.00 x 300.00)
43
                  (intersects coverage rect 1)
44
                  (contentsScale 2.00)
45
                  (children 1
46
                    (GraphicsLayer
47
                      (bounds origin 0.00 345.00)
48
                      (bounds 300.00 300.00)
49
                      (visible rect 0.00, 345.00 300.00 x 300.00)
50
                      (coverage rect 0.00, 345.00 300.00 x 300.00)
51
                      (intersects coverage rect 1)
52
                      (contentsScale 2.00)
53
                      (children 1
54
                        (GraphicsLayer
55
                          (offsetFromRenderer width=0 height=-345)
56
                          (anchor 0.00 0.00)
57
                          (bounds 300.00 1110.00)
58
                          (visible rect 0.00, 345.00 300.00 x 300.00)
59
                          (coverage rect 0.00, 345.00 300.00 x 300.00)
60
                          (intersects coverage rect 1)
61
                          (contentsScale 2.00)
62
                          (children 1
63
                            (GraphicsLayer
64
                              (bounds 300.00 1110.00)
65
                              (drawsContent 1)
66
                              (visible rect 0.00, 345.00 300.00 x 300.00)
67
                              (coverage rect 0.00, 217.00 556.00 x 556.00)
68
                              (intersects coverage rect 1)
69
                              (contentsScale 2.00)
70
                              (tile cache coverage 0, 0 300 x 1024)
71
                              (tile size 512 x 512)
72
                              (top left tile 0, 0 tiles grid 1 x 2)
73
                              (in window 1)
74
                              (children 1
75
                                (GraphicsLayer
76
                                  (visible rect 0.00, 0.00 0.00 x 0.00)
77
                                  (coverage rect 0.00, 217.00 556.00 x 556.00)
78
                                  (intersects coverage rect 0)
79
                                  (contentsScale 2.00)
80
                                  (children 1
81
                                    (GraphicsLayer
82
                                      (position 60.00 405.00)
83
                                      (bounds 110.00 110.00)
84
                                      (contentsOpaque 1)
85
                                      (drawsContent 1)
86
                                      (visible rect 0.00, 0.00 110.00 x 110.00)
87
                                      (coverage rect -60.00, -188.00 556.00 x 556.00)
88
                                      (intersects coverage rect 1)
89
                                      (contentsScale 2.00)
90
                                    )
91
                                  )
92
                                )
93
                              )
94
                            )
95
                          )
96
                        )
97
                      )
98
                    )
99
                  )
100
                )
101
              )
102
            )
103
          )
104
        )
105
        (GraphicsLayer
106
          (position 10.00 355.00)
107
          (bounds 100.00 100.00)
108
          (contentsOpaque 1)
109
          (visible rect 0.00, 0.00 100.00 x 100.00)
110
          (coverage rect -10.00, -355.00 1056.00 x 856.00)
111
          (intersects coverage rect 1)
112
          (contentsScale 2.00)
113
        )
114
      )
115
    )
116
  )
117
)
118
- a/LayoutTests/fast/scrolling/ios/reconcile-layer-position-iframe.html +67 lines
Line 0 a/LayoutTests/fast/scrolling/ios/reconcile-layer-position-iframe.html_sec1
1
<!DOCTYPE html>
2
<html>
3
  <head>
4
    <title>Reconcile layer position iframe</title>
5
    <meta charset="utf-8"/>
6
    <style>
7
      .fixed {
8
        position: fixed;
9
        height: 100px;
10
        width: 100px;
11
        left: 10px;
12
        top: 10px;
13
        background: cyan;
14
      }
15
    </style>
16
    <script src="../../../resources/basic-gestures.js"></script>
17
    <script>
18
      if (window.testRunner) {
19
          testRunner.dumpAsText();
20
          testRunner.waitUntilDone();
21
      }
22
      if (window.internals)
23
          window.internals.settings.setAsyncFrameScrollingEnabled(true);
24
      async function runTest() {
25
         if (!window.testRunner || !testRunner.runUIScript)
26
             return;
27
         await touchAndDragFromPointToPoint(15, 190, 15, 10);
28
         await liftUpAtPoint(15, 190);
29
         setTimeout(() => {
30
             document.getElementById('layerTree').innerText = internals.layerTreeAsText(document,
31
             internals.LAYER_TREE_INCLUDES_VISIBLE_RECTS | internals.LAYER_TREE_INCLUDES_TILE_CACHES);
32
             testRunner.notifyDone();
33
         }, 3000);
34
       }
35
    </script>
36
  </head>
37
  <body>
38
      <iframe onload="runTest()" style="border: 2px solid blue; height: 300px; width: 300px"
39
              srcdoc="<!DOCTYPE html>
40
<html>
41
  <head>
42
    <meta charset='utf-8'/>
43
    <style>
44
      div {
45
        margin: 50px;
46
        border: 5px solid black;
47
      }
48
      .fixed {
49
        position: fixed;
50
        height: 100px;
51
        width: 100px;
52
        left: 10px;
53
        top: 10px;
54
        background: yellow;
55
      }
56
    </style>
57
  </head>
58
  <body>
59
    <div style='height: 1000px'></div>
60
    <div class='fixed'></div>
61
  </body>
62
</html>
63
"></iframe>
64
    <div class="fixed"></div>
65
    <pre id="layerTree"></pre>
66
  </body>
67
</html>
- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp -6 / +9 lines
Lines 396-405 void AsyncScrollingCoordinator::reconcileScrollingState(FrameView& frameView, co a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp_sec1
396
    frameView.setInProgrammaticScroll(oldProgrammaticScroll);
396
    frameView.setInProgrammaticScroll(oldProgrammaticScroll);
397
397
398
    if (!programmaticScroll && scrollingLayerPositionAction != ScrollingLayerPositionAction::Set) {
398
    if (!programmaticScroll && scrollingLayerPositionAction != ScrollingLayerPositionAction::Set) {
399
        auto scrollingNodeID = frameView.scrollLayerID();
399
        if (viewportRectStability == ViewportRectStability::Stable)
400
        if (viewportRectStability == ViewportRectStability::Stable)
400
            reconcileViewportConstrainedLayerPositions(frameView.rectForFixedPositionLayout(), scrollingLayerPositionAction);
401
            reconcileViewportConstrainedLayerPositions(scrollingNodeID, frameView.rectForFixedPositionLayout(), scrollingLayerPositionAction);
401
        else if (layoutViewportRect)
402
        else if (layoutViewportRect)
402
            reconcileViewportConstrainedLayerPositions(LayoutRect(layoutViewportRect.value()), scrollingLayerPositionAction);
403
            reconcileViewportConstrainedLayerPositions(scrollingNodeID, LayoutRect(layoutViewportRect.value()), scrollingLayerPositionAction);
403
    }
404
    }
404
405
405
#if !PLATFORM(IOS)
406
#if !PLATFORM(IOS)
Lines 488-501 void AsyncScrollingCoordinator::clearStateTree() a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp_sec2
488
    m_scrollingStateTree->clear();
489
    m_scrollingStateTree->clear();
489
}
490
}
490
491
491
void AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions(const LayoutRect& viewportRect, ScrollingLayerPositionAction action)
492
void AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions(ScrollingNodeID scrollingNodeID, const LayoutRect& viewportRect, ScrollingLayerPositionAction action)
492
{
493
{
493
    if (!m_scrollingStateTree->rootStateNode())
494
    auto* scrollingNode = m_scrollingStateTree->stateNodeForID(scrollingNodeID);
495
496
    if (!scrollingNode)
494
        return;
497
        return;
495
498
496
    LOG_WITH_STREAM(Scrolling, stream << getpid() << " AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions for viewport rect " << viewportRect);
499
    LOG_WITH_STREAM(Scrolling, stream << getpid() << " AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions for viewport rect " << viewportRect << " and node " << scrollingNodeID);
497
500
498
    m_scrollingStateTree->rootStateNode()->reconcileLayerPositionForViewportRect(viewportRect, action);
501
    scrollingNode->reconcileLayerPositionForViewportRect(viewportRect, action);
499
}
502
}
500
503
501
void AsyncScrollingCoordinator::ensureRootStateNodeForFrameView(FrameView& frameView)
504
void AsyncScrollingCoordinator::ensureRootStateNodeForFrameView(FrameView& frameView)
- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h -1 / +1 lines
Lines 116-122 private: a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h_sec1
116
    bool isScrollSnapInProgress() const override;
116
    bool isScrollSnapInProgress() const override;
117
#endif
117
#endif
118
118
119
    WEBCORE_EXPORT void reconcileViewportConstrainedLayerPositions(const LayoutRect& viewportRect, ScrollingLayerPositionAction) override;
119
    WEBCORE_EXPORT void reconcileViewportConstrainedLayerPositions(ScrollingNodeID, const LayoutRect& viewportRect, ScrollingLayerPositionAction) override;
120
    WEBCORE_EXPORT void scrollableAreaScrollbarLayerDidChange(ScrollableArea&, ScrollbarOrientation) override;
120
    WEBCORE_EXPORT void scrollableAreaScrollbarLayerDidChange(ScrollableArea&, ScrollbarOrientation) override;
121
121
122
    WEBCORE_EXPORT void setSynchronousScrollingReasons(FrameView&, SynchronousScrollingReasons) final;
122
    WEBCORE_EXPORT void setSynchronousScrollingReasons(FrameView&, SynchronousScrollingReasons) final;
- a/Source/WebCore/page/scrolling/ScrollingCoordinator.h -2 / +1 lines
Lines 190-196 public: a/Source/WebCore/page/scrolling/ScrollingCoordinator.h_sec1
190
190
191
    virtual void updateFrameScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, GraphicsLayer* /*counterScrollingLayer*/, GraphicsLayer* /*insetClipLayer*/, const ScrollingGeometry* = nullptr) { }
191
    virtual void updateFrameScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, GraphicsLayer* /*counterScrollingLayer*/, GraphicsLayer* /*insetClipLayer*/, const ScrollingGeometry* = nullptr) { }
192
    virtual void updateOverflowScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, const ScrollingGeometry* = nullptr) { }
192
    virtual void updateOverflowScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, const ScrollingGeometry* = nullptr) { }
193
    virtual void reconcileViewportConstrainedLayerPositions(const LayoutRect&, ScrollingLayerPositionAction) { }
193
    virtual void reconcileViewportConstrainedLayerPositions(ScrollingNodeID, const LayoutRect&, ScrollingLayerPositionAction) { }
194
    virtual String scrollingStateTreeAsText(ScrollingStateTreeAsTextBehavior = ScrollingStateTreeAsTextBehaviorNormal) const;
194
    virtual String scrollingStateTreeAsText(ScrollingStateTreeAsTextBehavior = ScrollingStateTreeAsTextBehaviorNormal) const;
195
    virtual bool isRubberBandInProgress() const { return false; }
195
    virtual bool isRubberBandInProgress() const { return false; }
196
    virtual bool isScrollSnapInProgress() const { return false; }
196
    virtual bool isScrollSnapInProgress() const { return false; }
197
- 

Return to Bug 180002