- Revision
- 149969
- Author
- [email protected]
- Date
- 2013-05-12 11:46:37 -0700 (Sun, 12 May 2013)
Log Message
Dropdowns on http://www.exploratorium.edu don't show anything
https://bugs.webkit.org/show_bug.cgi?id=115991
Source/WebCore:
Reviewed by Dan Bernstein.
We can't optimize away the backing store of a layer by saying that
it paints into a composited ancestor if its composited bounds are not contained
by that ancestor.
Test: compositing/backing/no-backing-for-clip-overhang.html
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): Pass in our
previously computed composited bounds relative to our composited ancestor,
and its composited bounds.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresOwnBackingStore): If the ancestor's
composited bounds don't contain the layer's composited bounds, the layer
needs its own backing store.
* rendering/RenderLayerCompositor.h:
LayoutTests:
Reviewed by Dan Bernstein.
Layer tree dump test with an overflow:hidden that projects outside its
ancestor, and is forced to composite by a composited child.
* compositing/backing/no-backing-for-clip-overhang-expected.txt: Added.
* compositing/backing/no-backing-for-clip-overhang.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (149968 => 149969)
--- trunk/LayoutTests/ChangeLog 2013-05-12 18:22:11 UTC (rev 149968)
+++ trunk/LayoutTests/ChangeLog 2013-05-12 18:46:37 UTC (rev 149969)
@@ -1,3 +1,16 @@
+2013-05-12 Simon Fraser <[email protected]>
+
+ Dropdowns on http://www.exploratorium.edu don't show anything
+ https://bugs.webkit.org/show_bug.cgi?id=115991
+
+ Reviewed by Dan Bernstein.
+
+ Layer tree dump test with an overflow:hidden that projects outside its
+ ancestor, and is forced to composite by a composited child.
+
+ * compositing/backing/no-backing-for-clip-overhang-expected.txt: Added.
+ * compositing/backing/no-backing-for-clip-overhang.html: Added.
+
2013-05-12 Andreas Kling <[email protected]>
Rebaseline fast/js/global-constructors-attributes.html for mac-lion after r149920.
Added: trunk/LayoutTests/compositing/backing/no-backing-for-clip-overhang-expected.txt (0 => 149969)
--- trunk/LayoutTests/compositing/backing/no-backing-for-clip-overhang-expected.txt (rev 0)
+++ trunk/LayoutTests/compositing/backing/no-backing-for-clip-overhang-expected.txt 2013-05-12 18:46:37 UTC (rev 149969)
@@ -0,0 +1,38 @@
+Text here
+(GraphicsLayer
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (contentsOpaque 1)
+ (children 1
+ (GraphicsLayer
+ (position 18.00 10.00)
+ (bounds 102.00 102.00)
+ (drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (position 21.00 21.00)
+ (bounds 300.00 100.00)
+ (contentsOpaque 1)
+ (drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (bounds 300.00 100.00)
+ (children 1
+ (GraphicsLayer
+ (position 0.00 18.00)
+ (bounds 10.00 10.00)
+ (contentsOpaque 1)
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+)
+
Added: trunk/LayoutTests/compositing/backing/no-backing-for-clip-overhang.html (0 => 149969)
--- trunk/LayoutTests/compositing/backing/no-backing-for-clip-overhang.html (rev 0)
+++ trunk/LayoutTests/compositing/backing/no-backing-for-clip-overhang.html 2013-05-12 18:46:37 UTC (rev 149969)
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <style type="text/css" media="screen">
+ .container {
+ position: relative;
+ height: 100px;
+ width: 100px;
+ margin: 10px;
+ left: 0;
+ top: 0;
+ border: 1px solid black;
+ }
+
+ .clipping {
+ position: absolute;
+ overflow: hidden;
+ left: 20px;
+ top: 20px;
+ height: 100px;
+ width: 300px;
+ z-index: 0;
+ background-color: green;
+ }
+
+ .box {
+ width: 10px;
+ height: 10px;
+ background-color: black;
+ }
+
+ .composited {
+ -webkit-transform: translateZ(0);
+ }
+ </style>
+
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ function dumpLayers()
+ {
+ var layersResult = document.getElementById('layers');
+ if (window.testRunner)
+ layersResult.innerText = window.internals.layerTreeAsText(document);
+ }
+
+ window.addEventListener('load', dumpLayers, false)
+ </script>
+
+</head>
+<body>
+
+ <div class="composited container">
+ <div class="clipping">
+ Text here
+ <div class="box composited">
+ </div>
+ </div>
+ </div>
+
+<pre id="layers">Layer tree goes here in DRT</pre>
+
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (149968 => 149969)
--- trunk/Source/WebCore/ChangeLog 2013-05-12 18:22:11 UTC (rev 149968)
+++ trunk/Source/WebCore/ChangeLog 2013-05-12 18:46:37 UTC (rev 149969)
@@ -1,3 +1,26 @@
+2013-05-12 Simon Fraser <[email protected]>
+
+ Dropdowns on http://www.exploratorium.edu don't show anything
+ https://bugs.webkit.org/show_bug.cgi?id=115991
+
+ Reviewed by Dan Bernstein.
+
+ We can't optimize away the backing store of a layer by saying that
+ it paints into a composited ancestor if its composited bounds are not contained
+ by that ancestor.
+
+ Test: compositing/backing/no-backing-for-clip-overhang.html
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): Pass in our
+ previously computed composited bounds relative to our composited ancestor,
+ and its composited bounds.
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::requiresOwnBackingStore): If the ancestor's
+ composited bounds don't contain the layer's composited bounds, the layer
+ needs its own backing store.
+ * rendering/RenderLayerCompositor.h:
+
2013-05-12 Commit Queue <[email protected]>
Unreviewed, rolling out r149955.
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (149968 => 149969)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2013-05-12 18:22:11 UTC (rev 149968)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2013-05-12 18:46:37 UTC (rev 149969)
@@ -858,7 +858,7 @@
}
// If this layer was created just for clipping or to apply perspective, it doesn't need its own backing store.
- setRequiresOwnBackingStore(compositor()->requiresOwnBackingStore(m_owningLayer, compAncestor));
+ setRequiresOwnBackingStore(compositor()->requiresOwnBackingStore(m_owningLayer, compAncestor, relativeCompositingBounds, ancestorCompositingBounds));
bool didUpdateContentsRect = false;
updateDirectlyCompositedContents(isSimpleContainer, didUpdateContentsRect);
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (149968 => 149969)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2013-05-12 18:22:11 UTC (rev 149968)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2013-05-12 18:46:37 UTC (rev 149969)
@@ -1751,7 +1751,7 @@
return m_hasAcceleratedCompositing && layer->isSelfPaintingLayer() && layer->renderer()->flowThreadState() == RenderObject::NotInsideFlowThread;
}
-bool RenderLayerCompositor::requiresOwnBackingStore(const RenderLayer* layer, const RenderLayer* compositingAncestorLayer) const
+bool RenderLayerCompositor::requiresOwnBackingStore(const RenderLayer* layer, const RenderLayer* compositingAncestorLayer, const IntRect& layerCompositedBoundsInAncestor, const IntRect& ancestorCompositedBounds) const
{
RenderObject* renderer = layer->renderer();
if (compositingAncestorLayer
@@ -1787,6 +1787,10 @@
|| reason == RenderLayer::IndirectCompositingForGraphicalEffect
|| reason == RenderLayer::IndirectCompositingForPreserve3D; // preserve-3d has to create backing store to ensure that 3d-transformed elements intersect.
}
+
+ if (!ancestorCompositedBounds.contains(layerCompositedBoundsInAncestor))
+ return true;
+
return false;
}
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (149968 => 149969)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h 2013-05-12 18:22:11 UTC (rev 149968)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h 2013-05-12 18:46:37 UTC (rev 149969)
@@ -179,7 +179,7 @@
void repaintCompositedLayers(const IntRect* = 0);
// Returns true if the given layer needs it own backing store.
- bool requiresOwnBackingStore(const RenderLayer*, const RenderLayer* compositingAncestorLayer) const;
+ bool requiresOwnBackingStore(const RenderLayer*, const RenderLayer* compositingAncestorLayer, const IntRect& layerCompositedBoundsInAncestor, const IntRect& ancestorCompositedBounds) const;
RenderLayer* rootRenderLayer() const;
GraphicsLayer* rootGraphicsLayer() const;