Changeset 240553 in webkit


Ignore:
Timestamp:
Jan 27, 2019 8:58:48 AM (5 years ago)
Author:
Simon Fraser
Message:

Have composited RenderIFrame layers make FrameHosting scrolling tree nodes to parent the iframe's scrolling node
https://bugs.webkit.org/show_bug.cgi?id=193879

Reviewed by Antti Koivisto.

Source/WebCore:

Currently we parent iframe scrolling tree nodes by finding the closest ancestor layer with a scrolling tree node.
This results in scrolling tree nodes being connected across iframe boundaries in some arbitrary ancestor. This
makes updating scrolling tree geometry very error-prone, since changes in the parent document will need to trigger
updates of the scrolling tree node in an iframe.

To address this, I already added a new "FrameHosting" scrolling node type. This patch actually instantiates these
nodes, which are owned by the RenderIFrame's composited layer. Connecting across frame boundaries is theforefore
simply a case of getting the FrameHosting node from the ownerElement's renderer; this is very similar to how we
connect GraphicsLayers together.

RenderLayerBacking gains another scrolling role for FrameHosting and ScrollingNodeID.

Tested by existing tests.

  • page/FrameView.h:
  • rendering/RenderLayer.cpp:

(WebCore::outputPaintOrderTreeRecursive):

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::detachFromScrollingCoordinator):

  • rendering/RenderLayerCompositor.cpp:

(WebCore::frameContentsRenderView):
(WebCore::RenderLayerCompositor::frameContentsCompositor):
(WebCore::RenderLayerCompositor::parentFrameContentLayers):
(WebCore::RenderLayerCompositor::isLayerForIFrameWithScrollCoordinatedContents const):
(WebCore::RenderLayerCompositor::detachRootLayer):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
(WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
(WebCore::scrollCoordinatedAncestorInParentOfFrame):
(WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
(WebCore::RenderLayerCompositor::attachScrollingNode):
(WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):

  • rendering/RenderLayerCompositor.h:
  • testing/Internals.cpp:

(WebCore::Internals::scrollingStateTreeAsText const):

Source/WebKit:

Need a specialization of dump() for ScrollingStateFrameHostingNode to avoid infinite recursion.

  • Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:

(WebKit::dump):

LayoutTests:

New test results with FrameHosting nodes.

  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt:
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt:
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt:
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt:
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt:
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt:
  • scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt:
  • scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt:
  • scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt:
  • scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt:
  • scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
  • scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt:
  • scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt:
Location:
trunk
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r240550 r240553  
     12019-01-26  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Have composited RenderIFrame layers make FrameHosting scrolling tree nodes to parent the iframe's scrolling node
     4        https://bugs.webkit.org/show_bug.cgi?id=193879
     5
     6        Reviewed by Antti Koivisto.
     7
     8        New test results with FrameHosting nodes.
     9
     10        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt:
     11        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt:
     12        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt:
     13        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt:
     14        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
     15        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt:
     16        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt:
     17        * scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt:
     18        * scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt:
     19        * scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt:
     20        * scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt:
     21        * scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
     22        * scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt:
     23        * scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt:
     24
    1252019-01-26  Devin Rousso  <drousso@apple.com>
    226
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt

    r240505 r240553  
    1414  (behavior for fixed 0)
    1515  (children 1
    16     (Frame scrolling node
    17       (scrollable area size 500 300)
    18       (contents size 500 420)
    19       (scrollable area parameters
    20         (horizontal scroll elasticity 1)
    21         (vertical scroll elasticity 1)
    22         (horizontal scrollbar mode 0)
    23         (vertical scrollbar mode 0))
    24       (visual viewport enabled 1)
    25       (layout viewport at (0,0) size 500x300)
    26       (min layout viewport origin (0,0))
    27       (max layout viewport origin (0,120))
    28       (behavior for fixed 0)
    29       (children 2
    30         (Overflow scrolling node
    31           (scrollable area size 400 300)
    32           (contents size 400 1760)
     16    (Frame hosting node
     17      (children 1
     18        (Frame scrolling node
     19          (scrollable area size 500 300)
     20          (contents size 500 420)
    3321          (scrollable area parameters
    3422            (horizontal scroll elasticity 1)
     
    3624            (horizontal scrollbar mode 0)
    3725            (vertical scrollbar mode 0))
    38           (children 1
     26          (visual viewport enabled 1)
     27          (layout viewport at (0,0) size 500x300)
     28          (min layout viewport origin (0,0))
     29          (max layout viewport origin (0,120))
     30          (behavior for fixed 0)
     31          (children 2
     32            (Overflow scrolling node
     33              (scrollable area size 400 300)
     34              (contents size 400 1760)
     35              (scrollable area parameters
     36                (horizontal scroll elasticity 1)
     37                (vertical scroll elasticity 1)
     38                (horizontal scrollbar mode 0)
     39                (vertical scrollbar mode 0))
     40              (children 1
     41                (Sticky node
     42                  (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
     43                  (top offset 10.00)
     44                  (bottom offset 10.00)
     45                  (containing block rect at (2,2) size 400x1760)
     46                  (sticky box rect at (0,830) size 100x100)
     47                  (constraining rect at (0,0) size 400x300)
     48                  (sticky offset at last layout width=0 height=-640)
     49                  (layer position at last layout (0,190))
     50                )
     51              )
     52            )
    3953            (Sticky node
    4054              (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
    4155              (top offset 10.00)
    4256              (bottom offset 10.00)
    43               (containing block rect at (2,2) size 400x1760)
    44               (sticky box rect at (0,830) size 100x100)
    45               (constraining rect at (0,0) size 400x300)
    46               (sticky offset at last layout width=0 height=-640)
    47               (layer position at last layout (0,190))
     57              (containing block rect at (8,8) size 484x404)
     58              (sticky box rect at (8,312) size 100x100)
     59              (constraining rect at (0,0) size 500x300)
     60              (sticky offset at last layout width=0 height=-122)
     61              (layer position at last layout (8,190))
    4862            )
    4963          )
    50         )
    51         (Sticky node
    52           (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
    53           (top offset 10.00)
    54           (bottom offset 10.00)
    55           (containing block rect at (8,8) size 484x404)
    56           (sticky box rect at (8,312) size 100x100)
    57           (constraining rect at (0,0) size 500x300)
    58           (sticky offset at last layout width=0 height=-122)
    59           (layer position at last layout (8,190))
    6064        )
    6165      )
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt

    r240505 r240553  
    1919      (layer position at last layout (8,10))
    2020      (children 1
    21         (Frame scrolling node
    22           (scrollable area size 500 300)
    23           (contents size 500 420)
    24           (scrollable area parameters
    25             (horizontal scroll elasticity 1)
    26             (vertical scroll elasticity 1)
    27             (horizontal scrollbar mode 1)
    28             (vertical scrollbar mode 1))
    29           (visual viewport enabled 1)
    30           (layout viewport at (0,0) size 500x300)
    31           (min layout viewport origin (0,0))
    32           (max layout viewport origin (0,120))
    33           (behavior for fixed 0)
    34           (children 2
    35             (Overflow scrolling node
    36               (scrollable area size 400 300)
    37               (contents size 400 1760)
     21        (Frame hosting node
     22          (children 1
     23            (Frame scrolling node
     24              (scrollable area size 500 300)
     25              (contents size 500 420)
    3826              (scrollable area parameters
    3927                (horizontal scroll elasticity 1)
    4028                (vertical scroll elasticity 1)
    41                 (horizontal scrollbar mode 0)
    42                 (vertical scrollbar mode 0))
    43               (children 1
     29                (horizontal scrollbar mode 1)
     30                (vertical scrollbar mode 1))
     31              (visual viewport enabled 1)
     32              (layout viewport at (0,0) size 500x300)
     33              (min layout viewport origin (0,0))
     34              (max layout viewport origin (0,120))
     35              (behavior for fixed 0)
     36              (children 2
     37                (Overflow scrolling node
     38                  (scrollable area size 400 300)
     39                  (contents size 400 1760)
     40                  (scrollable area parameters
     41                    (horizontal scroll elasticity 1)
     42                    (vertical scroll elasticity 1)
     43                    (horizontal scrollbar mode 0)
     44                    (vertical scrollbar mode 0))
     45                  (children 1
     46                    (Sticky node
     47                      (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
     48                      (top offset 10.00)
     49                      (bottom offset 10.00)
     50                      (containing block rect at (2,2) size 400x1760)
     51                      (sticky box rect at (0,830) size 100x100)
     52                      (constraining rect at (0,0) size 400x300)
     53                      (sticky offset at last layout width=0 height=-640)
     54                      (layer position at last layout (0,190))
     55                    )
     56                  )
     57                )
    4458                (Sticky node
    4559                  (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
    4660                  (top offset 10.00)
    4761                  (bottom offset 10.00)
    48                   (containing block rect at (2,2) size 400x1760)
    49                   (sticky box rect at (0,830) size 100x100)
    50                   (constraining rect at (0,0) size 400x300)
    51                   (sticky offset at last layout width=0 height=-640)
    52                   (layer position at last layout (0,190))
     62                  (containing block rect at (8,8) size 484x404)
     63                  (sticky box rect at (8,312) size 100x100)
     64                  (constraining rect at (0,0) size 500x300)
     65                  (sticky offset at last layout width=0 height=-122)
     66                  (layer position at last layout (8,190))
    5367                )
    5468              )
    55             )
    56             (Sticky node
    57               (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
    58               (top offset 10.00)
    59               (bottom offset 10.00)
    60               (containing block rect at (8,8) size 484x404)
    61               (sticky box rect at (8,312) size 100x100)
    62               (constraining rect at (0,0) size 500x300)
    63               (sticky offset at last layout width=0 height=-122)
    64               (layer position at last layout (8,190))
    6569            )
    6670          )
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt

    r240505 r240553  
    1919      (layer position at last layout (8,0))
    2020      (children 1
    21         (Frame scrolling node
    22           (scrollable area size 500 300)
    23           (contents size 500 420)
    24           (scrollable area parameters
    25             (horizontal scroll elasticity 1)
    26             (vertical scroll elasticity 1)
    27             (horizontal scrollbar mode 0)
    28             (vertical scrollbar mode 0))
    29           (visual viewport enabled 1)
    30           (layout viewport at (0,0) size 500x300)
    31           (min layout viewport origin (0,0))
    32           (max layout viewport origin (0,120))
    33           (behavior for fixed 0)
    34           (children 2
    35             (Overflow scrolling node
    36               (scrollable area size 400 300)
    37               (contents size 400 1760)
     21        (Frame hosting node
     22          (children 1
     23            (Frame scrolling node
     24              (scrollable area size 500 300)
     25              (contents size 500 420)
    3826              (scrollable area parameters
    3927                (horizontal scroll elasticity 1)
     
    4129                (horizontal scrollbar mode 0)
    4230                (vertical scrollbar mode 0))
    43               (children 1
     31              (visual viewport enabled 1)
     32              (layout viewport at (0,0) size 500x300)
     33              (min layout viewport origin (0,0))
     34              (max layout viewport origin (0,120))
     35              (behavior for fixed 0)
     36              (children 2
     37                (Overflow scrolling node
     38                  (scrollable area size 400 300)
     39                  (contents size 400 1760)
     40                  (scrollable area parameters
     41                    (horizontal scroll elasticity 1)
     42                    (vertical scroll elasticity 1)
     43                    (horizontal scrollbar mode 0)
     44                    (vertical scrollbar mode 0))
     45                  (children 1
     46                    (Sticky node
     47                      (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
     48                      (top offset 10.00)
     49                      (bottom offset 10.00)
     50                      (containing block rect at (2,2) size 400x1760)
     51                      (sticky box rect at (0,830) size 100x100)
     52                      (constraining rect at (0,0) size 400x300)
     53                      (sticky offset at last layout width=0 height=-640)
     54                      (layer position at last layout (0,190))
     55                    )
     56                  )
     57                )
    4458                (Sticky node
    4559                  (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
    4660                  (top offset 10.00)
    4761                  (bottom offset 10.00)
    48                   (containing block rect at (2,2) size 400x1760)
    49                   (sticky box rect at (0,830) size 100x100)
    50                   (constraining rect at (0,0) size 400x300)
    51                   (sticky offset at last layout width=0 height=-640)
    52                   (layer position at last layout (0,190))
     62                  (containing block rect at (8,8) size 484x404)
     63                  (sticky box rect at (8,312) size 100x100)
     64                  (constraining rect at (0,0) size 500x300)
     65                  (sticky offset at last layout width=0 height=-122)
     66                  (layer position at last layout (8,190))
    5367                )
    5468              )
    55             )
    56             (Sticky node
    57               (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
    58               (top offset 10.00)
    59               (bottom offset 10.00)
    60               (containing block rect at (8,8) size 484x404)
    61               (sticky box rect at (8,312) size 100x100)
    62               (constraining rect at (0,0) size 500x300)
    63               (sticky offset at last layout width=0 height=-122)
    64               (layer position at last layout (8,190))
    6569            )
    6670          )
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt

    r240505 r240553  
    1414  (behavior for fixed 0)
    1515  (children 1
    16     (Frame scrolling node
    17       (scrollable area size 500 300)
    18       (contents size 500 420)
    19       (scrollable area parameters
    20         (horizontal scroll elasticity 1)
    21         (vertical scroll elasticity 1)
    22         (horizontal scrollbar mode 1)
    23         (vertical scrollbar mode 1))
    24       (visual viewport enabled 1)
    25       (layout viewport at (0,0) size 500x300)
    26       (min layout viewport origin (0,0))
    27       (max layout viewport origin (0,120))
    28       (behavior for fixed 0)
    29       (children 2
    30         (Overflow scrolling node
    31           (scrollable area size 400 300)
    32           (contents size 400 1760)
     16    (Frame hosting node
     17      (children 1
     18        (Frame scrolling node
     19          (scrollable area size 500 300)
     20          (contents size 500 420)
    3321          (scrollable area parameters
    3422            (horizontal scroll elasticity 1)
    3523            (vertical scroll elasticity 1)
    36             (horizontal scrollbar mode 0)
    37             (vertical scrollbar mode 0))
    38           (children 1
     24            (horizontal scrollbar mode 1)
     25            (vertical scrollbar mode 1))
     26          (visual viewport enabled 1)
     27          (layout viewport at (0,0) size 500x300)
     28          (min layout viewport origin (0,0))
     29          (max layout viewport origin (0,120))
     30          (behavior for fixed 0)
     31          (children 2
     32            (Overflow scrolling node
     33              (scrollable area size 400 300)
     34              (contents size 400 1760)
     35              (scrollable area parameters
     36                (horizontal scroll elasticity 1)
     37                (vertical scroll elasticity 1)
     38                (horizontal scrollbar mode 0)
     39                (vertical scrollbar mode 0))
     40              (children 1
     41                (Sticky node
     42                  (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
     43                  (top offset 10.00)
     44                  (bottom offset 10.00)
     45                  (containing block rect at (2,2) size 400x1760)
     46                  (sticky box rect at (0,830) size 100x100)
     47                  (constraining rect at (0,0) size 400x300)
     48                  (sticky offset at last layout width=0 height=-640)
     49                  (layer position at last layout (0,190))
     50                )
     51              )
     52            )
    3953            (Sticky node
    4054              (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
    4155              (top offset 10.00)
    4256              (bottom offset 10.00)
    43               (containing block rect at (2,2) size 400x1760)
    44               (sticky box rect at (0,830) size 100x100)
    45               (constraining rect at (0,0) size 400x300)
    46               (sticky offset at last layout width=0 height=-640)
    47               (layer position at last layout (0,190))
     57              (containing block rect at (8,8) size 484x404)
     58              (sticky box rect at (8,312) size 100x100)
     59              (constraining rect at (0,0) size 500x300)
     60              (sticky offset at last layout width=0 height=-122)
     61              (layer position at last layout (8,190))
    4862            )
    4963          )
    50         )
    51         (Sticky node
    52           (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
    53           (top offset 10.00)
    54           (bottom offset 10.00)
    55           (containing block rect at (8,8) size 484x404)
    56           (sticky box rect at (8,312) size 100x100)
    57           (constraining rect at (0,0) size 500x300)
    58           (sticky offset at last layout width=0 height=-122)
    59           (layer position at last layout (8,190))
    6064        )
    6165      )
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt

    r240548 r240553  
    1515  (behavior for fixed 0)
    1616  (children 1
    17     (Frame scrolling node
    18       (scrollable area size 480 400)
    19       (contents size 480 1016)
    20       (requested scroll position 0 120)
    21       (requested scroll position represents programmatic scroll 1)
    22       (scrollable area parameters
    23         (horizontal scroll elasticity 1)
    24         (vertical scroll elasticity 1)
    25         (horizontal scrollbar mode 0)
    26         (vertical scrollbar mode 0))
    27       (visual viewport enabled 1)
    28       (layout viewport at (0,120) size 480x400)
    29       (min layout viewport origin (0,0))
    30       (max layout viewport origin (0,616))
    31       (behavior for fixed 0)
     17    (Frame hosting node
    3218      (children 1
    33         (Fixed node
    34           (anchor edges: AnchorEdgeLeft AnchorEdgeTop)
    35           (viewport rect at last layout at (0,120) size 480x400)
    36           (layer position at last layout (10,130))
     19        (Frame scrolling node
     20          (scrollable area size 480 400)
     21          (contents size 480 1016)
     22          (requested scroll position 0 120)
     23          (requested scroll position represents programmatic scroll 1)
     24          (scrollable area parameters
     25            (horizontal scroll elasticity 1)
     26            (vertical scroll elasticity 1)
     27            (horizontal scrollbar mode 0)
     28            (vertical scrollbar mode 0))
     29          (visual viewport enabled 1)
     30          (layout viewport at (0,120) size 480x400)
     31          (min layout viewport origin (0,0))
     32          (max layout viewport origin (0,616))
     33          (behavior for fixed 0)
     34          (children 1
     35            (Fixed node
     36              (anchor edges: AnchorEdgeLeft AnchorEdgeTop)
     37              (viewport rect at last layout at (0,120) size 480x400)
     38              (layer position at last layout (10,130))
     39            )
     40          )
    3741        )
    3842      )
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt

    r240505 r240553  
    1515  (behavior for fixed 0)
    1616  (children 1
    17     (Frame scrolling node
    18       (scrollable area size 100 200)
    19       (contents size 308 416)
    20       (scrollable area parameters
    21         (horizontal scroll elasticity 1)
    22         (vertical scroll elasticity 1)
    23         (horizontal scrollbar mode 0)
    24         (vertical scrollbar mode 0))
    25       (visual viewport enabled 1)
    26       (layout viewport at (0,0) size 100x200)
    27       (min layout viewport origin (0,0))
    28       (max layout viewport origin (208,216))
    29       (behavior for fixed 0)
     17    (Frame hosting node
     18      (children 1
     19        (Frame scrolling node
     20          (scrollable area size 100 200)
     21          (contents size 308 416)
     22          (scrollable area parameters
     23            (horizontal scroll elasticity 1)
     24            (vertical scroll elasticity 1)
     25            (horizontal scrollbar mode 0)
     26            (vertical scrollbar mode 0))
     27          (visual viewport enabled 1)
     28          (layout viewport at (0,0) size 100x200)
     29          (min layout viewport origin (0,0))
     30          (max layout viewport origin (208,216))
     31          (behavior for fixed 0)
     32        )
     33      )
    3034    )
    3135  )
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt

    r240535 r240553  
    1717  (behavior for fixed 0)
    1818  (children 1
    19     (Frame scrolling node
    20       (scrollable area size 600 500)
    21       (contents size 600 1024)
    22       (scrollable area parameters
    23         (horizontal scroll elasticity 1)
    24         (vertical scroll elasticity 1)
    25         (horizontal scrollbar mode 0)
    26         (vertical scrollbar mode 0))
    27       (visual viewport enabled 1)
    28       (layout viewport at (0,0) size 600x500)
    29       (min layout viewport origin (0,0))
    30       (max layout viewport origin (0,524))
    31       (behavior for fixed 0)
     19    (Frame hosting node
    3220      (children 1
    3321        (Frame scrolling node
    34           (scrollable area size 500 400)
    35           (contents size 500 1024)
     22          (scrollable area size 600 500)
     23          (contents size 600 1024)
    3624          (scrollable area parameters
    3725            (horizontal scroll elasticity 1)
     
    4028            (vertical scrollbar mode 0))
    4129          (visual viewport enabled 1)
    42           (layout viewport at (0,0) size 500x400)
     30          (layout viewport at (0,0) size 600x500)
    4331          (min layout viewport origin (0,0))
    44           (max layout viewport origin (0,624))
     32          (max layout viewport origin (0,524))
    4533          (behavior for fixed 0)
     34          (children 1
     35            (Frame hosting node
     36              (children 1
     37                (Frame scrolling node
     38                  (scrollable area size 500 400)
     39                  (contents size 500 1024)
     40                  (scrollable area parameters
     41                    (horizontal scroll elasticity 1)
     42                    (vertical scroll elasticity 1)
     43                    (horizontal scrollbar mode 0)
     44                    (vertical scrollbar mode 0))
     45                  (visual viewport enabled 1)
     46                  (layout viewport at (0,0) size 500x400)
     47                  (min layout viewport origin (0,0))
     48                  (max layout viewport origin (0,624))
     49                  (behavior for fixed 0)
     50                )
     51              )
     52            )
     53          )
    4654        )
    4755      )
     
    5563(Frame scrolling node
    5664  (scrollable area size 800 600)
    57   (contents size 800 1333)
     65  (contents size 800 1445)
    5866  (scrollable area parameters
    5967    (horizontal scroll elasticity 1)
     
    6472  (layout viewport at (0,0) size 800x600)
    6573  (min layout viewport origin (0,0))
    66   (max layout viewport origin (0,733))
     74  (max layout viewport origin (0,845))
    6775  (behavior for fixed 0)
    6876  (children 1
    69     (Frame scrolling node
    70       (scrollable area size 600 500)
    71       (contents size 600 500)
    72       (scrollable area parameters
    73         (horizontal scroll elasticity 1)
    74         (vertical scroll elasticity 1)
    75         (horizontal scrollbar mode 0)
    76         (vertical scrollbar mode 0))
    77       (visual viewport enabled 1)
    78       (layout viewport at (0,0) size 600x500)
    79       (min layout viewport origin (0,0))
    80       (max layout viewport origin (0,0))
    81       (behavior for fixed 0)
     77    (Frame hosting node
    8278      (children 1
    8379        (Frame scrolling node
    84           (scrollable area size 500 400)
    85           (contents size 500 1024)
     80          (scrollable area size 600 500)
     81          (contents size 600 500)
    8682          (scrollable area parameters
    8783            (horizontal scroll elasticity 1)
     
    9086            (vertical scrollbar mode 0))
    9187          (visual viewport enabled 1)
    92           (layout viewport at (0,0) size 500x400)
     88          (layout viewport at (0,0) size 600x500)
    9389          (min layout viewport origin (0,0))
    94           (max layout viewport origin (0,624))
     90          (max layout viewport origin (0,0))
    9591          (behavior for fixed 0)
     92          (children 1
     93            (Frame hosting node
     94              (children 1
     95                (Frame scrolling node
     96                  (scrollable area size 500 400)
     97                  (contents size 500 1024)
     98                  (scrollable area parameters
     99                    (horizontal scroll elasticity 1)
     100                    (vertical scroll elasticity 1)
     101                    (horizontal scrollbar mode 0)
     102                    (vertical scrollbar mode 0))
     103                  (visual viewport enabled 1)
     104                  (layout viewport at (0,0) size 500x400)
     105                  (min layout viewport origin (0,0))
     106                  (max layout viewport origin (0,624))
     107                  (behavior for fixed 0)
     108                )
     109              )
     110            )
     111          )
    96112        )
    97113      )
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt

    r240505 r240553  
    1717  (behavior for fixed 0)
    1818  (children 1
    19     (Frame scrolling node
    20       (scrollable area size 485 300)
    21       (contents size 485 420)
    22       (scrollable area parameters
    23         (horizontal scroll elasticity 0)
    24         (vertical scroll elasticity 0)
    25         (horizontal scrollbar mode 0)
    26         (vertical scrollbar mode 0)
    27         (has enabled vertical scrollbar 1))
    28       (visual viewport enabled 1)
    29       (layout viewport at (0,0) size 485x300)
    30       (min layout viewport origin (0,0))
    31       (max layout viewport origin (0,120))
    32       (behavior for fixed 0)
     19    (Frame hosting node
    3320      (children 1
    34         (Sticky node
    35           (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
    36           (top offset 10.00)
    37           (bottom offset 10.00)
    38           (containing block rect at (8,8) size 469x404)
    39           (sticky box rect at (8,312) size 100x100)
    40           (constraining rect at (0,0) size 485x300)
    41           (sticky offset at last layout width=0 height=-122)
    42           (layer position at last layout (8,190))
     21        (Frame scrolling node
     22          (scrollable area size 485 300)
     23          (contents size 485 420)
     24          (scrollable area parameters
     25            (horizontal scroll elasticity 0)
     26            (vertical scroll elasticity 0)
     27            (horizontal scrollbar mode 0)
     28            (vertical scrollbar mode 0)
     29            (has enabled vertical scrollbar 1))
     30          (visual viewport enabled 1)
     31          (layout viewport at (0,0) size 485x300)
     32          (min layout viewport origin (0,0))
     33          (max layout viewport origin (0,120))
     34          (behavior for fixed 0)
     35          (children 1
     36            (Sticky node
     37              (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
     38              (top offset 10.00)
     39              (bottom offset 10.00)
     40              (containing block rect at (8,8) size 469x404)
     41              (sticky box rect at (8,312) size 100x100)
     42              (constraining rect at (0,0) size 485x300)
     43              (sticky offset at last layout width=0 height=-122)
     44              (layer position at last layout (8,190))
     45            )
     46          )
    4347        )
    4448      )
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt

    r240505 r240553  
    2222      (layer position at last layout (8,10))
    2323      (children 1
    24         (Frame scrolling node
    25           (scrollable area size 500 300)
    26           (contents size 500 420)
    27           (scrollable area parameters
    28             (horizontal scroll elasticity 0)
    29             (vertical scroll elasticity 0)
    30             (horizontal scrollbar mode 1)
    31             (vertical scrollbar mode 1))
    32           (visual viewport enabled 1)
    33           (layout viewport at (0,0) size 500x300)
    34           (min layout viewport origin (0,0))
    35           (max layout viewport origin (0,120))
    36           (behavior for fixed 0)
     24        (Frame hosting node
    3725          (children 1
    38             (Sticky node
    39               (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
    40               (top offset 10.00)
    41               (bottom offset 10.00)
    42               (containing block rect at (8,8) size 484x404)
    43               (sticky box rect at (8,312) size 100x100)
    44               (constraining rect at (0,0) size 500x300)
    45               (sticky offset at last layout width=0 height=-122)
    46               (layer position at last layout (8,190))
     26            (Frame scrolling node
     27              (scrollable area size 500 300)
     28              (contents size 500 420)
     29              (scrollable area parameters
     30                (horizontal scroll elasticity 0)
     31                (vertical scroll elasticity 0)
     32                (horizontal scrollbar mode 1)
     33                (vertical scrollbar mode 1))
     34              (visual viewport enabled 1)
     35              (layout viewport at (0,0) size 500x300)
     36              (min layout viewport origin (0,0))
     37              (max layout viewport origin (0,120))
     38              (behavior for fixed 0)
     39              (children 1
     40                (Sticky node
     41                  (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
     42                  (top offset 10.00)
     43                  (bottom offset 10.00)
     44                  (containing block rect at (8,8) size 484x404)
     45                  (sticky box rect at (8,312) size 100x100)
     46                  (constraining rect at (0,0) size 500x300)
     47                  (sticky offset at last layout width=0 height=-122)
     48                  (layer position at last layout (8,190))
     49                )
     50              )
    4751            )
    4852          )
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt

    r240505 r240553  
    2222      (layer position at last layout (8,0))
    2323      (children 1
    24         (Frame scrolling node
    25           (scrollable area size 485 300)
    26           (contents size 485 420)
    27           (scrollable area parameters
    28             (horizontal scroll elasticity 0)
    29             (vertical scroll elasticity 0)
    30             (horizontal scrollbar mode 0)
    31             (vertical scrollbar mode 0)
    32             (has enabled vertical scrollbar 1))
    33           (visual viewport enabled 1)
    34           (layout viewport at (0,0) size 485x300)
    35           (min layout viewport origin (0,0))
    36           (max layout viewport origin (0,120))
    37           (behavior for fixed 0)
     24        (Frame hosting node
    3825          (children 1
    39             (Sticky node
    40               (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
    41               (top offset 10.00)
    42               (bottom offset 10.00)
    43               (containing block rect at (8,8) size 469x404)
    44               (sticky box rect at (8,312) size 100x100)
    45               (constraining rect at (0,0) size 485x300)
    46               (sticky offset at last layout width=0 height=-122)
    47               (layer position at last layout (8,190))
     26            (Frame scrolling node
     27              (scrollable area size 485 300)
     28              (contents size 485 420)
     29              (scrollable area parameters
     30                (horizontal scroll elasticity 0)
     31                (vertical scroll elasticity 0)
     32                (horizontal scrollbar mode 0)
     33                (vertical scrollbar mode 0)
     34                (has enabled vertical scrollbar 1))
     35              (visual viewport enabled 1)
     36              (layout viewport at (0,0) size 485x300)
     37              (min layout viewport origin (0,0))
     38              (max layout viewport origin (0,120))
     39              (behavior for fixed 0)
     40              (children 1
     41                (Sticky node
     42                  (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
     43                  (top offset 10.00)
     44                  (bottom offset 10.00)
     45                  (containing block rect at (8,8) size 469x404)
     46                  (sticky box rect at (8,312) size 100x100)
     47                  (constraining rect at (0,0) size 485x300)
     48                  (sticky offset at last layout width=0 height=-122)
     49                  (layer position at last layout (8,190))
     50                )
     51              )
    4852            )
    4953          )
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt

    r240505 r240553  
    1717  (behavior for fixed 0)
    1818  (children 1
    19     (Frame scrolling node
    20       (scrollable area size 500 300)
    21       (contents size 500 420)
    22       (scrollable area parameters
    23         (horizontal scroll elasticity 0)
    24         (vertical scroll elasticity 0)
    25         (horizontal scrollbar mode 1)
    26         (vertical scrollbar mode 1))
    27       (visual viewport enabled 1)
    28       (layout viewport at (0,0) size 500x300)
    29       (min layout viewport origin (0,0))
    30       (max layout viewport origin (0,120))
    31       (behavior for fixed 0)
     19    (Frame hosting node
    3220      (children 1
    33         (Sticky node
    34           (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
    35           (top offset 10.00)
    36           (bottom offset 10.00)
    37           (containing block rect at (8,8) size 484x404)
    38           (sticky box rect at (8,312) size 100x100)
    39           (constraining rect at (0,0) size 500x300)
    40           (sticky offset at last layout width=0 height=-122)
    41           (layer position at last layout (8,190))
     21        (Frame scrolling node
     22          (scrollable area size 500 300)
     23          (contents size 500 420)
     24          (scrollable area parameters
     25            (horizontal scroll elasticity 0)
     26            (vertical scroll elasticity 0)
     27            (horizontal scrollbar mode 1)
     28            (vertical scrollbar mode 1))
     29          (visual viewport enabled 1)
     30          (layout viewport at (0,0) size 500x300)
     31          (min layout viewport origin (0,0))
     32          (max layout viewport origin (0,120))
     33          (behavior for fixed 0)
     34          (children 1
     35            (Sticky node
     36              (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
     37              (top offset 10.00)
     38              (bottom offset 10.00)
     39              (containing block rect at (8,8) size 484x404)
     40              (sticky box rect at (8,312) size 100x100)
     41              (constraining rect at (0,0) size 500x300)
     42              (sticky offset at last layout width=0 height=-122)
     43              (layer position at last layout (8,190))
     44            )
     45          )
    4246        )
    4347      )
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt

    r240548 r240553  
    1616  (behavior for fixed 0)
    1717  (children 1
    18     (Frame scrolling node
    19       (scrollable area size 465 400)
    20       (contents size 465 1016)
    21       (requested scroll position 0 120)
    22       (requested scroll position represents programmatic scroll 1)
    23       (scrollable area parameters
    24         (horizontal scroll elasticity 0)
    25         (vertical scroll elasticity 0)
    26         (horizontal scrollbar mode 0)
    27         (vertical scrollbar mode 0)
    28         (has enabled vertical scrollbar 1))
    29       (visual viewport enabled 1)
    30       (layout viewport at (0,120) size 465x400)
    31       (min layout viewport origin (0,0))
    32       (max layout viewport origin (0,616))
    33       (behavior for fixed 0)
     18    (Frame hosting node
    3419      (children 1
    35         (Fixed node
    36           (anchor edges: AnchorEdgeLeft AnchorEdgeTop)
    37           (viewport rect at last layout at (0,120) size 465x400)
    38           (layer position at last layout (10,130))
     20        (Frame scrolling node
     21          (scrollable area size 465 400)
     22          (contents size 465 1016)
     23          (requested scroll position 0 120)
     24          (requested scroll position represents programmatic scroll 1)
     25          (scrollable area parameters
     26            (horizontal scroll elasticity 0)
     27            (vertical scroll elasticity 0)
     28            (horizontal scrollbar mode 0)
     29            (vertical scrollbar mode 0)
     30            (has enabled vertical scrollbar 1))
     31          (visual viewport enabled 1)
     32          (layout viewport at (0,120) size 465x400)
     33          (min layout viewport origin (0,0))
     34          (max layout viewport origin (0,616))
     35          (behavior for fixed 0)
     36          (children 1
     37            (Fixed node
     38              (anchor edges: AnchorEdgeLeft AnchorEdgeTop)
     39              (viewport rect at last layout at (0,120) size 465x400)
     40              (layer position at last layout (10,130))
     41            )
     42          )
    3943        )
    4044      )
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt

    r240505 r240553  
    1515  (behavior for fixed 0)
    1616  (children 1
    17     (Frame scrolling node
    18       (scrollable area size 85 185)
    19       (contents size 308 416)
    20       (scrollable area parameters
    21         (horizontal scroll elasticity 0)
    22         (vertical scroll elasticity 0)
    23         (horizontal scrollbar mode 0)
    24         (vertical scrollbar mode 0)
    25         (has enabled horizontal scrollbar 1)
    26         (has enabled vertical scrollbar 1))
    27       (visual viewport enabled 1)
    28       (layout viewport at (0,0) size 85x185)
    29       (min layout viewport origin (0,0))
    30       (max layout viewport origin (223,231))
    31       (behavior for fixed 0)
     17    (Frame hosting node
     18      (children 1
     19        (Frame scrolling node
     20          (scrollable area size 85 185)
     21          (contents size 308 416)
     22          (scrollable area parameters
     23            (horizontal scroll elasticity 0)
     24            (vertical scroll elasticity 0)
     25            (horizontal scrollbar mode 0)
     26            (vertical scrollbar mode 0)
     27            (has enabled horizontal scrollbar 1)
     28            (has enabled vertical scrollbar 1))
     29          (visual viewport enabled 1)
     30          (layout viewport at (0,0) size 85x185)
     31          (min layout viewport origin (0,0))
     32          (max layout viewport origin (223,231))
     33          (behavior for fixed 0)
     34        )
     35      )
    3236    )
    3337  )
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt

    r240535 r240553  
    1818  (behavior for fixed 0)
    1919  (children 1
    20     (Frame scrolling node
    21       (scrollable area size 585 500)
    22       (contents size 585 1024)
    23       (scrollable area parameters
    24         (horizontal scroll elasticity 0)
    25         (vertical scroll elasticity 0)
    26         (horizontal scrollbar mode 0)
    27         (vertical scrollbar mode 0)
    28         (has enabled vertical scrollbar 1))
    29       (visual viewport enabled 1)
    30       (layout viewport at (0,0) size 585x500)
    31       (min layout viewport origin (0,0))
    32       (max layout viewport origin (0,524))
    33       (behavior for fixed 0)
     20    (Frame hosting node
    3421      (children 1
    3522        (Frame scrolling node
    36           (scrollable area size 485 400)
    37           (contents size 485 1024)
     23          (scrollable area size 585 500)
     24          (contents size 585 1024)
    3825          (scrollable area parameters
    3926            (horizontal scroll elasticity 0)
     
    4330            (has enabled vertical scrollbar 1))
    4431          (visual viewport enabled 1)
    45           (layout viewport at (0,0) size 485x400)
     32          (layout viewport at (0,0) size 585x500)
    4633          (min layout viewport origin (0,0))
    47           (max layout viewport origin (0,624))
     34          (max layout viewport origin (0,524))
    4835          (behavior for fixed 0)
     36          (children 1
     37            (Frame hosting node
     38              (children 1
     39                (Frame scrolling node
     40                  (scrollable area size 485 400)
     41                  (contents size 485 1024)
     42                  (scrollable area parameters
     43                    (horizontal scroll elasticity 0)
     44                    (vertical scroll elasticity 0)
     45                    (horizontal scrollbar mode 0)
     46                    (vertical scrollbar mode 0)
     47                    (has enabled vertical scrollbar 1))
     48                  (visual viewport enabled 1)
     49                  (layout viewport at (0,0) size 485x400)
     50                  (min layout viewport origin (0,0))
     51                  (max layout viewport origin (0,624))
     52                  (behavior for fixed 0)
     53                )
     54              )
     55            )
     56          )
    4957        )
    5058      )
     
    5866(Frame scrolling node
    5967  (scrollable area size 785 600)
    60   (contents size 785 1421)
     68  (contents size 785 1541)
    6169  (scrollable area parameters
    6270    (horizontal scroll elasticity 2)
     
    6876  (layout viewport at (0,0) size 785x600)
    6977  (min layout viewport origin (0,0))
    70   (max layout viewport origin (0,821))
     78  (max layout viewport origin (0,941))
    7179  (behavior for fixed 0)
    7280  (children 1
    73     (Frame scrolling node
    74       (scrollable area size 600 500)
    75       (contents size 600 500)
    76       (scrollable area parameters
    77         (horizontal scroll elasticity 0)
    78         (vertical scroll elasticity 0)
    79         (horizontal scrollbar mode 0)
    80         (vertical scrollbar mode 0))
    81       (visual viewport enabled 1)
    82       (layout viewport at (0,0) size 600x500)
    83       (min layout viewport origin (0,0))
    84       (max layout viewport origin (0,0))
    85       (behavior for fixed 0)
     81    (Frame hosting node
    8682      (children 1
    8783        (Frame scrolling node
    88           (scrollable area size 485 400)
    89           (contents size 485 1024)
     84          (scrollable area size 600 500)
     85          (contents size 600 500)
    9086          (scrollable area parameters
    9187            (horizontal scroll elasticity 0)
    9288            (vertical scroll elasticity 0)
    9389            (horizontal scrollbar mode 0)
    94             (vertical scrollbar mode 0)
    95             (has enabled vertical scrollbar 1))
     90            (vertical scrollbar mode 0))
    9691          (visual viewport enabled 1)
    97           (layout viewport at (0,0) size 485x400)
     92          (layout viewport at (0,0) size 600x500)
    9893          (min layout viewport origin (0,0))
    99           (max layout viewport origin (0,624))
     94          (max layout viewport origin (0,0))
    10095          (behavior for fixed 0)
     96          (children 1
     97            (Frame hosting node
     98              (children 1
     99                (Frame scrolling node
     100                  (scrollable area size 485 400)
     101                  (contents size 485 1024)
     102                  (scrollable area parameters
     103                    (horizontal scroll elasticity 0)
     104                    (vertical scroll elasticity 0)
     105                    (horizontal scrollbar mode 0)
     106                    (vertical scrollbar mode 0)
     107                    (has enabled vertical scrollbar 1))
     108                  (visual viewport enabled 1)
     109                  (layout viewport at (0,0) size 485x400)
     110                  (min layout viewport origin (0,0))
     111                  (max layout viewport origin (0,624))
     112                  (behavior for fixed 0)
     113                )
     114              )
     115            )
     116          )
    101117        )
    102118      )
  • trunk/Source/WebCore/ChangeLog

    r240552 r240553  
     12019-01-26  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Have composited RenderIFrame layers make FrameHosting scrolling tree nodes to parent the iframe's scrolling node
     4        https://bugs.webkit.org/show_bug.cgi?id=193879
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Currently we parent iframe scrolling tree nodes by finding the closest ancestor layer with a scrolling tree node.
     9        This results in scrolling tree nodes being connected across iframe boundaries in some arbitrary ancestor. This
     10        makes updating scrolling tree geometry very error-prone, since changes in the parent document will need to trigger
     11        updates of the scrolling tree node in an iframe.
     12       
     13        To address this, I already added a new "FrameHosting" scrolling node type. This patch actually instantiates these
     14        nodes, which are owned by the RenderIFrame's composited layer. Connecting across frame boundaries is theforefore
     15        simply a case of getting the FrameHosting node from the ownerElement's renderer; this is very similar to how we
     16        connect GraphicsLayers together.
     17       
     18        RenderLayerBacking gains another scrolling role for FrameHosting and ScrollingNodeID.
     19
     20        Tested by existing tests.
     21
     22        * page/FrameView.h:
     23        * rendering/RenderLayer.cpp:
     24        (WebCore::outputPaintOrderTreeRecursive):
     25        * rendering/RenderLayerBacking.cpp:
     26        (WebCore::RenderLayerBacking::updateConfiguration):
     27        (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
     28        * rendering/RenderLayerCompositor.cpp:
     29        (WebCore::frameContentsRenderView):
     30        (WebCore::RenderLayerCompositor::frameContentsCompositor):
     31        (WebCore::RenderLayerCompositor::parentFrameContentLayers):
     32        (WebCore::RenderLayerCompositor::isLayerForIFrameWithScrollCoordinatedContents const):
     33        (WebCore::RenderLayerCompositor::detachRootLayer):
     34        (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
     35        (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
     36        (WebCore::scrollCoordinatedAncestorInParentOfFrame):
     37        (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
     38        (WebCore::RenderLayerCompositor::attachScrollingNode):
     39        (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
     40        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
     41        * rendering/RenderLayerCompositor.h:
     42        * testing/Internals.cpp:
     43        (WebCore::Internals::scrollingStateTreeAsText const):
     44
    1452019-01-27  Chris Fleizach  <cfleizach@apple.com>
    246
  • trunk/Source/WebCore/page/FrameView.h

    r240519 r240553  
    153153    WEBCORE_EXPORT TiledBacking* tiledBacking() const final;
    154154
    155     // In the future when any ScrollableArea can have a node in th ScrollingTree, this should
    156     // become a virtual function on ScrollableArea.
    157155    uint64_t scrollLayerID() const override;
    158156    ScrollableArea* scrollableAreaForScrollLayerID(uint64_t) const;
     157    bool usesAsyncScrolling() const final;
    159158
    160159    WEBCORE_EXPORT void enterCompositingMode();
     
    747746
    748747    bool usesCompositedScrolling() const final;
    749     bool usesAsyncScrolling() const final;
    750748    bool usesMockScrollAnimator() const final;
    751749    void logMockScrollAnimatorMessage(const String&) const final;
  • trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp

    r240551 r240553  
    118118
    119119    m_parent->removeChild(*this);
     120    m_parent = nullptr;
    120121}
    121122
  • trunk/Source/WebCore/page/scrolling/ScrollingStateTree.cpp

    r240551 r240553  
    214214        return;
    215215
     216    LOG_WITH_STREAM(Scrolling, stream << "ScrollingStateTree " << this << " unparentChildrenAndDestroyNode " << nodeID);
     217
    216218    // The node may not be found if clear() was recently called.
    217219    RefPtr<ScrollingStateNode> protectedNode = m_stateNodeMap.take(nodeID);
     
    222224        for (auto child : *children) {
    223225            child->removeFromParent();
     226            LOG_WITH_STREAM(Scrolling, stream << " moving " << child->scrollingNodeID() << " to unparented nodes");
    224227            m_unparentedNodes.add(child->scrollingNodeID(), WTFMove(child));
    225228        }
     
    235238    if (!nodeID)
    236239        return;
     240
     241    LOG_WITH_STREAM(Scrolling, stream << "ScrollingStateTree " << this << " detachAndDestroySubtree " << nodeID);
    237242
    238243    // The node may not be found if clear() was recently called.
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r240336 r240553  
    66916691
    66926692    stream << &layer << " " << layerRect;
    6693     if (layer.isComposited())
    6694         stream << " (layerID " << layer.backing()->graphicsLayer()->primaryLayerID() << ")";
     6693    if (layer.isComposited()) {
     6694        auto& backing = *layer.backing();
     6695        stream << " (layerID " << backing.graphicsLayer()->primaryLayerID() << ")";
     6696
     6697        auto scrollingNodeID = backing.scrollingNodeIDForRole(WebCore::ScrollCoordinationRole::Scrolling);
     6698        auto frameHostingNodeID = backing.scrollingNodeIDForRole(WebCore::ScrollCoordinationRole::FrameHosting);
     6699        auto viewportConstrainedNodeID = backing.scrollingNodeIDForRole(WebCore::ScrollCoordinationRole::ViewportConstrained);
     6700
     6701        if (scrollingNodeID || frameHostingNodeID || viewportConstrainedNodeID) {
     6702            stream << " {";
     6703            bool first = true;
     6704            if (scrollingNodeID) {
     6705                stream << "sc " << scrollingNodeID;
     6706                first = false;
     6707            }
     6708
     6709            if (frameHostingNodeID) {
     6710                if (!first)
     6711                    stream << ", ";
     6712                stream << "fh " << frameHostingNodeID;
     6713                first = false;
     6714            }
     6715
     6716            if (viewportConstrainedNodeID) {
     6717                if (!first)
     6718                    stream << ", ";
     6719                stream << "vc " << viewportConstrainedNodeID;
     6720            }
     6721
     6722            stream << "}";
     6723        }
     6724    }
    66956725    stream << " " << layer.name();
    66966726    stream.nextLine();
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r240551 r240553  
    784784    }
    785785#endif
    786     if (is<RenderWidget>(renderer()) && RenderLayerCompositor::parentFrameContentLayers(downcast<RenderWidget>(renderer()))) {
     786    if (is<RenderWidget>(renderer()) && compositor().parentFrameContentLayers(downcast<RenderWidget>(renderer()))) {
    787787        m_owningLayer.setNeedsCompositingGeometryUpdate();
    788788        layerConfigChanged = true;
     
    17701770void RenderLayerBacking::detachFromScrollingCoordinator(OptionSet<ScrollCoordinationRole> roles)
    17711771{
    1772     if (!m_scrollingNodeID && !m_viewportConstrainedNodeID)
     1772    if (!m_scrollingNodeID && !m_frameHostingNodeID && !m_viewportConstrainedNodeID)
    17731773        return;
    17741774
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r240551 r240553  
    19291929}
    19301930
     1931static RenderView* frameContentsRenderView(RenderWidget& renderer)
     1932{
     1933    if (auto* contentDocument = renderer.frameOwnerElement().contentDocument())
     1934        return contentDocument->renderView();
     1935
     1936    return nullptr;
     1937}
     1938
    19311939RenderLayerCompositor* RenderLayerCompositor::frameContentsCompositor(RenderWidget& renderer)
    19321940{
    1933     if (auto* contentDocument = renderer.frameOwnerElement().contentDocument()) {
    1934         if (auto* view = contentDocument->renderView())
    1935             return &view->compositor();
    1936     }
     1941    if (auto* view = frameContentsRenderView(renderer))
     1942        return &view->compositor();
     1943
    19371944    return nullptr;
    19381945}
     
    19551962        hostingLayer->addChild(*rootLayer);
    19561963    }
     1964
     1965    if (auto frameHostingNodeID = backing->scrollingNodeIDForRole(ScrollCoordinationRole::FrameHosting)) {
     1966        auto* contentsRenderView = frameContentsRenderView(renderer);
     1967        if (auto frameRootScrollingNodeID = contentsRenderView->frameView().scrollLayerID()) {
     1968            if (auto* scrollingCoordinator = this->scrollingCoordinator())
     1969                scrollingCoordinator->insertNode(ScrollingNodeType::Subframe, frameRootScrollingNodeID, frameHostingNodeID, 0);
     1970        }
     1971    }
     1972
    19571973    // FIXME: Why always return true and not just when the layers changed?
    19581974    return true;
     
    28442860}
    28452861
     2862bool RenderLayerCompositor::isLayerForIFrameWithScrollCoordinatedContents(const RenderLayer& layer) const
     2863{
     2864    if (!is<RenderWidget>(layer.renderer()))
     2865        return false;
     2866
     2867    auto* contentDocument = downcast<RenderWidget>(layer.renderer()).frameOwnerElement().contentDocument();
     2868    if (!contentDocument)
     2869        return false;
     2870
     2871    auto* view = contentDocument->renderView();
     2872    if (!view)
     2873        return false;
     2874
     2875    if (auto* scrollingCoordinator = this->scrollingCoordinator())
     2876        return scrollingCoordinator->coordinatesScrollingForFrameView(view->frameView());
     2877
     2878    return false;
     2879}
     2880
    28462881bool RenderLayerCompositor::isRunningTransformAnimation(RenderLayerModelObject& renderer) const
    28472882{
     
    28602895
    28612896// If an element has negative z-index children, those children render in front of the
    2862 // layer background, so we need an extra 'contents' layer for the foreground of the layer
    2863 // object.
     2897// layer background, so we need an extra 'contents' layer for the foreground of the layer object.
    28642898bool RenderLayerCompositor::needsContentsCompositingLayer(const RenderLayer& layer) const
    28652899{
     
    35353569    switch (m_rootLayerAttachment) {
    35363570    case RootLayerAttachedViaEnclosingFrame: {
    3537         // The layer will get unhooked up via RenderLayerBacking::updateGraphicsLayerConfiguration()
     3571        // The layer will get unhooked up via RenderLayerBacking::updateConfiguration()
    35383572        // for the frame's renderer in the parent document.
    35393573        if (m_overflowControlsHostLayer)
     
    35443578        if (auto* ownerElement = m_renderView.document().ownerElement())
    35453579            ownerElement->scheduleInvalidateStyleAndLayerComposition();
     3580
     3581        if (auto frameRootScrollingNodeID = m_renderView.frameView().scrollLayerID()) {
     3582            if (auto* scrollingCoordinator = this->scrollingCoordinator())
     3583                scrollingCoordinator->unparentNode(frameRootScrollingNodeID);
     3584        }
    35463585        break;
    35473586    }
     
    36523691        coordinationRoles.add(ScrollCoordinationRole::Scrolling);
    36533692
     3693    if (isLayerForIFrameWithScrollCoordinatedContents(layer)) {
     3694        // We never expect a RenderIFrame to have scrollable overflow.
     3695        ASSERT(!coordinationRoles.contains(ScrollCoordinationRole::Scrolling));
     3696        coordinationRoles.add(ScrollCoordinationRole::FrameHosting);
     3697    }
     3698
    36543699    if (layer.isComposited())
    36553700        layer.backing()->setIsScrollCoordinatedWithViewportConstrainedRole(coordinationRoles.contains(ScrollCoordinationRole::ViewportConstrained));
     
    36743719    m_scrollCoordinatedLayersNeedingUpdate.remove(&layer);
    36753720
    3676     detachScrollCoordinatedLayer(layer, { ScrollCoordinationRole::Scrolling, ScrollCoordinationRole::ViewportConstrained });
     3721    detachScrollCoordinatedLayer(layer, { ScrollCoordinationRole::Scrolling, ScrollCoordinationRole::ViewportConstrained, ScrollCoordinationRole::FrameHosting });
    36773722}
    36783723
     
    37483793}
    37493794
    3750 static ScrollingNodeID scrollCoordinatedAncestorInParentOfFrame(Frame& frame)
     3795static Optional<ScrollingNodeID> scrollCoordinatedAncestorInParentOfFrame(Frame& frame)
    37513796{
    37523797    if (!frame.document() || !frame.view())
    3753         return 0;
     3798        return { };
    37543799
    37553800    // Find the frame's enclosing layer in our render tree.
    37563801    auto* ownerElement = frame.document()->ownerElement();
    37573802    auto* frameRenderer = ownerElement ? ownerElement->renderer() : nullptr;
    3758     if (!frameRenderer)
    3759         return 0;
    3760 
    3761     auto* layerInParentDocument = frameRenderer->enclosingLayer();
    3762     if (!layerInParentDocument)
    3763         return 0;
    3764 
    3765     return enclosingScrollingNodeID(*layerInParentDocument, IncludeSelf);
     3803    if (!frameRenderer || !is<RenderWidget>(frameRenderer))
     3804        return { };
     3805
     3806    auto& widgetRenderer = downcast<RenderWidget>(*frameRenderer);
     3807    if (!widgetRenderer.hasLayer() || !widgetRenderer.layer()->isComposited()) {
     3808        LOG(Scrolling, "scrollCoordinatedAncestorInParentOfFrame: frame renderer has no layer or is not composited.");
     3809        return { };
     3810    }
     3811
     3812    if (auto frameHostingNodeID = widgetRenderer.layer()->backing()->scrollingNodeIDForRole(ScrollCoordinationRole::FrameHosting))
     3813        return frameHostingNodeID;
     3814
     3815    return { };
    37663816}
    37673817
     
    37853835            continue;
    37863836
    3787         ScrollingNodeID parentNodeID = scrollCoordinatedAncestorInParentOfFrame(*child);
    3788         if (!parentNodeID)
     3837        auto parentNodeID = scrollCoordinatedAncestorInParentOfFrame(*child);
     3838        if (!parentNodeID) {
     3839            LOG(Scrolling, "RenderLayerCompositor %p reattachSubframeScrollLayers: failed to find scrolling node parent for frame with nodeID %llu.", this, frameScrollingNodeID);
    37893840            continue;
    3790 
    3791         scrollingCoordinator->insertNode(child->isMainFrame() ? ScrollingNodeType::MainFrame : ScrollingNodeType::Subframe, frameScrollingNodeID, parentNodeID);
     3841        }
     3842
     3843        scrollingCoordinator->insertNode(child->isMainFrame() ? ScrollingNodeType::MainFrame : ScrollingNodeType::Subframe, frameScrollingNodeID, parentNodeID.value());
    37923844    }
    37933845}
     
    38103862}
    38113863
    3812 ScrollingNodeID RenderLayerCompositor::attachScrollingNode(RenderLayer& layer, ScrollingNodeType nodeType, ScrollingNodeID parentNodeID)
     3864ScrollingNodeID RenderLayerCompositor::attachScrollingNode(RenderLayer& layer, ScrollingNodeType nodeType, Optional<ScrollingNodeID> parentNodeID)
    38133865{
    38143866    auto* scrollingCoordinator = this->scrollingCoordinator();
     
    38243876        nodeID = scrollingCoordinator->uniqueScrollingNodeID();
    38253877
    3826     nodeID = scrollingCoordinator->insertNode(nodeType, nodeID, parentNodeID);
     3878    LOG_WITH_STREAM(Scrolling, stream << "RenderLayerCompositor " << this << " attachScrollingNode " << nodeID << " type " << nodeType << " parent " << parentNodeID.valueOr(0));
     3879
     3880    if (nodeType == ScrollingNodeType::Subframe && !parentNodeID)
     3881        nodeID = scrollingCoordinator->createNode(nodeType, nodeID);
     3882    else
     3883        nodeID = scrollingCoordinator->insertNode(nodeType, nodeID, parentNodeID.valueOr(0));
     3884
    38273885    if (!nodeID)
    38283886        return 0;
     
    38303888    backing->setScrollingNodeIDForRole(nodeID, role);
    38313889    m_scrollingNodeToLayerMap.add(nodeID, &layer);
    3832    
     3890
    38333891    return nodeID;
    38343892}
     
    38703928}
    38713929
    3872 void RenderLayerCompositor::updateScrollCoordinationForThisFrame(ScrollingNodeID parentNodeID, OptionSet<ScrollingNodeChangeFlags> changes)
     3930void RenderLayerCompositor::updateScrollCoordinationForThisFrame(Optional<ScrollingNodeID> parentNodeID, OptionSet<ScrollingNodeChangeFlags> changes)
    38733931{
    38743932    auto* scrollingCoordinator = this->scrollingCoordinator();
     
    39083966
    39093967    if (!m_renderView.frame().isMainFrame()) {
    3910         ScrollingNodeID parentDocumentHostingNodeID = scrollCoordinatedAncestorInParentOfFrame(m_renderView.frame());
    3911         if (!parentDocumentHostingNodeID)
    3912             return;
    3913 
     3968        auto parentDocumentHostingNodeID = scrollCoordinatedAncestorInParentOfFrame(m_renderView.frame());
    39143969        updateScrollCoordinationForThisFrame(parentDocumentHostingNodeID, changes);
    39153970        if (!(roles.contains(ScrollCoordinationRole::ViewportConstrained)) && isRenderViewLayer)
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.h

    r240435 r240553  
    273273    static RenderLayerCompositor* frameContentsCompositor(RenderWidget&);
    274274    // Return true if the layers changed.
    275     static bool parentFrameContentLayers(RenderWidget&);
     275    bool parentFrameContentLayers(RenderWidget&);
    276276
    277277    // Update the geometry of the layers used for clipping and scrolling in frames.
     
    327327
    328328    bool useCoordinatedScrollingForLayer(const RenderLayer&) const;
     329    bool isLayerForIFrameWithScrollCoordinatedContents(const RenderLayer&) const;
    329330
    330331    void willRemoveScrollingLayerWithBacking(RenderLayer&, RenderLayerBacking&);
     
    477478    void updateCustomLayersAfterFlush();
    478479
    479     void updateScrollCoordinationForThisFrame(ScrollingNodeID, OptionSet<ScrollingNodeChangeFlags>);
    480     ScrollingNodeID attachScrollingNode(RenderLayer&, ScrollingNodeType, ScrollingNodeID parentNodeID);
     480    void updateScrollCoordinationForThisFrame(Optional<ScrollingNodeID>, OptionSet<ScrollingNodeChangeFlags>);
     481    ScrollingNodeID attachScrollingNode(RenderLayer&, ScrollingNodeType, Optional<ScrollingNodeID> parentNodeID);
    481482    void updateScrollCoordinatedLayer(RenderLayer&, OptionSet<ScrollCoordinationRole>, OptionSet<ScrollingNodeChangeFlags>);
    482483    void detachScrollCoordinatedLayer(RenderLayer&, OptionSet<ScrollCoordinationRole>);
  • trunk/Source/WebCore/testing/Internals.cpp

    r240237 r240553  
    25692569        return Exception { InvalidAccessError };
    25702570
     2571    document->updateLayoutIgnorePendingStylesheets();
     2572
    25712573    Page* page = document->page();
    25722574    if (!page)
  • trunk/Source/WebKit/ChangeLog

    r240552 r240553  
     12019-01-26  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Have composited RenderIFrame layers make FrameHosting scrolling tree nodes to parent the iframe's scrolling node
     4        https://bugs.webkit.org/show_bug.cgi?id=193879
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Need a specialization of dump() for ScrollingStateFrameHostingNode to avoid infinite recursion.
     9
     10        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
     11        (WebKit::dump):
     12
    1132019-01-27  Chris Fleizach  <cfleizach@apple.com>
    214
  • trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp

    r240551 r240553  
    525525        ts.dumpProperty("scrolled-contents-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer()));
    526526}
    527    
     527
     528static void dump(TextStream& ts, const ScrollingStateFrameHostingNode& node, bool changedPropertiesOnly)
     529{
     530}
     531
    528532static void dump(TextStream& ts, const ScrollingStateFrameScrollingNode& node, bool changedPropertiesOnly)
    529533{
Note: See TracChangeset for help on using the changeset viewer.