UIWebView is not rendering content that comes on screen during overflow scroll
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Nov 2017 21:41:12 +0000 (21:41 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Nov 2017 21:41:12 +0000 (21:41 +0000)
commite171a3295691dc88590a87f0dc1b4d4f1f46554e
treeb3d9ee9939b05a6b6cf8f892b668ef778b5b19ad
parentfc5cb1b4be1b8a03ecb8a54b91846ccf6f68421b
UIWebView is not rendering content that comes on screen during overflow scroll
https://bugs.webkit.org/show_bug.cgi?id=179277
rdar://problem/34272949

Reviewed by Tim Horton

When page or overflow scrolling happens, we do a traversal of GraphicsLayers to determine
whether the exposed part of tiled layers changed in a way that requires a change in the tile
coverage. If so, we schedule a compositing layer flush.

There was no equivalent logic for computing whether the "backing store detached" state
of a layer changed (which we use to throw away backing store of layers outside the viewport),
so after scrolling an accelerated overflow:scroll which contained composited layers, we
would sometimes fail to recompute that we should re-create backing store for revealed
layers.

Fix by having GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush() determine
whether 'intersectsCoverageRect' changed, and if so trigger a flush. This requires
tracking CommitState for isViewportConstrained-ness, just like we do during commits.

Also clean up code related to computing the visible rect passed into visibleRectChangeRequiresFlush() and
flushCompositingState(); these diverged for no good reason. Also clean up the logging a little.

Not testable because UIWebView layout tests are unreliable.

* page/ios/FrameIOS.mm:
(WebCore::Frame::viewportOffsetChanged):
(WebCore::Frame::overflowScrollPositionChangedForNode):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
(WebCore::GraphicsLayerCA::visibleRectChangeRequiresFlush const):
* platform/graphics/ca/GraphicsLayerCA.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::didChangeVisibleRect):
* rendering/RenderLayerCompositor.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224510 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/page/ios/FrameIOS.mm
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h