Implement coordinated scrollbar for subframes and overflow:scroll
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Feb 2013 09:13:32 +0000 (09:13 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Feb 2013 09:13:32 +0000 (09:13 +0000)
commit80dbd5d1d562259715e20025bf46d72b6e4db270
treee7af36cec8e726d51ef367615f88af09b8416deb
parenta18312a83558f416ba2bdf746dccc62423608f81
Implement coordinated scrollbar for subframes and overflow:scroll
https://bugs.webkit.org/show_bug.cgi?id=109560

Patch by Tien-Ren Chen <trchen@chromium.org> on 2013-02-26
Reviewed by James Robinson.

Source/WebCore:

This patch obsoletes ScrollingCoordinatorPrivate for the Chromium
implementation. Also removes the concept of a single main scrolling
layer. Should use HashMap to keep track resources for multiple
scrollable objects.

Many of the callbacks are extended to support ScrollableArea instead
of just FrameView. Now ScrollingCoordinatorChromium coordinates
scrollbars for both subframes and overflow:scroll.

Some drive-by change:
1. Remove the GraphicsLayer parameter for layer change callbacks.
   Should be able to get the latest layer from the ScrollableArea anyway.
2. Should start from main frame document when updating touch event target rects.

New chromium test: ScrollingCoordinatorChromiumTest.iframeScrolling

* page/Frame.cpp:
(WebCore::Frame::willDetachPage):
* page/FrameView.cpp:
(WebCore::FrameView::prepareForDetach):
(WebCore::FrameView::layerForScrolling):
(WebCore):
* page/FrameView.h:
(FrameView):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::scrollLayerForScrollableArea):
(WebCore):
(WebCore::ScrollingCoordinator::horizontalScrollbarLayerForScrollableArea):
(WebCore::ScrollingCoordinator::verticalScrollbarLayerForScrollableArea):
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::willDestroyScrollableArea):
(WebCore::ScrollingCoordinator::scrollableAreaScrollLayerDidChange):
(WebCore::ScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
(ScrollingCoordinator):
* page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
(WebCore::scrollingWebLayerForGraphicsLayer):
(WebCore::ScrollingCoordinatorChromium::scrollingWebLayerForScrollableArea):
(WebCore::ScrollingCoordinatorChromium::ScrollingCoordinatorChromium):
(WebCore::ScrollingCoordinatorChromium::~ScrollingCoordinatorChromium):
(WebCore::ScrollingCoordinatorChromium::frameViewLayoutUpdated):
(WebCore::ScrollingCoordinatorChromium::touchEventTargetRectsDidChange):
(WebCore::createScrollbarLayer):
(WebCore::detachScrollbarLayer):
(WebCore::setupScrollbarLayer):
(WebCore::ScrollingCoordinatorChromium::willDestroyScrollableArea):
(WebCore::ScrollingCoordinatorChromium::scrollableAreaScrollbarLayerDidChange):
(WebCore::ScrollingCoordinatorChromium::setNonFastScrollableRegion):
(WebCore::ScrollingCoordinatorChromium::setTouchEventTargetRects):
(WebCore::ScrollingCoordinatorChromium::setWheelEventHandlerCount):
(WebCore::ScrollingCoordinatorChromium::setShouldUpdateScrollLayerPositionOnMainThread):
(WebCore::ScrollingCoordinatorChromium::setLayerIsContainerForFixedPositionLayers):
(WebCore::ScrollingCoordinatorChromium::setLayerIsFixedToContainerLayer):
(WebCore::ScrollingCoordinatorChromium::scrollableAreaScrollLayerDidChange):
(WebCore::ScrollingCoordinatorChromium::addWebScrollbarLayer):
(WebCore):
(WebCore::ScrollingCoordinatorChromium::getWebScrollbarLayer):
(WebCore::ScrollingCoordinatorChromium::removeWebScrollbarLayer):
* page/scrolling/chromium/ScrollingCoordinatorChromium.h:
(WebCore):
(ScrollingCoordinatorChromium):
* page/scrolling/mac/ScrollingCoordinatorMac.h:
(ScrollingCoordinatorMac):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::scrollableAreaScrollbarLayerDidChange):
* platform/ScrollableArea.h:
(ScrollableArea):
(WebCore::ScrollableArea::layerForScrolling):
* platform/graphics/GraphicsLayer.h:
(GraphicsLayer):
(WebCore::GraphicsLayer::setContentsToPlatformLayer):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::~RenderLayer):
(WebCore::RenderLayer::layerForScrolling):
(WebCore):
* rendering/RenderLayer.h:
(RenderLayer):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateOverflowControlsLayers):
(WebCore::RenderLayerBacking::positionOverflowControlsLayers):
(WebCore::RenderLayerBacking::updateScrollingLayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::frameViewDidScroll):
(WebCore::RenderLayerCompositor::scrollingLayerDidChange):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):

Source/WebKit/chromium:

Added ScrollingCoordinatorChromiumTest.iframeScrolling to verify
impl-side scrolling and impl-side scrollbars for frames.

Update ScrollingCoordinatorChromiumTest.overflowScrolling to verify
impl-side scrollbars.

* tests/ScrollingCoordinatorChromiumTest.cpp:
(WebKit::ScrollingCoordinatorChromiumTest::ScrollingCoordinatorChromiumTest):
(WebKit::TEST_F):
(WebKit):
* tests/data/iframe-scrolling-inner.html: Added.
* tests/data/iframe-scrolling.html: Added.

LayoutTests:

Coordinated scrollbars changes drawsContent flag on scrollbar GraphicsLayers,
test expectation are updated.

* platform/chromium-linux/compositing/iframes/become-overlapped-iframe-expected.txt: Added.
* platform/chromium-linux/compositing/iframes/composited-parent-iframe-expected.txt: Added.
* platform/chromium-linux/compositing/iframes/connect-compositing-iframe-delayed-expected.txt: Added.
* platform/chromium-linux/compositing/iframes/connect-compositing-iframe-expected.txt: Added.
* platform/chromium-linux/compositing/iframes/connect-compositing-iframe2-expected.txt: Added.
* platform/chromium-linux/compositing/iframes/connect-compositing-iframe3-expected.txt: Added.
* platform/chromium-linux/compositing/iframes/enter-compositing-iframe-expected.txt: Added.
* platform/chromium-linux/compositing/iframes/iframe-resize-expected.txt: Added.
* platform/chromium-linux/compositing/iframes/iframe-size-from-zero-expected.txt: Added.
* platform/chromium-linux/compositing/iframes/invisible-nested-iframe-show-expected.txt: Added.
* platform/chromium-linux/compositing/iframes/overlapped-iframe-expected.txt: Added.
* platform/chromium-linux/compositing/iframes/resizer-expected.txt: Added.
* platform/chromium-linux/compositing/iframes/scrolling-iframe-expected.txt: Added.
* platform/chromium-linux/compositing/overflow/composited-scrolling-creates-a-stacking-container-expected.txt: Copied from LayoutTests/platform/chromium-linux/compositing/overflow/scrolling-without-painting-expected.txt.
* platform/chromium-linux/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt: Copied from LayoutTests/platform/chromium-linux/compositing/overflow/scrolling-without-painting-expected.txt.
* platform/chromium-linux/compositing/overflow/scrolling-without-painting-expected.txt:
* platform/chromium-linux/compositing/overflow/textarea-scroll-touch-expected.txt: Added.
* platform/chromium-linux/compositing/overflow/updating-scrolling-content-expected.txt:
* platform/chromium-linux/compositing/rtl/rtl-iframe-absolute-overflow-expected.txt: Added.
* platform/chromium-linux/compositing/rtl/rtl-iframe-absolute-overflow-scrolled-expected.txt: Added.
* platform/chromium-linux/compositing/rtl/rtl-iframe-fixed-overflow-expected.txt: Added.
* platform/chromium-linux/compositing/rtl/rtl-iframe-fixed-overflow-scrolled-expected.txt: Added.
* platform/chromium-linux/platform/chromium/compositing/force-compositing-mode/overflow-iframe-enter-compositing-expected.txt: Added.
* platform/chromium-linux/platform/chromium/virtual/gpu/compositedscrolling/overflow/composited-scrolling-creates-a-stacking-container-expected.txt: Copied from LayoutTests/platform/chromium-linux/compositing/overflow/scrolling-without-painting-expected.txt.
* platform/chromium-linux/platform/chromium/virtual/gpu/compositedscrolling/overflow/overflow-auto-with-touch-expected.txt: Copied from LayoutTests/platform/chromium-linux/compositing/overflow/scrolling-without-painting-expected.txt.
* platform/chromium-linux/platform/chromium/virtual/gpu/compositedscrolling/overflow/overflow-auto-with-touch-toggle-expected.txt: Copied from LayoutTests/platform/chromium-linux/compositing/overflow/scrolling-without-painting-expected.txt.
* platform/chromium-linux/platform/chromium/virtual/gpu/compositedscrolling/overflow/overflow-overlay-with-touch-expected.txt: Copied from LayoutTests/platform/chromium-linux/compositing/overflow/scrolling-without-painting-expected.txt.
* platform/chromium-linux/platform/chromium/virtual/gpu/compositedscrolling/overflow/scrolling-content-clip-to-viewport-expected.txt: Copied from LayoutTests/platform/chromium-linux/compositing/overflow/scrolling-without-painting-expected.txt.
* platform/chromium-linux/platform/chromium/virtual/gpu/compositedscrolling/overflow/scrolling-without-painting-expected.txt:
* platform/chromium-linux/platform/chromium/virtual/gpu/compositedscrolling/overflow/textarea-scroll-touch-expected.txt: Added.
* platform/chromium-linux/platform/chromium/virtual/gpu/compositedscrolling/overflow/updating-scrolling-content-expected.txt:
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/become-overlapped-iframe-expected.txt: Added.
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/composited-parent-iframe-expected.txt: Added.
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/connect-compositing-iframe-delayed-expected.txt: Added.
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/connect-compositing-iframe-expected.txt: Added.
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/connect-compositing-iframe2-expected.txt: Added.
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/connect-compositing-iframe3-expected.txt: Added.
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/enter-compositing-iframe-expected.txt: Added.
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/iframe-resize-expected.txt: Added.
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/iframe-size-from-zero-expected.txt: Added.
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/invisible-nested-iframe-show-expected.txt: Added.
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/overlapped-iframe-expected.txt: Added.
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/resizer-expected.txt: Added.
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/scrolling-iframe-expected.txt: Added.
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/overflow/composited-scrolling-creates-a-stacking-container-expected.txt: Copied from LayoutTests/platform/chromium-linux/compositing/overflow/scrolling-without-painting-expected.txt.
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/overflow/scrolling-content-clip-to-viewport-expected.txt: Copied from LayoutTests/platform/chromium-linux/compositing/overflow/scrolling-without-painting-expected.txt.
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/overflow/scrolling-without-painting-expected.txt:
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/overflow/textarea-scroll-touch-expected.txt: Added.
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/overflow/updating-scrolling-content-expected.txt:
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/rtl/rtl-iframe-absolute-overflow-expected.txt: Added.
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/rtl/rtl-iframe-absolute-overflow-scrolled-expected.txt: Added.
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/rtl/rtl-iframe-fixed-overflow-expected.txt: Added.
* platform/chromium-linux/platform/chromium/virtual/softwarecompositing/rtl/rtl-iframe-fixed-overflow-scrolled-expected.txt: Added.
* platform/chromium/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144024 268f45cc-cd09-0410-ab3c-d52691b4dbfc
75 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/chromium-linux/compositing/iframes/become-overlapped-iframe-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/compositing/iframes/composited-parent-iframe-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/compositing/iframes/connect-compositing-iframe-delayed-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/compositing/iframes/connect-compositing-iframe-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/compositing/iframes/connect-compositing-iframe2-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/compositing/iframes/connect-compositing-iframe3-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/compositing/iframes/enter-compositing-iframe-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/compositing/iframes/iframe-resize-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/compositing/iframes/iframe-size-from-zero-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/compositing/iframes/invisible-nested-iframe-show-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/compositing/iframes/overlapped-iframe-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/compositing/iframes/resizer-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/compositing/iframes/scrolling-iframe-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/compositing/overflow/composited-scrolling-creates-a-stacking-container-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/compositing/overflow/scrolling-without-painting-expected.txt
LayoutTests/platform/chromium-linux/compositing/overflow/textarea-scroll-touch-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/compositing/overflow/updating-scrolling-content-expected.txt
LayoutTests/platform/chromium-linux/compositing/rtl/rtl-iframe-absolute-overflow-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/compositing/rtl/rtl-iframe-absolute-overflow-scrolled-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/compositing/rtl/rtl-iframe-fixed-overflow-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/compositing/rtl/rtl-iframe-fixed-overflow-scrolled-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/compositing/force-compositing-mode/overflow-iframe-enter-compositing-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/gpu/compositedscrolling/overflow/composited-scrolling-creates-a-stacking-container-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/gpu/compositedscrolling/overflow/overflow-auto-with-touch-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/gpu/compositedscrolling/overflow/overflow-auto-with-touch-toggle-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/gpu/compositedscrolling/overflow/overflow-overlay-with-touch-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/gpu/compositedscrolling/overflow/scrolling-content-clip-to-viewport-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/gpu/compositedscrolling/overflow/scrolling-without-painting-expected.txt
LayoutTests/platform/chromium-linux/platform/chromium/virtual/gpu/compositedscrolling/overflow/textarea-scroll-touch-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/gpu/compositedscrolling/overflow/updating-scrolling-content-expected.txt
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/become-overlapped-iframe-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/composited-parent-iframe-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/connect-compositing-iframe-delayed-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/connect-compositing-iframe-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/connect-compositing-iframe2-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/connect-compositing-iframe3-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/enter-compositing-iframe-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/iframe-resize-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/iframe-size-from-zero-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/invisible-nested-iframe-show-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/overlapped-iframe-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/resizer-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/iframes/scrolling-iframe-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/overflow/composited-scrolling-creates-a-stacking-container-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/overflow/scrolling-content-clip-to-viewport-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/overflow/scrolling-without-painting-expected.txt
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/overflow/textarea-scroll-touch-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/overflow/updating-scrolling-content-expected.txt
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/rtl/rtl-iframe-absolute-overflow-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/rtl/rtl-iframe-absolute-overflow-scrolled-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/rtl/rtl-iframe-fixed-overflow-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/platform/chromium/virtual/softwarecompositing/rtl/rtl-iframe-fixed-overflow-scrolled-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/page/Frame.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
Source/WebCore/page/scrolling/ScrollingCoordinator.h
Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp
Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.h
Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h
Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
Source/WebCore/platform/ScrollableArea.h
Source/WebCore/platform/graphics/GraphicsLayer.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/ScrollingCoordinatorChromiumTest.cpp
Source/WebKit/chromium/tests/data/iframe-scrolling-inner.html [new file with mode: 0644]
Source/WebKit/chromium/tests/data/iframe-scrolling.html [new file with mode: 0644]