Changeset 59396 in webkit


Ignore:
Timestamp:
May 13, 2010 4:14:46 PM (14 years ago)
Author:
Simon Fraser
Message:

2010-05-13 Simon Fraser <Simon Fraser>

Reviewed by Dave Hyatt.

Fix scrolling in composited iframes
https://bugs.webkit.org/show_bug.cgi?id=39088
<rdar://problem/7980099>

When propagating compositing out of iframes, we have to update the position of the iframe content
layers on scrolling.

Test: compositing/iframes/scrolling-iframe.html

  • page/FrameView.cpp: (WebCore::FrameView::scrollPositionChanged): Call updateContentLayerScrollPosition() when scrolling.
  • rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): Renamed setRootPlatformLayerClippingBox() to updateContentLayerOffset().
  • rendering/RenderLayerCompositor.h:
  • rendering/RenderLayerCompositor.cpp: Rename m_clippingLayer to m_clipLayer to go better with m_scrollLayer. (WebCore::RenderLayerCompositor::updateContentLayerOffset): Renamed from setRootPlatformLayerClippingBox().

Set the size of the clipping layer from the FrameView now, so that scrollbars are not clipped out.
Update the scroll layer position too.

(WebCore::RenderLayerCompositor::updateContentLayerScrollPosition): Set the position of the scroll layer

when the ScrollView is scrolled.

(WebCore::RenderLayerCompositor::rootPlatformLayer): m_clippingLayer rename.
(WebCore::RenderLayerCompositor::ensureRootPlatformLayer): m_clippingLayer rename. Also create m_scrollLayer at

the same time as the clip layer, and clean it up as necessary.

(WebCore::RenderLayerCompositor::destroyRootPlatformLayer): m_clippingLayer rename, and clean up the m_scrollLayer too.
(WebCore::RenderLayerCompositor::detachRootPlatformLayer): m_clippingLayer rename

Location:
trunk
Files:
2 added
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r59395 r59396  
     12010-05-13  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Reviewed by Dave Hyatt.
     4
     5        Fix scrolling in composited iframes
     6        https://bugs.webkit.org/show_bug.cgi?id=39088
     7        <rdar://problem/7980099>
     8       
     9        Update test results to account for insertion of new scrolling layer, and for
     10        the fix to the clipping layer size.
     11
     12        * compositing/iframes/composited-parent-iframe-expected.txt:
     13        * compositing/iframes/connect-compositing-iframe-delayed-expected.txt:
     14        * compositing/iframes/connect-compositing-iframe-expected.txt:
     15        * compositing/iframes/connect-compositing-iframe2-expected.txt:
     16        * compositing/iframes/connect-compositing-iframe3-expected.txt:
     17        * compositing/iframes/enter-compositing-iframe-expected.txt:
     18        * compositing/iframes/iframe-resize-expected.txt:
     19        * compositing/iframes/overlapped-iframe-expected.txt:
     20        * compositing/iframes/resources/large-composited-subframe.html: Added.
     21        * compositing/iframes/scrolling-iframe-expected.txt: Added.
     22        * compositing/iframes/scrolling-iframe.html: Added.
     23
    1242010-05-13  Martin Robinson  <mrobinson@igalia.com>
    225
  • trunk/LayoutTests/compositing/iframes/composited-parent-iframe-expected.txt

    r59342 r59396  
    4141              (position 35.00 35.00)
    4242              (anchor 0.50 0.50)
    43               (bounds 300.00 150.00)
     43              (bounds 285.00 150.00)
    4444              (opacity 1.00)
    4545              (usingTiledLayer 0)
     
    5454                  (position 0.00 0.00)
    5555                  (anchor 0.50 0.50)
    56                   (bounds 285.00 230.00)
     56                  (bounds 0.00 0.00)
    5757                  (opacity 1.00)
    5858                  (usingTiledLayer 0)
     
    7171                      (usingTiledLayer 0)
    7272                      (preserves3D 0)
    73                       (drawsContent 1)
     73                      (drawsContent 0)
    7474                      (backfaceVisibility visible)
    7575                      (backgroundColor none)
     
    7878                      (children 1
    7979                        (GraphicsLayer
    80                           (position 18.00 10.00)
     80                          (position 0.00 0.00)
    8181                          (anchor 0.50 0.50)
    82                           (bounds 210.00 210.00)
     82                          (bounds 285.00 230.00)
    8383                          (opacity 1.00)
    8484                          (usingTiledLayer 0)
     
    8989                          (transform identity)
    9090                          (childrenTransform identity)
     91                          (children 1
     92                            (GraphicsLayer
     93                              (position 18.00 10.00)
     94                              (anchor 0.50 0.50)
     95                              (bounds 210.00 210.00)
     96                              (opacity 1.00)
     97                              (usingTiledLayer 0)
     98                              (preserves3D 0)
     99                              (drawsContent 1)
     100                              (backfaceVisibility visible)
     101                              (backgroundColor none)
     102                              (transform identity)
     103                              (childrenTransform identity)
     104                            )
     105                          )
    91106                        )
    92107                      )
  • trunk/LayoutTests/compositing/iframes/connect-compositing-iframe-delayed-expected.txt

    r59342 r59396  
    4343              (position 35.00 35.00)
    4444              (anchor 0.50 0.50)
    45               (bounds 300.00 150.00)
     45              (bounds 285.00 150.00)
    4646              (opacity 1.00)
    4747              (usingTiledLayer 0)
     
    5656                  (position 0.00 0.00)
    5757                  (anchor 0.50 0.50)
    58                   (bounds 285.00 230.00)
     58                  (bounds 0.00 0.00)
    5959                  (opacity 1.00)
    6060                  (usingTiledLayer 0)
     
    7373                      (usingTiledLayer 0)
    7474                      (preserves3D 0)
    75                       (drawsContent 1)
     75                      (drawsContent 0)
    7676                      (backfaceVisibility visible)
    7777                      (backgroundColor none)
     
    8080                      (children 1
    8181                        (GraphicsLayer
    82                           (position 18.00 10.00)
     82                          (position 0.00 0.00)
    8383                          (anchor 0.50 0.50)
    84                           (bounds 210.00 210.00)
     84                          (bounds 285.00 230.00)
    8585                          (opacity 1.00)
    8686                          (usingTiledLayer 0)
     
    9191                          (transform identity)
    9292                          (childrenTransform identity)
     93                          (children 1
     94                            (GraphicsLayer
     95                              (position 18.00 10.00)
     96                              (anchor 0.50 0.50)
     97                              (bounds 210.00 210.00)
     98                              (opacity 1.00)
     99                              (usingTiledLayer 0)
     100                              (preserves3D 0)
     101                              (drawsContent 1)
     102                              (backfaceVisibility visible)
     103                              (backgroundColor none)
     104                              (transform identity)
     105                              (childrenTransform identity)
     106                            )
     107                          )
    93108                        )
    94109                      )
  • trunk/LayoutTests/compositing/iframes/connect-compositing-iframe-expected.txt

    r59342 r59396  
    4141              (position 35.00 35.00)
    4242              (anchor 0.50 0.50)
    43               (bounds 300.00 150.00)
     43              (bounds 285.00 150.00)
    4444              (opacity 1.00)
    4545              (usingTiledLayer 0)
     
    5454                  (position 0.00 0.00)
    5555                  (anchor 0.50 0.50)
    56                   (bounds 285.00 230.00)
     56                  (bounds 0.00 0.00)
    5757                  (opacity 1.00)
    5858                  (usingTiledLayer 0)
     
    7171                      (usingTiledLayer 0)
    7272                      (preserves3D 0)
    73                       (drawsContent 1)
     73                      (drawsContent 0)
    7474                      (backfaceVisibility visible)
    7575                      (backgroundColor none)
     
    7878                      (children 1
    7979                        (GraphicsLayer
    80                           (position 18.00 10.00)
     80                          (position 0.00 0.00)
    8181                          (anchor 0.50 0.50)
    82                           (bounds 210.00 210.00)
     82                          (bounds 285.00 230.00)
    8383                          (opacity 1.00)
    8484                          (usingTiledLayer 0)
     
    8989                          (transform identity)
    9090                          (childrenTransform identity)
     91                          (children 1
     92                            (GraphicsLayer
     93                              (position 18.00 10.00)
     94                              (anchor 0.50 0.50)
     95                              (bounds 210.00 210.00)
     96                              (opacity 1.00)
     97                              (usingTiledLayer 0)
     98                              (preserves3D 0)
     99                              (drawsContent 1)
     100                              (backfaceVisibility visible)
     101                              (backgroundColor none)
     102                              (transform identity)
     103                              (childrenTransform identity)
     104                            )
     105                          )
    91106                        )
    92107                      )
  • trunk/LayoutTests/compositing/iframes/connect-compositing-iframe2-expected.txt

    r59342 r59396  
    4141              (position 35.00 35.00)
    4242              (anchor 0.50 0.50)
    43               (bounds 300.00 150.00)
     43              (bounds 285.00 150.00)
    4444              (opacity 1.00)
    4545              (usingTiledLayer 0)
     
    5454                  (position 0.00 0.00)
    5555                  (anchor 0.50 0.50)
    56                   (bounds 285.00 230.00)
     56                  (bounds 0.00 0.00)
    5757                  (opacity 1.00)
    5858                  (usingTiledLayer 0)
     
    7171                      (usingTiledLayer 0)
    7272                      (preserves3D 0)
    73                       (drawsContent 1)
     73                      (drawsContent 0)
    7474                      (backfaceVisibility visible)
    7575                      (backgroundColor none)
     
    7878                      (children 1
    7979                        (GraphicsLayer
    80                           (position 18.00 10.00)
     80                          (position 0.00 0.00)
    8181                          (anchor 0.50 0.50)
    82                           (bounds 210.00 210.00)
     82                          (bounds 285.00 230.00)
    8383                          (opacity 1.00)
    8484                          (usingTiledLayer 0)
     
    8989                          (transform identity)
    9090                          (childrenTransform identity)
     91                          (children 1
     92                            (GraphicsLayer
     93                              (position 18.00 10.00)
     94                              (anchor 0.50 0.50)
     95                              (bounds 210.00 210.00)
     96                              (opacity 1.00)
     97                              (usingTiledLayer 0)
     98                              (preserves3D 0)
     99                              (drawsContent 1)
     100                              (backfaceVisibility visible)
     101                              (backgroundColor none)
     102                              (transform identity)
     103                              (childrenTransform identity)
     104                            )
     105                          )
    91106                        )
    92107                      )
  • trunk/LayoutTests/compositing/iframes/connect-compositing-iframe3-expected.txt

    r59342 r59396  
    4141              (position 35.00 35.00)
    4242              (anchor 0.50 0.50)
    43               (bounds 300.00 150.00)
     43              (bounds 285.00 150.00)
    4444              (opacity 1.00)
    4545              (usingTiledLayer 0)
     
    5454                  (position 0.00 0.00)
    5555                  (anchor 0.50 0.50)
    56                   (bounds 285.00 230.00)
     56                  (bounds 0.00 0.00)
    5757                  (opacity 1.00)
    5858                  (usingTiledLayer 0)
     
    7171                      (usingTiledLayer 0)
    7272                      (preserves3D 0)
    73                       (drawsContent 1)
     73                      (drawsContent 0)
    7474                      (backfaceVisibility visible)
    7575                      (backgroundColor none)
     
    7878                      (children 1
    7979                        (GraphicsLayer
    80                           (position 18.00 10.00)
     80                          (position 0.00 0.00)
    8181                          (anchor 0.50 0.50)
    82                           (bounds 210.00 210.00)
     82                          (bounds 285.00 230.00)
    8383                          (opacity 1.00)
    8484                          (usingTiledLayer 0)
     
    8989                          (transform identity)
    9090                          (childrenTransform identity)
     91                          (children 1
     92                            (GraphicsLayer
     93                              (position 18.00 10.00)
     94                              (anchor 0.50 0.50)
     95                              (bounds 210.00 210.00)
     96                              (opacity 1.00)
     97                              (usingTiledLayer 0)
     98                              (preserves3D 0)
     99                              (drawsContent 1)
     100                              (backfaceVisibility visible)
     101                              (backgroundColor none)
     102                              (transform identity)
     103                              (childrenTransform identity)
     104                            )
     105                          )
    91106                        )
    92107                      )
  • trunk/LayoutTests/compositing/iframes/enter-compositing-iframe-expected.txt

    r59342 r59396  
    4141              (position 35.00 35.00)
    4242              (anchor 0.50 0.50)
    43               (bounds 300.00 150.00)
     43              (bounds 285.00 150.00)
    4444              (opacity 1.00)
    4545              (usingTiledLayer 0)
     
    5454                  (position 0.00 0.00)
    5555                  (anchor 0.50 0.50)
    56                   (bounds 285.00 230.00)
     56                  (bounds 0.00 0.00)
    5757                  (opacity 1.00)
    5858                  (usingTiledLayer 0)
     
    7171                      (usingTiledLayer 0)
    7272                      (preserves3D 0)
    73                       (drawsContent 1)
     73                      (drawsContent 0)
    7474                      (backfaceVisibility visible)
    7575                      (backgroundColor none)
     
    7878                      (children 1
    7979                        (GraphicsLayer
    80                           (position 18.00 10.00)
     80                          (position 0.00 0.00)
    8181                          (anchor 0.50 0.50)
    82                           (bounds 210.00 210.00)
     82                          (bounds 285.00 230.00)
    8383                          (opacity 1.00)
    8484                          (usingTiledLayer 0)
     
    8989                          (transform identity)
    9090                          (childrenTransform identity)
     91                          (children 1
     92                            (GraphicsLayer
     93                              (position 18.00 10.00)
     94                              (anchor 0.50 0.50)
     95                              (bounds 210.00 210.00)
     96                              (opacity 1.00)
     97                              (usingTiledLayer 0)
     98                              (preserves3D 0)
     99                              (drawsContent 1)
     100                              (backfaceVisibility visible)
     101                              (backgroundColor none)
     102                              (transform identity)
     103                              (childrenTransform identity)
     104                            )
     105                          )
    91106                        )
    92107                      )
  • trunk/LayoutTests/compositing/iframes/iframe-resize-expected.txt

    r59342 r59396  
    4141              (position 35.00 35.00)
    4242              (anchor 0.50 0.50)
    43               (bounds 300.00 150.00)
     43              (bounds 285.00 150.00)
    4444              (opacity 1.00)
    4545              (usingTiledLayer 0)
     
    5454                  (position 0.00 0.00)
    5555                  (anchor 0.50 0.50)
    56                   (bounds 285.00 230.00)
     56                  (bounds 0.00 0.00)
    5757                  (opacity 1.00)
    5858                  (usingTiledLayer 0)
     
    7171                      (usingTiledLayer 0)
    7272                      (preserves3D 0)
    73                       (drawsContent 1)
     73                      (drawsContent 0)
    7474                      (backfaceVisibility visible)
    7575                      (backgroundColor none)
     
    7878                      (children 1
    7979                        (GraphicsLayer
    80                           (position 18.00 10.00)
     80                          (position 0.00 0.00)
    8181                          (anchor 0.50 0.50)
    82                           (bounds 210.00 210.00)
     82                          (bounds 285.00 230.00)
    8383                          (opacity 1.00)
    8484                          (usingTiledLayer 0)
     
    8989                          (transform identity)
    9090                          (childrenTransform identity)
     91                          (children 1
     92                            (GraphicsLayer
     93                              (position 18.00 10.00)
     94                              (anchor 0.50 0.50)
     95                              (bounds 210.00 210.00)
     96                              (opacity 1.00)
     97                              (usingTiledLayer 0)
     98                              (preserves3D 0)
     99                              (drawsContent 1)
     100                              (backfaceVisibility visible)
     101                              (backgroundColor none)
     102                              (transform identity)
     103                              (childrenTransform identity)
     104                            )
     105                          )
    91106                        )
    92107                      )
  • trunk/LayoutTests/compositing/iframes/overlapped-iframe-expected.txt

    r59342 r59396  
    4141              (position 35.00 35.00)
    4242              (anchor 0.50 0.50)
    43               (bounds 300.00 150.00)
     43              (bounds 285.00 150.00)
    4444              (opacity 1.00)
    4545              (usingTiledLayer 0)
     
    5454                  (position 0.00 0.00)
    5555                  (anchor 0.50 0.50)
    56                   (bounds 285.00 230.00)
     56                  (bounds 0.00 0.00)
    5757                  (opacity 1.00)
    5858                  (usingTiledLayer 0)
     
    7171                      (usingTiledLayer 0)
    7272                      (preserves3D 0)
    73                       (drawsContent 1)
     73                      (drawsContent 0)
    7474                      (backfaceVisibility visible)
    7575                      (backgroundColor none)
     
    7878                      (children 1
    7979                        (GraphicsLayer
    80                           (position 18.00 10.00)
     80                          (position 0.00 0.00)
    8181                          (anchor 0.50 0.50)
    82                           (bounds 210.00 210.00)
     82                          (bounds 285.00 230.00)
    8383                          (opacity 1.00)
    8484                          (usingTiledLayer 0)
     
    8989                          (transform identity)
    9090                          (childrenTransform identity)
     91                          (children 1
     92                            (GraphicsLayer
     93                              (position 18.00 10.00)
     94                              (anchor 0.50 0.50)
     95                              (bounds 210.00 210.00)
     96                              (opacity 1.00)
     97                              (usingTiledLayer 0)
     98                              (preserves3D 0)
     99                              (drawsContent 1)
     100                              (backfaceVisibility visible)
     101                              (backgroundColor none)
     102                              (transform identity)
     103                              (childrenTransform identity)
     104                            )
     105                          )
    91106                        )
    92107                      )
  • trunk/LayoutTests/compositing/iframes/scrolling-iframe-expected.txt

    r59395 r59396  
    4141              (position 35.00 35.00)
    4242              (anchor 0.50 0.50)
    43               (bounds 300.00 150.00)
     43              (bounds 285.00 135.00)
    4444              (opacity 1.00)
    4545              (usingTiledLayer 0)
     
    5252              (children 1
    5353                (GraphicsLayer
    54                   (position 0.00 0.00)
     54                  (position -80.00 -80.00)
    5555                  (anchor 0.50 0.50)
    56                   (bounds 285.00 230.00)
     56                  (bounds 0.00 0.00)
    5757                  (opacity 1.00)
    5858                  (usingTiledLayer 0)
     
    6767                      (position 0.00 0.00)
    6868                      (anchor 0.50 0.50)
    69                       (bounds 285.00 230.00)
     69                      (bounds 508.00 608.00)
    7070                      (opacity 1.00)
    7171                      (usingTiledLayer 0)
    7272                      (preserves3D 0)
    73                       (drawsContent 1)
     73                      (drawsContent 0)
    7474                      (backfaceVisibility visible)
    7575                      (backgroundColor none)
     
    7878                      (children 1
    7979                        (GraphicsLayer
    80                           (position 18.00 10.00)
     80                          (position 0.00 0.00)
    8181                          (anchor 0.50 0.50)
    82                           (bounds 210.00 210.00)
     82                          (bounds 508.00 608.00)
    8383                          (opacity 1.00)
    8484                          (usingTiledLayer 0)
     
    8989                          (transform identity)
    9090                          (childrenTransform identity)
     91                          (children 1
     92                            (GraphicsLayer
     93                              (position 108.00 100.00)
     94                              (anchor 0.50 0.50)
     95                              (bounds 200.00 200.00)
     96                              (opacity 1.00)
     97                              (usingTiledLayer 0)
     98                              (preserves3D 0)
     99                              (drawsContent 1)
     100                              (backfaceVisibility visible)
     101                              (backgroundColor none)
     102                              (transform identity)
     103                              (childrenTransform identity)
     104                            )
     105                          )
    91106                        )
    92107                      )
  • trunk/WebCore/ChangeLog

    r59394 r59396  
     12010-05-13  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Reviewed by Dave Hyatt.
     4
     5        Fix scrolling in composited iframes
     6        https://bugs.webkit.org/show_bug.cgi?id=39088
     7        <rdar://problem/7980099>
     8       
     9        When propagating compositing out of iframes, we have to update the position of the iframe content
     10        layers on scrolling.
     11
     12        Test: compositing/iframes/scrolling-iframe.html
     13
     14        * page/FrameView.cpp:
     15        (WebCore::FrameView::scrollPositionChanged): Call updateContentLayerScrollPosition() when scrolling.
     16
     17        * rendering/RenderLayerBacking.cpp:
     18        (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): Renamed setRootPlatformLayerClippingBox() to updateContentLayerOffset().
     19
     20        * rendering/RenderLayerCompositor.h:
     21        * rendering/RenderLayerCompositor.cpp: Rename m_clippingLayer to m_clipLayer to go better with m_scrollLayer.
     22        (WebCore::RenderLayerCompositor::updateContentLayerOffset): Renamed from setRootPlatformLayerClippingBox().
     23            Set the size of the clipping layer from the FrameView now, so that scrollbars are not clipped out.
     24            Update the scroll layer position too.
     25        (WebCore::RenderLayerCompositor::updateContentLayerScrollPosition): Set the position of the scroll layer
     26            when the ScrollView is scrolled.
     27        (WebCore::RenderLayerCompositor::rootPlatformLayer): m_clippingLayer rename.
     28        (WebCore::RenderLayerCompositor::ensureRootPlatformLayer): m_clippingLayer rename. Also create m_scrollLayer at
     29            the same time as the clip layer, and clean it up as necessary.
     30        (WebCore::RenderLayerCompositor::destroyRootPlatformLayer): m_clippingLayer rename, and clean up the m_scrollLayer too.
     31        (WebCore::RenderLayerCompositor::detachRootPlatformLayer): m_clippingLayer rename
     32
    1332010-05-13  Sam Weinig  <sam@webkit.org>
    234
  • trunk/WebCore/page/FrameView.cpp

    r59338 r59396  
    10481048        }
    10491049    }
     1050
     1051#if USE(ACCELERATED_COMPOSITING)
     1052    if (RenderView* root = m_frame->contentRenderer()) {
     1053        if (root->usesCompositing())
     1054            root->compositor()->updateContentLayerScrollPosition(scrollPosition());
     1055    }
     1056#endif
    10501057}
    10511058
  • trunk/WebCore/rendering/RenderLayerBacking.cpp

    r59136 r59396  
    394394    if (renderer()->isRenderIFrame()) {
    395395        if (RenderLayerCompositor* innerCompositor = RenderLayerCompositor::iframeContentsCompositor(toRenderIFrame(renderer())))
    396             innerCompositor->setRootPlatformLayerClippingBox(contentsBox());
     396            innerCompositor->updateContentLayerOffset(contentsBox().location());
    397397    }
    398398}
  • trunk/WebCore/rendering/RenderLayerCompositor.cpp

    r59338 r59396  
    775775}
    776776
    777 void RenderLayerCompositor::setRootPlatformLayerClippingBox(const IntRect& contentsBox)
    778 {
    779     if (m_clippingLayer) {
    780         m_clippingLayer->setPosition(FloatPoint(contentsBox.x(), contentsBox.y()));
    781         m_clippingLayer->setSize(FloatSize(contentsBox.width(), contentsBox.height()));
    782     }
     777void RenderLayerCompositor::updateContentLayerOffset(const IntPoint& contentsOffset)
     778{
     779    if (m_clipLayer) {
     780        FrameView* frameView = m_renderView->frameView();
     781        m_clipLayer->setPosition(contentsOffset);
     782        m_clipLayer->setSize(FloatSize(frameView->layoutWidth(), frameView->layoutHeight()));
     783
     784        IntPoint scrollPosition = frameView->scrollPosition();
     785        m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y()));
     786    }
     787}
     788
     789void RenderLayerCompositor::updateContentLayerScrollPosition(const IntPoint& scrollPosition)
     790{
     791    if (m_scrollLayer)
     792        m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y()));
    783793}
    784794
     
    966976GraphicsLayer* RenderLayerCompositor::rootPlatformLayer() const
    967977{
    968     return m_clippingLayer ? m_clippingLayer.get() : m_rootPlatformLayer.get();
     978    return m_clipLayer ? m_clipLayer.get() : m_rootPlatformLayer.get();
    969979}
    970980
     
    12381248   
    12391249    if (expectedAttachment == RootLayerAttachedViaEnclosingIframe) {
    1240         if (!m_clippingLayer) {
     1250        if (!m_clipLayer) {
     1251            ASSERT(!m_scrollLayer);
    12411252            // Create a clipping layer if this is an iframe
    1242             m_clippingLayer = GraphicsLayer::create(0);
     1253            m_clipLayer = GraphicsLayer::create(0);
    12431254#ifndef NDEBUG
    1244             m_clippingLayer->setName("iframe Clipping");
    1245 #endif
    1246             m_clippingLayer->setMasksToBounds(true);
    1247             m_clippingLayer->addChild(m_rootPlatformLayer.get());
    1248         }
    1249     } else if (m_clippingLayer) {
    1250         m_clippingLayer->removeAllChildren();
    1251         m_clippingLayer->removeFromParent();
    1252         m_clippingLayer = 0;
     1255            m_clipLayer->setName("iframe Clipping");
     1256#endif
     1257            m_clipLayer->setMasksToBounds(true);
     1258           
     1259            m_scrollLayer = GraphicsLayer::create(0);
     1260#ifndef NDEBUG
     1261            m_scrollLayer->setName("iframe scrolling");
     1262#endif
     1263            // Hook them up
     1264            m_clipLayer->addChild(m_scrollLayer.get());
     1265            m_scrollLayer->addChild(m_rootPlatformLayer.get());
     1266           
     1267            updateContentLayerScrollPosition(m_renderView->frameView()->scrollPosition());
     1268        }
     1269    } else if (m_clipLayer) {
     1270        m_clipLayer->removeAllChildren();
     1271        m_clipLayer->removeFromParent();
     1272        m_clipLayer = 0;
     1273       
     1274        m_scrollLayer->removeAllChildren();
     1275        m_scrollLayer = 0;
    12531276    }
    12541277
     
    12661289
    12671290    detachRootPlatformLayer();
    1268     if (m_clippingLayer) {
    1269         m_clippingLayer->removeAllChildren();
    1270         m_clippingLayer = 0;
    1271     }
     1291    if (m_clipLayer) {
     1292        m_clipLayer->removeAllChildren();
     1293        m_clipLayer = 0;
     1294       
     1295        m_scrollLayer->removeAllChildren();
     1296        m_scrollLayer = 0;
     1297    }
     1298    ASSERT(!m_scrollLayer);
    12721299    m_rootPlatformLayer = 0;
    12731300}
     
    13121339            // The layer will get unhooked up via RenderLayerBacking::updateGraphicsLayerConfiguration()
    13131340            // for the iframe's renderer in the parent document.
    1314             if (m_clippingLayer)
    1315                 m_clippingLayer->removeFromParent();
     1341            if (m_clipLayer)
     1342                m_clipLayer->removeFromParent();
    13161343            else
    13171344                m_rootPlatformLayer->removeFromParent();
  • trunk/WebCore/rendering/RenderLayerCompositor.h

    r59338 r59396  
    157157    static bool parentIFrameContentLayers(RenderIFrame*);
    158158
    159     void setRootPlatformLayerClippingBox(const IntRect& contentsBox);
     159    // Update the geometry of the layers used for clipping and scrolling in frames.
     160    void updateContentLayerOffset(const IntPoint& contentsOffset);
     161    void updateContentLayerScrollPosition(const IntPoint&);
    160162
    161163private:
     
    224226
    225227    // Enclosing clipping layer for iframe content
    226     OwnPtr<GraphicsLayer> m_clippingLayer;
     228    OwnPtr<GraphicsLayer> m_clipLayer;
     229    OwnPtr<GraphicsLayer> m_scrollLayer;
    227230   
    228231#if PROFILE_LAYER_REBUILD
Note: See TracChangeset for help on using the changeset viewer.