OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 1585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1596 | 1596 |
1597 if (hasBoxDecorationsOrBackgroundImage(style)) | 1597 if (hasBoxDecorationsOrBackgroundImage(style)) |
1598 return false; | 1598 return false; |
1599 } | 1599 } |
1600 | 1600 |
1601 return true; | 1601 return true; |
1602 } | 1602 } |
1603 | 1603 |
1604 static bool hasVisibleNonCompositingDescendant(RenderLayer* parent) | 1604 static bool hasVisibleNonCompositingDescendant(RenderLayer* parent) |
1605 { | 1605 { |
| 1606 if (!parent->hasVisibleDescendant()) |
| 1607 return false; |
| 1608 |
1606 // FIXME: We shouldn't be called with a stale z-order lists. See bug 85512. | 1609 // FIXME: We shouldn't be called with a stale z-order lists. See bug 85512. |
1607 parent->stackingNode()->updateLayerListsIfNeeded(); | 1610 parent->stackingNode()->updateLayerListsIfNeeded(); |
1608 | 1611 |
1609 #if !ASSERT_DISABLED | 1612 #if !ASSERT_DISABLED |
1610 LayerListMutationDetector mutationChecker(parent->stackingNode()); | 1613 LayerListMutationDetector mutationChecker(parent->stackingNode()); |
1611 #endif | 1614 #endif |
1612 | 1615 |
1613 RenderLayerStackingNodeIterator normalFlowIterator(*parent->stackingNode(),
NormalFlowChildren); | 1616 RenderLayerStackingNodeIterator normalFlowIterator(*parent->stackingNode(),
AllChildren); |
1614 while (RenderLayerStackingNode* curNode = normalFlowIterator.next()) { | 1617 while (RenderLayerStackingNode* curNode = normalFlowIterator.next()) { |
1615 RenderLayer* curLayer = curNode->layer(); | 1618 RenderLayer* curLayer = curNode->layer(); |
1616 if (!curLayer->hasCompositedLayerMapping() | 1619 if (curLayer->hasCompositedLayerMapping()) |
1617 && (curLayer->hasVisibleContent() || hasVisibleNonCompositingDescend
ant(curLayer))) | 1620 continue; |
| 1621 if (curLayer->hasVisibleContent() || hasVisibleNonCompositingDescendant(
curLayer)) |
1618 return true; | 1622 return true; |
1619 } | 1623 } |
1620 | 1624 |
1621 if (!parent->hasVisibleDescendant()) | |
1622 return false; | |
1623 | |
1624 RenderLayerStackingNodeIterator zOrderIterator(*parent->stackingNode(), Nega
tiveZOrderChildren | PositiveZOrderChildren); | |
1625 while (RenderLayerStackingNode* curNode = zOrderIterator.next()) { | |
1626 RenderLayer* curLayer = curNode->layer(); | |
1627 if (!curLayer->hasCompositedLayerMapping() | |
1628 && (curLayer->hasVisibleContent() || hasVisibleNonCompositingDescend
ant(curLayer))) | |
1629 return true; | |
1630 } | |
1631 | |
1632 return false; | 1625 return false; |
1633 } | 1626 } |
1634 | 1627 |
1635 // FIXME: By name the implementation is correct. But the code that uses this fun
ction means something | 1628 // FIXME: By name the implementation is correct. But the code that uses this fun
ction means something |
1636 // very slightly different - the implementation needs to also include composited
descendants that | 1629 // very slightly different - the implementation needs to also include composited
descendants that |
1637 // don't paint into their own backing, and instead paint into this backing. | 1630 // don't paint into their own backing, and instead paint into this backing. |
1638 bool CompositedLayerMapping::hasVisibleNonCompositingDescendantLayers() const | 1631 bool CompositedLayerMapping::hasVisibleNonCompositingDescendantLayers() const |
1639 { | 1632 { |
1640 return hasVisibleNonCompositingDescendant(m_owningLayer); | 1633 return hasVisibleNonCompositingDescendant(m_owningLayer); |
1641 } | 1634 } |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2164 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2157 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
2165 name = "Scrolling Contents Layer"; | 2158 name = "Scrolling Contents Layer"; |
2166 } else { | 2159 } else { |
2167 ASSERT_NOT_REACHED(); | 2160 ASSERT_NOT_REACHED(); |
2168 } | 2161 } |
2169 | 2162 |
2170 return name; | 2163 return name; |
2171 } | 2164 } |
2172 | 2165 |
2173 } // namespace WebCore | 2166 } // namespace WebCore |
OLD | NEW |