Layer with no backing store should still hit-test over a scroller
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Mar 2019 19:42:57 +0000 (19:42 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Mar 2019 19:42:57 +0000 (19:42 +0000)
commitef2fbd8d305b3d75615782e21e2a5e5ffe94f904
tree40705cd39c7b1d22c91e62b2e5e6c516dd189ef6
parentdea929bdb6dacc7b5b82ba6ee48d7ecef44b770d
Layer with no backing store should still hit-test over a scroller
https://bugs.webkit.org/show_bug.cgi?id=195378
<rdar://problem/48652078>

Reviewed by Simon Fraser.

Source/WebCore:

Tests: fast/scrolling/ios/overflow-scroll-overlap-3.html
       fast/scrolling/ios/overflow-scroll-overlap-4.html

Move collecting event region from paint to compositing update time.
This solves a number of problems including regions for non-painting layers.

* platform/graphics/GraphicsLayer.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):

Use the existing visibleToHitTesting() helper.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):

Use flag for event region collecting, don't paint content.

(WebCore::RenderLayer::paintList):

We can bail out immediately if there is no overflow.

(WebCore::RenderLayer::paintForegroundForFragments):
(WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
(WebCore::RenderLayer::collectEventRegionForFragments):

Move to a separate function.

* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):

Update event region on backing configuration update. This is called after anything interesting changes on a sublayer.

(WebCore::RenderLayerBacking::updateEventRegion):
(WebCore::RenderLayerBacking::paintIntoLayer):
* rendering/RenderLayerBacking.h:

Source/WebKit:

* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::makeNode):
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(WebKit::collectDescendantViewsAtPoint):

No need for special WKTiledBackingView, tiled views now have correct event regions.

LayoutTests:

Reorganize the tests a bit and add some new ones.

* fast/scrolling/ios/overflow-scroll-overlap-2-expected.txt:
* fast/scrolling/ios/overflow-scroll-overlap-2.html:
* fast/scrolling/ios/overflow-scroll-overlap-3-expected.txt: Added.
* fast/scrolling/ios/overflow-scroll-overlap-3.html: Added.
* fast/scrolling/ios/overflow-scroll-overlap-4-expected.txt: Added.
* fast/scrolling/ios/overflow-scroll-overlap-4.html: Added.
* fast/scrolling/ios/overflow-scroll-overlap.html:
* fast/scrolling/resources/overflow-scroll-overlap.js: Added.
(sleep):
(async.runTest):
(logScroll):
(outputCase):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243092 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-2-expected.txt
LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-2.html
LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-3-expected.txt [new file with mode: 0644]
LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-3.html [new file with mode: 0644]
LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-4-expected.txt [new file with mode: 0644]
LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-4.html [new file with mode: 0644]
LayoutTests/fast/scrolling/ios/overflow-scroll-overlap.html
LayoutTests/fast/scrolling/resources/overflow-scroll-overlap.js [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/GraphicsLayer.h
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm