diff options
author | Nicolas Roard <nicolas@android.com> | 2010-03-25 18:45:39 +0000 |
---|---|---|
committer | Nicolas Roard <nicolas@android.com> | 2010-03-26 14:30:27 +0000 |
commit | ac3440adeece498748e4b4b0fc05c22ddaab9624 (patch) | |
tree | 53e623a2d851d3d3b5a807abb28a5fe80e3f4e4a | |
parent | fef9ddedbf313d5afeda1938c57b4e90cef118f7 (diff) | |
download | external_webkit-ac3440adeece498748e4b4b0fc05c22ddaab9624.zip external_webkit-ac3440adeece498748e4b4b0fc05c22ddaab9624.tar.gz external_webkit-ac3440adeece498748e4b4b0fc05c22ddaab9624.tar.bz2 |
Add checks to consider a fixed layer for compositing only if its
dimensions are actually more than zero.
Fix Bug:2545160
Change-Id: I08ca0c1f5a6729760dbf62084a96faee76d124f9
-rw-r--r-- | WebCore/rendering/RenderLayerCompositor.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/WebCore/rendering/RenderLayerCompositor.cpp b/WebCore/rendering/RenderLayerCompositor.cpp index e8d476b..403ccc1 100644 --- a/WebCore/rendering/RenderLayerCompositor.cpp +++ b/WebCore/rendering/RenderLayerCompositor.cpp @@ -462,6 +462,13 @@ bool RenderLayerCompositor::overlapsCompositedLayers(OverlapMap& overlapMap, con return false; } +#if ENABLE(COMPOSITED_FIXED_ELEMENTS) +static bool needsCompositingForFixedLayer(const RenderLayer* layer) +{ + return layer->isFixed() && layer->width() > 0 && layer->height() > 0; +} +#endif + // Recurse through the layers in z-index and overflow order (which is equivalent to painting order) // For the z-order children of a compositing layer: // If a child layers has a compositing layer, then all subsequent layers must @@ -505,7 +512,7 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* layer, O #if ENABLE(COMPOSITED_FIXED_ELEMENTS) // If we are a fixed layer, signal it to our siblings - if (layer->isFixed()) + if (needsCompositingForFixedLayer(layer)) compositingState.m_fixedSibling = true; if (!willBeComposited && compositingState.m_fixedSibling) @@ -547,7 +554,7 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* layer, O // subsequent siblings as we do for the normal flow // and positive z-order. for (size_t j = 0; j < listSize; ++j) { - if ((negZOrderList->at(j))->isFixed()) { + if (needsCompositingForFixedLayer(negZOrderList->at(j))) { childState.m_fixedSibling = true; break; } @@ -974,7 +981,7 @@ bool RenderLayerCompositor::needsToBeComposited(const RenderLayer* layer) const // if an ancestor is fixed positioned, we need to be composited... const RenderLayer* currLayer = layer; while ((currLayer = currLayer->parent())) { - if (currLayer->isComposited() && currLayer->isFixed()) + if (currLayer->isComposited() && needsCompositingForFixedLayer(currLayer)) return true; } #endif @@ -1007,7 +1014,7 @@ bool RenderLayerCompositor::requiresCompositingLayer(const RenderLayer* layer) c // 1) - the viewport width is either undefined (-1) or equal to device-width (0), and // 2) - no scaling is allowed (((settings->viewportWidth() == -1) || (settings->viewportWidth() == 0)) && - !settings->viewportUserScalable() && layer->isFixed()) || + !settings->viewportUserScalable() && needsCompositingForFixedLayer(layer)) || #endif #else requiresCompositingForVideo(renderer) || |