REGRESSION (r143626): Element shows as garbage in image gallery
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 May 2013 00:32:05 +0000 (00:32 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 May 2013 00:32:05 +0000 (00:32 +0000)
commit8ea0d592cdfb6fd6500a50ff3b2b9745ff314a9c
treef880368dce8f7e9c1e6fdbbc7297f5f205a3af14
parent8d5cae48cc85df5cc9af8b4d0c6769e6d55d44a0
REGRESSION (r143626): Element shows as garbage in image gallery
https://bugs.webkit.org/show_bug.cgi?id=115946

Source/WebCore:

Reviewed by Antti Koivisto.

RenderLayer::backgroundIsKnownToBeOpaqueInRect() used hasVisibleContent()
to check whether the layer's content was hidden via the visibility property.
However, this assumed that a passing hasVisibleContent() check meant that the
entire area was covered by the renderers and layers checked layer.

This is not always true. It's possible to have a visibility:hidden layer
with a non-covering visbility:visible child, or even a single RenderText
child that happens to have visibility:visible style. In these situations,
hasVisibleContent() returns true but the entire area is not painted.

So we have to fall back to on a more conservative check using the
visibility style, which will give is a reliable answer for the current layer.

Tests: compositing/contents-opaque/hidden-with-visible-child.html
       compositing/contents-opaque/hidden-with-visible-text.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::backgroundIsKnownToBeOpaqueInRect):

LayoutTests:

Reviewed by Antti Koivisto.

Test that dumps layers for a visibility:hidden element with a child text node,
and with a visibility:visible child. The resulting compositing layer should
not be marked as opaque.

* compositing/contents-opaque/hidden-with-visible-child-expected.txt: Added.
* compositing/contents-opaque/hidden-with-visible-child.html: Added.
* compositing/contents-opaque/hidden-with-visible-text-expected.txt: Added.
* compositing/contents-opaque/hidden-with-visible-text.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@149915 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/compositing/contents-opaque/hidden-with-visible-child-expected.txt [new file with mode: 0644]
LayoutTests/compositing/contents-opaque/hidden-with-visible-child.html [new file with mode: 0644]
LayoutTests/compositing/contents-opaque/hidden-with-visible-text-expected.txt [new file with mode: 0644]
LayoutTests/compositing/contents-opaque/hidden-with-visible-text.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp