Changeset 149915 in webkit


Ignore:
Timestamp:
May 10, 2013 5:32:05 PM (11 years ago)
Author:
Simon Fraser
Message:

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.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r149914 r149915  
     12013-05-10  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r143626): Element shows as garbage in image gallery
     4        https://bugs.webkit.org/show_bug.cgi?id=115946
     5
     6        Reviewed by Antti Koivisto.
     7       
     8        Test that dumps layers for a visibility:hidden element with a child text node,
     9        and with a visibility:visible child. The resulting compositing layer should
     10        not be marked as opaque.
     11
     12        * compositing/contents-opaque/hidden-with-visible-child-expected.txt: Added.
     13        * compositing/contents-opaque/hidden-with-visible-child.html: Added.
     14        * compositing/contents-opaque/hidden-with-visible-text-expected.txt: Added.
     15        * compositing/contents-opaque/hidden-with-visible-text.html: Added.
     16
    1172013-05-10  Simon Fraser  <simon.fraser@apple.com>
    218
  • trunk/Source/WebCore/ChangeLog

    r149914 r149915  
     12013-05-10  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r143626): Element shows as garbage in image gallery
     4        https://bugs.webkit.org/show_bug.cgi?id=115946
     5
     6        Reviewed by Antti Koivisto.
     7       
     8        RenderLayer::backgroundIsKnownToBeOpaqueInRect() used hasVisibleContent()
     9        to check whether the layer's content was hidden via the visibility property.
     10        However, this assumed that a passing hasVisibleContent() check meant that the
     11        entire area was covered by the renderers and layers checked layer.
     12       
     13        This is not always true. It's possible to have a visibility:hidden layer
     14        with a non-covering visbility:visible child, or even a single RenderText
     15        child that happens to have visibility:visible style. In these situations,
     16        hasVisibleContent() returns true but the entire area is not painted.
     17       
     18        So we have to fall back to on a more conservative check using the
     19        visibility style, which will give is a reliable answer for the current layer.
     20
     21        Tests: compositing/contents-opaque/hidden-with-visible-child.html
     22               compositing/contents-opaque/hidden-with-visible-text.html
     23
     24        * rendering/RenderLayer.cpp:
     25        (WebCore::RenderLayer::backgroundIsKnownToBeOpaqueInRect):
     26
    1272013-05-10  Simon Fraser  <simon.fraser@apple.com>
    228
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r149914 r149915  
    55655565        return false;
    55665566
    5567     ASSERT(!m_visibleContentStatusDirty);
    5568     if (!hasVisibleContent())
     5567    // We can't use hasVisibleContent(), because that will be true if our renderer is hidden, but some child
     5568    // is visible and that child doesn't cover the entire rect.
     5569    if (renderer()->style()->visibility() != VISIBLE)
    55695570        return false;
    55705571
Note: See TracChangeset for help on using the changeset viewer.