summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-11-16 11:20:29 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-11-16 11:20:29 -0800
commitd34224ca67791aa7215160c7be4900f965f79eea (patch)
tree8beaae887cedbbd981267fa447603b3adcb936e9 /Source
parentd6945dd4dc2d427a38d75cde40767fce404f69fc (diff)
parent9b381fdf13b6f448ab78bdd052c4a744233626e4 (diff)
downloadexternal_webkit-d34224ca67791aa7215160c7be4900f965f79eea.zip
external_webkit-d34224ca67791aa7215160c7be4900f965f79eea.tar.gz
external_webkit-d34224ca67791aa7215160c7be4900f965f79eea.tar.bz2
Merge "Promote -ve z-index fixed/scrollable elements to layers" into ics-mr1
Diffstat (limited to 'Source')
-rw-r--r--Source/WebCore/rendering/RenderLayerCompositor.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp
index 4f4f553..598926d 100644
--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp
@@ -764,7 +764,18 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* layer, O
// If we have to make a layer for this child, make one now so we can have a contents layer
// (since we need to ensure that the -ve z-order child renders underneath our contents).
+#ifdef ANDROID
+ // Normally we try to reduce the number of layers by not promoting all fixed
+ // or scrollable elements to their own compositing layer. But in the case that
+ // we have such an element in the negative z-order, we must make it a layer
+ // otherwise the content will be painted at a higher z-index. This breaks pages
+ // that set a large image with a z-index of -1 to implement a background image,
+ // for example.
+ bool childRequiresCompositing = childState.m_hasFixedElement || childState.m_hasScrollableElement;
+ if (!willBeComposited && (childState.m_subtreeIsCompositing || childRequiresCompositing)) {
+#else
if (!willBeComposited && childState.m_subtreeIsCompositing) {
+#endif
// make layer compositing
layer->setMustOverlapCompositedLayers(true);
childState.m_compositingAncestor = layer;