[iOS WK2] Don't create backing store for -webkit-overflow-scrolling:touch that can...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 May 2014 21:24:54 +0000 (21:24 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 May 2014 21:24:54 +0000 (21:24 +0000)
commita14824e07d9bfbd92c6e811c737c54bd1904cd84
tree9edd4e6c730266e33cd29a265afe459f36bd59df
parent5555edb8c8e575d78ce42383464c8b08f7be1998
[iOS WK2] Don't create backing store for -webkit-overflow-scrolling:touch that can't scroll
https://bugs.webkit.org/show_bug.cgi?id=132487
<rdar://problem/16758041>

Reviewed by Sam Weinig.

Source/WebCore:

Previously, -webkit-overflow-scrolling:touch would cause us to make compositing
layers for any element that had overflow: auto or scroll on either axis. This
created lots of backing store when not required.

Improve this to only create compositing for scrolling when there is actually
scrollable overflow. This makes things slightly more complex, because we can
only know when layout is up to date.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeRectForRepaint): usesCompositedScrolling() tells
us if we're actually doing composited overflow.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::hasTouchScrollableOverflow):
(WebCore::RenderLayer::handleTouchEvent):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling):
(WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration): Only update
scrolling and clipping layers if layout is not pending.
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
(WebCore::RenderLayerBacking::updateScrollingLayers): The caller calls
updateInternalHierarchy(), so no need to do it here.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForScrolling): We
can only determine that we're scrollable after layout.
(WebCore::isStickyInAcceleratedScrollingLayerOrViewport):
(WebCore::isMainFrameScrollingOrOverflowScrolling):

LayoutTests:

These are all progressions, and show that we make layers in fewer cases.

* platform/ios-sim/compositing/overflow/iframe-inside-overflow-clipping-expected.txt:
* platform/ios-sim/compositing/overflow/overflow-auto-with-touch-no-overflow-expected.txt:
* platform/ios-sim/compositing/overflow/overflow-overlay-with-touch-no-overflow-expected.txt:
* platform/ios-sim/compositing/overflow/overflow-scroll-with-touch-no-overflow-expected.txt:
* platform/ios-sim/compositing/overflow/subpixel-overflow-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168190 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/ios-sim/compositing/overflow/iframe-inside-overflow-clipping-expected.txt
LayoutTests/platform/ios-sim/compositing/overflow/overflow-auto-with-touch-no-overflow-expected.txt
LayoutTests/platform/ios-sim/compositing/overflow/overflow-overlay-with-touch-no-overflow-expected.txt
LayoutTests/platform/ios-sim/compositing/overflow/overflow-scroll-with-touch-no-overflow-expected.txt
LayoutTests/platform/ios-sim/compositing/overflow/subpixel-overflow-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp