Fix occlusion culling logic to handle css background layer clipping
https://bugs.webkit.org/show_bug.cgi?id=103276
Reviewed by Simon Fraser.
Source/WebCore:
Bug was introduced by r135629
This patch fixes it by verifying layer clip. A fill layer must
not be treated as if it occludes the layers under it unless it has
a larger or equal clip setting than the layers under it.
Test: fast/backgrounds/background-opaque-clipped-gradients.html
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintFillLayers):
* rendering/style/FillLayer.cpp:
(WebCore::clipMax):
(WebCore::FillLayer::computeClipMax):
(WebCore::FillLayer::clipOccludesNextLayers):
* rendering/style/FillLayer.h:
(FillLayer):
LayoutTests:
New ref test that verifies the superposition of background layers with
the layers having smaller clip regions than the layers beneath them.
This test ensures the bottom layers are not removed by culling
optimizations.
* fast/backgrounds/background-opaque-clipped-gradients-expected.html: Added.
* fast/backgrounds/background-opaque-clipped-gradients.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136326 268f45cc-cd09-0410-ab3c-d52691b4dbfc
7 files changed