[iOS] Dark flash when opening Google AMP pages
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Mar 2019 01:54:59 +0000 (01:54 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Mar 2019 01:54:59 +0000 (01:54 +0000)
commitdfb2baccb68157b1698368afd585d3890badcea9
treee3c8228d5e9692049407789c16fa0ac1f24f0f40
parent4d0338ea36f10b00a0f4843e0efce1508918fd26
[iOS] Dark flash when opening Google AMP pages
https://bugs.webkit.org/show_bug.cgi?id=195193
rdar://problem/48326442

Reviewed by Zalan Bujtas.

Source/WebCore:

After the incremental compositing updates changes, it was possible for a change in the size
of an overflow:hidden element to fail to update the "ancestor clipping layer" geometry on
a composited descendant that is not a descendant in z-order. When Google search results
create the <iframe> that contain AMP contents, we'd fail to update a zero-sized clipping layer,
leaving the #222 background of an intermediate element visible.

Fix by setting a flag in RenderLayer::updateLayerPosition() (which is called in containing block order)
that sets the "needs geometry update" dirty bit on containing-block-descendant layers. Currently
this flag affects all descendants; in future, we might be able to clear it for grand-children.

Tests: compositing/geometry/ancestor-clip-change-interleaved-stacking-context.html
       compositing/geometry/ancestor-clip-change.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositions):
(WebCore::RenderLayer::updateLayerPosition):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateAfterLayout):
* rendering/RenderLayerBacking.h:

LayoutTests:

Tests that change the size of a clipping layer with non-z-order composited descendant, with
a couple of layer tree configurations.

* compositing/geometry/ancestor-clip-change-expected.html: Added.
* compositing/geometry/ancestor-clip-change-interleaved-stacking-context-expected.html: Added.
* compositing/geometry/ancestor-clip-change-interleaved-stacking-context.html: Added.
* compositing/geometry/ancestor-clip-change.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/compositing/geometry/ancestor-clip-change-expected.html [new file with mode: 0644]
LayoutTests/compositing/geometry/ancestor-clip-change-interleaved-stacking-context-expected.html [new file with mode: 0644]
LayoutTests/compositing/geometry/ancestor-clip-change-interleaved-stacking-context.html [new file with mode: 0644]
LayoutTests/compositing/geometry/ancestor-clip-change.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h