Index: third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp |
diff --git a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp |
index ad6b112dc84a7d4248018aad7ea0a053f6f38598..e460ecc4b0fffcdc670f46ac81b099aee53d8577 100644 |
--- a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp |
+++ b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp |
@@ -645,7 +645,8 @@ |
return nullptr; |
} |
-bool PaintLayerCompositor::attachFrameContentLayersToIframeLayer(LayoutPart* layoutObject) |
+// FIXME: What does this function do? It needs a clearer name. |
+bool PaintLayerCompositor::parentFrameContentLayers(LayoutPart* layoutObject) |
{ |
PaintLayerCompositor* innerCompositor = frameContentsCompositor(layoutObject); |
if (!innerCompositor || !innerCompositor->staleInCompositingMode() || innerCompositor->rootLayerAttachment() != RootLayerAttachedViaEnclosingFrame) |
@@ -655,7 +656,13 @@ |
if (!layer->hasCompositedLayerMapping()) |
return false; |
- layer->compositedLayerMapping()->setSublayers(GraphicsLayerVector(1, innerCompositor->rootGraphicsLayer())); |
+ CompositedLayerMapping* compositedLayerMapping = layer->compositedLayerMapping(); |
+ GraphicsLayer* hostingLayer = compositedLayerMapping->parentForSublayers(); |
+ GraphicsLayer* rootLayer = innerCompositor->rootGraphicsLayer(); |
+ if (hostingLayer->children().size() != 1 || hostingLayer->children()[0] != rootLayer) { |
+ hostingLayer->removeAllChildren(); |
+ hostingLayer->addChild(rootLayer); |
+ } |
return true; |
} |