Changeset 142012 in webkit


Ignore:
Timestamp:
Feb 6, 2013 11:35:21 AM (11 years ago)
Author:
shawnsingh@chromium.org
Message:

RenderLayer hasVisibleContent() has inconsistent semantics causing disappearing composited layers
https://bugs.webkit.org/show_bug.cgi?id=108118

Reviewed by Simon Fraser.

Source/WebCore:

RenderLayerBacking::hasVisibleNonCompositingDescendantLayers was
only checking whether direct children had visible content. As a
result, composited layers had wrong visibility status if only a
deeper descendant RenderLayer was visible.

Test: compositing/visibility/visibility-on-distant-descendant.html

  • rendering/RenderLayerBacking.cpp:

(WebCore::hasVisibleNonCompositingDescendant): copied the original
implementation into this function; then added the RenderLayer
recursion as appropriate.
(WebCore):
(WebCore::RenderLayerBacking::hasVisibleNonCompositingDescendantLayers):
This is now just a wrapper to the private static recursive
function.

LayoutTests:

  • compositing/visibility/visibility-on-distant-descendant-expected.png: Added.
  • compositing/visibility/visibility-on-distant-descendant-expected.txt: Added.
  • compositing/visibility/visibility-on-distant-descendant.html: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r142007 r142012  
     12013-02-06  Shawn Singh  <shawnsingh@chromium.org>
     2
     3        RenderLayer hasVisibleContent() has inconsistent semantics causing disappearing composited layers
     4        https://bugs.webkit.org/show_bug.cgi?id=108118
     5
     6        Reviewed by Simon Fraser.
     7
     8        * compositing/visibility/visibility-on-distant-descendant-expected.png: Added.
     9        * compositing/visibility/visibility-on-distant-descendant-expected.txt: Added.
     10        * compositing/visibility/visibility-on-distant-descendant.html: Added.
     11
    1122013-02-06  Gregg Tavares  <gman@chromium.org>
    213
  • trunk/Source/WebCore/ChangeLog

    r142005 r142012  
     12013-02-06  Shawn Singh  <shawnsingh@chromium.org>
     2
     3        RenderLayer hasVisibleContent() has inconsistent semantics causing disappearing composited layers
     4        https://bugs.webkit.org/show_bug.cgi?id=108118
     5
     6        Reviewed by Simon Fraser.
     7
     8        RenderLayerBacking::hasVisibleNonCompositingDescendantLayers was
     9        only checking whether direct children had visible content. As a
     10        result, composited layers had wrong visibility status if only a
     11        deeper descendant RenderLayer was visible.
     12
     13        Test: compositing/visibility/visibility-on-distant-descendant.html
     14
     15        * rendering/RenderLayerBacking.cpp:
     16        (WebCore::hasVisibleNonCompositingDescendant): copied the original
     17        implementation into this function; then added the RenderLayer
     18        recursion as appropriate.
     19        (WebCore):
     20        (WebCore::RenderLayerBacking::hasVisibleNonCompositingDescendantLayers):
     21        This is now just a wrapper to the private static recursive
     22        function.
     23
    1242013-02-06  Jonathon Jongsma  <jonathon.jongsma@collabora.com>
    225
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r141570 r142012  
    14301430}
    14311431
    1432 // Conservative test for having no rendered children.
    1433 bool RenderLayerBacking::hasVisibleNonCompositingDescendantLayers() const
    1434 {
    1435     // FIXME: We shouldn't be called with a stale z-order lists. See bug 85512.
    1436     m_owningLayer->updateLayerListsIfNeeded();
    1437 
    1438 #if !ASSERT_DISABLED
    1439     LayerListMutationDetector mutationChecker(m_owningLayer);
    1440 #endif
    1441 
    1442     if (Vector<RenderLayer*>* normalFlowList = m_owningLayer->normalFlowList()) {
     1432static bool hasVisibleNonCompositingDescendant(RenderLayer* parent)
     1433{
     1434    if (Vector<RenderLayer*>* normalFlowList = parent->normalFlowList()) {
    14431435        size_t listSize = normalFlowList->size();
    14441436        for (size_t i = 0; i < listSize; ++i) {
    14451437            RenderLayer* curLayer = normalFlowList->at(i);
    1446             if (!curLayer->isComposited() && curLayer->hasVisibleContent())
     1438            if (!curLayer->isComposited()
     1439                && (curLayer->hasVisibleContent() || hasVisibleNonCompositingDescendant(curLayer)))
    14471440                return true;
    14481441        }
    14491442    }
    14501443
    1451     if (m_owningLayer->isStackingContainer()) {
    1452         if (!m_owningLayer->hasVisibleDescendant())
     1444    if (parent->isStackingContainer()) {
     1445        if (!parent->hasVisibleDescendant())
    14531446            return false;
    14541447
    14551448        // Use the m_hasCompositingDescendant bit to optimize?
    1456         if (Vector<RenderLayer*>* negZOrderList = m_owningLayer->negZOrderList()) {
     1449        if (Vector<RenderLayer*>* negZOrderList = parent->negZOrderList()) {
    14571450            size_t listSize = negZOrderList->size();
    14581451            for (size_t i = 0; i < listSize; ++i) {
    14591452                RenderLayer* curLayer = negZOrderList->at(i);
    1460                 if (!curLayer->isComposited() && curLayer->hasVisibleContent())
     1453                if (!curLayer->isComposited()
     1454                    && (curLayer->hasVisibleContent() || hasVisibleNonCompositingDescendant(curLayer)))
    14611455                    return true;
    14621456            }
    14631457        }
    14641458
    1465         if (Vector<RenderLayer*>* posZOrderList = m_owningLayer->posZOrderList()) {
     1459        if (Vector<RenderLayer*>* posZOrderList = parent->posZOrderList()) {
    14661460            size_t listSize = posZOrderList->size();
    14671461            for (size_t i = 0; i < listSize; ++i) {
    14681462                RenderLayer* curLayer = posZOrderList->at(i);
    1469                 if (!curLayer->isComposited() && curLayer->hasVisibleContent())
     1463                if (!curLayer->isComposited()
     1464                    && (curLayer->hasVisibleContent() || hasVisibleNonCompositingDescendant(curLayer)))
    14701465                    return true;
    14711466            }
     
    14741469
    14751470    return false;
     1471}
     1472
     1473// Conservative test for having no rendered children.
     1474bool RenderLayerBacking::hasVisibleNonCompositingDescendantLayers() const
     1475{
     1476    // FIXME: We shouldn't be called with a stale z-order lists. See bug 85512.
     1477    m_owningLayer->updateLayerListsIfNeeded();
     1478
     1479#if !ASSERT_DISABLED
     1480    LayerListMutationDetector mutationChecker(m_owningLayer);
     1481#endif
     1482
     1483    return hasVisibleNonCompositingDescendant(m_owningLayer);
    14761484}
    14771485
Note: See TracChangeset for help on using the changeset viewer.