Layer with no backing store should still hit-test over a scroller
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Mar 2019 11:07:42 +0000 (11:07 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Mar 2019 11:07:42 +0000 (11:07 +0000)
commite7e018c126de6b443e38bc9faf49001d864b00b2
tree710417c9dd569d2cd57b21e759d8d7b468367803
parent70bab3a388e8b697123fb52734f61683c7332325
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@243134 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