Incorrect clipping across compositing boundary.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Jan 2019 03:54:25 +0000 (03:54 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Jan 2019 03:54:25 +0000 (03:54 +0000)
commitb4132467de1ff073522cb66d16816723f478867e
tree4b29a7e90f2ef0ac66dfe40b7d2b3301c892e3e5
parentebd916ea7644b90c2e34ec01af66dc8148d960c1
Incorrect clipping across compositing boundary.
https://bugs.webkit.org/show_bug.cgi?id=193172
<rdar://problem/44693008>

Reviewed by Simon Fraser.

Source/WebCore:

Use temporary cliprect type when crossing compositing boundary to prevent cliprect caching.

The issue here is that RenderLayer::backgroundClipRect() could cross compositing boundary by calling parentClipRects() which triggers
clip rect update using the wrong painting root. This happens when the layer hierarchy and the compositing context do not match.
For clip rect computation, we need to climb up on the layer hierarchy (calling parent layer's cliprect functions)
but we also need to make sure that the computed cliprects on any given layer are cached only when the painting root is correct.
It ensures that when we paint a layer (with the painting root as entry point), the cached cliprects are always based on its onw painting root.

Test: compositing/clipping/cached-cliprect-with-compositing-boundary.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):

LayoutTests:

* compositing/clipping/cached-cliprect-with-compositing-boundary-expected.html: Added.
* compositing/clipping/cached-cliprect-with-compositing-boundary.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239661 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/compositing/clipping/cached-cliprect-with-compositing-boundary-expected.html [new file with mode: 0644]
LayoutTests/compositing/clipping/cached-cliprect-with-compositing-boundary.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp