OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 // anyway. | 346 // anyway. |
347 layoutObject.clearPreviousVisualRects(); | 347 layoutObject.clearPreviousVisualRects(); |
348 | 348 |
349 for (LayoutObject* child = layoutObject.slowFirstChild(); child; | 349 for (LayoutObject* child = layoutObject.slowFirstChild(); child; |
350 child = child->nextSibling()) { | 350 child = child->nextSibling()) { |
351 if (!child->isPaintInvalidationContainer()) | 351 if (!child->isPaintInvalidationContainer()) |
352 forceRecomputeVisualRectsIncludingNonCompositingDescendants(*child); | 352 forceRecomputeVisualRectsIncludingNonCompositingDescendants(*child); |
353 } | 353 } |
354 } | 354 } |
355 | 355 |
| 356 GraphicsLayer* PaintLayerCompositor::parentForContentLayers() const { |
| 357 if (m_rootContentLayer) |
| 358 return m_rootContentLayer.get(); |
| 359 |
| 360 DCHECK(RuntimeEnabledFeatures::rootLayerScrollingEnabled()); |
| 361 // Iframe content layers will be connected by the parent frame using |
| 362 // attachFrameContentLayersToIframeLayer. |
| 363 return isMainFrame() ? visualViewport().scrollLayer() : nullptr; |
| 364 } |
| 365 |
356 void PaintLayerCompositor::updateIfNeeded() { | 366 void PaintLayerCompositor::updateIfNeeded() { |
357 CompositingUpdateType updateType = m_pendingUpdateType; | 367 CompositingUpdateType updateType = m_pendingUpdateType; |
358 m_pendingUpdateType = CompositingUpdateNone; | 368 m_pendingUpdateType = CompositingUpdateNone; |
359 | 369 |
360 if (!hasAcceleratedCompositing()) { | 370 if (!hasAcceleratedCompositing()) { |
361 updateWithoutAcceleratedCompositing(updateType); | 371 updateWithoutAcceleratedCompositing(updateType); |
362 return; | 372 return; |
363 } | 373 } |
364 | 374 |
365 if (updateType == CompositingUpdateNone) | 375 if (updateType == CompositingUpdateNone) |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 } | 447 } |
438 | 448 |
439 if (updateType >= CompositingUpdateRebuildTree) { | 449 if (updateType >= CompositingUpdateRebuildTree) { |
440 GraphicsLayerVector childList; | 450 GraphicsLayerVector childList; |
441 { | 451 { |
442 TRACE_EVENT0("blink", "GraphicsLayerTreeBuilder::rebuild"); | 452 TRACE_EVENT0("blink", "GraphicsLayerTreeBuilder::rebuild"); |
443 GraphicsLayerTreeBuilder().rebuild(*updateRoot, childList); | 453 GraphicsLayerTreeBuilder().rebuild(*updateRoot, childList); |
444 } | 454 } |
445 | 455 |
446 if (!childList.isEmpty()) { | 456 if (!childList.isEmpty()) { |
447 CHECK(m_rootContentLayer && m_compositing); | 457 CHECK(m_compositing); |
448 m_rootContentLayer->setChildren(childList); | 458 if (GraphicsLayer* contentParent = parentForContentLayers()) |
| 459 contentParent->setChildren(childList); |
449 } | 460 } |
450 | 461 |
451 applyOverlayFullscreenVideoAdjustmentIfNeeded(); | 462 applyOverlayFullscreenVideoAdjustmentIfNeeded(); |
452 } | 463 } |
453 | 464 |
454 if (m_needsUpdateFixedBackground) { | 465 if (m_needsUpdateFixedBackground) { |
455 rootFixedBackgroundsChanged(); | 466 rootFixedBackgroundsChanged(); |
456 m_needsUpdateFixedBackground = false; | 467 m_needsUpdateFixedBackground = false; |
457 } | 468 } |
458 | 469 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 AcceleratedFixedRootBackgroundHistogramMax)); | 695 AcceleratedFixedRootBackgroundHistogramMax)); |
685 acceleratedBackgroundHistogram.count(ScrolledMainFrameBucket); | 696 acceleratedBackgroundHistogram.count(ScrolledMainFrameBucket); |
686 } | 697 } |
687 | 698 |
688 void PaintLayerCompositor::frameViewScrollbarsExistenceDidChange() { | 699 void PaintLayerCompositor::frameViewScrollbarsExistenceDidChange() { |
689 if (m_containerLayer) | 700 if (m_containerLayer) |
690 updateOverflowControlsLayers(); | 701 updateOverflowControlsLayers(); |
691 } | 702 } |
692 | 703 |
693 void PaintLayerCompositor::rootFixedBackgroundsChanged() { | 704 void PaintLayerCompositor::rootFixedBackgroundsChanged() { |
694 if (!supportsFixedRootBackgroundCompositing()) | 705 if (!supportsFixedRootBackgroundCompositing() || !m_containerLayer) |
695 return; | 706 return; |
696 | 707 |
697 // To avoid having to make the fixed root background layer fixed positioned to | 708 // To avoid having to make the fixed root background layer fixed positioned to |
698 // stay put, we position it in the layer tree as follows: | 709 // stay put, we position it in the layer tree as follows: |
699 // | 710 // |
700 // + Overflow controls host | 711 // + Overflow controls host |
701 // + LocalFrame clip | 712 // + LocalFrame clip |
702 // + (Fixed root background) <-- Here. | 713 // + (Fixed root background) <-- Here. |
703 // + LocalFrame scroll | 714 // + LocalFrame scroll |
704 // + Root content layer | 715 // + Root content layer |
(...skipping 11 matching lines...) Expand all Loading... |
716 return scrollingCoordinator->scrollableAreaScrollLayerDidChange( | 727 return scrollingCoordinator->scrollableAreaScrollLayerDidChange( |
717 layer->getScrollableArea()); | 728 layer->getScrollableArea()); |
718 return false; | 729 return false; |
719 } | 730 } |
720 | 731 |
721 std::unique_ptr<JSONObject> PaintLayerCompositor::layerTreeAsJSON( | 732 std::unique_ptr<JSONObject> PaintLayerCompositor::layerTreeAsJSON( |
722 LayerTreeFlags flags) const { | 733 LayerTreeFlags flags) const { |
723 ASSERT(lifecycle().state() >= DocumentLifecycle::PaintInvalidationClean || | 734 ASSERT(lifecycle().state() >= DocumentLifecycle::PaintInvalidationClean || |
724 m_layoutView.frameView()->shouldThrottleRendering()); | 735 m_layoutView.frameView()->shouldThrottleRendering()); |
725 | 736 |
726 if (!m_rootContentLayer) | |
727 return nullptr; | |
728 | |
729 // We skip dumping the scroll and clip layers to keep layerTreeAsText output | 737 // We skip dumping the scroll and clip layers to keep layerTreeAsText output |
730 // similar between platforms (unless we explicitly request dumping from the | 738 // similar between platforms (unless we explicitly request dumping from the |
731 // root. | 739 // root. |
732 GraphicsLayer* rootLayer = m_rootContentLayer.get(); | 740 GraphicsLayer* rootLayer = m_rootContentLayer.get(); |
| 741 if (!rootLayer) |
| 742 rootLayer = rootGraphicsLayer(); |
| 743 |
| 744 if (!rootLayer) |
| 745 return nullptr; |
| 746 |
733 if (flags & LayerTreeIncludesRootLayer) { | 747 if (flags & LayerTreeIncludesRootLayer) { |
734 if (isMainFrame()) { | 748 if (isMainFrame()) { |
735 while (rootLayer->parent()) | 749 while (rootLayer->parent()) |
736 rootLayer = rootLayer->parent(); | 750 rootLayer = rootLayer->parent(); |
737 } else { | 751 } else { |
738 rootLayer = rootGraphicsLayer(); | 752 rootLayer = rootGraphicsLayer(); |
739 } | 753 } |
740 } | 754 } |
741 | 755 |
742 return rootLayer->layerTreeAsJSON(flags); | 756 return rootLayer->layerTreeAsJSON(flags); |
(...skipping 17 matching lines...) Expand all Loading... |
760 PaintLayerCompositor* innerCompositor = frameContentsCompositor(layoutObject); | 774 PaintLayerCompositor* innerCompositor = frameContentsCompositor(layoutObject); |
761 if (!innerCompositor || !innerCompositor->staleInCompositingMode() || | 775 if (!innerCompositor || !innerCompositor->staleInCompositingMode() || |
762 innerCompositor->m_rootLayerAttachment != | 776 innerCompositor->m_rootLayerAttachment != |
763 RootLayerAttachedViaEnclosingFrame) | 777 RootLayerAttachedViaEnclosingFrame) |
764 return false; | 778 return false; |
765 | 779 |
766 PaintLayer* layer = layoutObject.layer(); | 780 PaintLayer* layer = layoutObject.layer(); |
767 if (!layer->hasCompositedLayerMapping()) | 781 if (!layer->hasCompositedLayerMapping()) |
768 return false; | 782 return false; |
769 | 783 |
| 784 DisableCompositingQueryAsserts disabler; |
770 layer->compositedLayerMapping()->setSublayers( | 785 layer->compositedLayerMapping()->setSublayers( |
771 GraphicsLayerVector(1, innerCompositor->rootGraphicsLayer())); | 786 GraphicsLayerVector(1, innerCompositor->rootGraphicsLayer())); |
772 return true; | 787 return true; |
773 } | 788 } |
774 | 789 |
775 static void fullyInvalidatePaintRecursive(PaintLayer* layer) { | 790 static void fullyInvalidatePaintRecursive(PaintLayer* layer) { |
776 if (layer->compositingState() == PaintsIntoOwnBacking) { | 791 if (layer->compositingState() == PaintsIntoOwnBacking) { |
777 layer->compositedLayerMapping()->setContentsNeedDisplay(); | 792 layer->compositedLayerMapping()->setContentsNeedDisplay(); |
778 layer->compositedLayerMapping()->setSquashingContentsNeedDisplay(); | 793 layer->compositedLayerMapping()->setSquashingContentsNeedDisplay(); |
779 } | 794 } |
780 | 795 |
781 for (PaintLayer* child = layer->firstChild(); child; | 796 for (PaintLayer* child = layer->firstChild(); child; |
782 child = child->nextSibling()) | 797 child = child->nextSibling()) |
783 fullyInvalidatePaintRecursive(child); | 798 fullyInvalidatePaintRecursive(child); |
784 } | 799 } |
785 | 800 |
786 void PaintLayerCompositor::fullyInvalidatePaint() { | 801 void PaintLayerCompositor::fullyInvalidatePaint() { |
787 // We're walking all compositing layers and invalidating them, so there's | 802 // We're walking all compositing layers and invalidating them, so there's |
788 // no need to have up-to-date compositing state. | 803 // no need to have up-to-date compositing state. |
789 DisableCompositingQueryAsserts disabler; | 804 DisableCompositingQueryAsserts disabler; |
790 fullyInvalidatePaintRecursive(rootLayer()); | 805 fullyInvalidatePaintRecursive(rootLayer()); |
791 } | 806 } |
792 | 807 |
793 PaintLayer* PaintLayerCompositor::rootLayer() const { | 808 PaintLayer* PaintLayerCompositor::rootLayer() const { |
794 return m_layoutView.layer(); | 809 return m_layoutView.layer(); |
795 } | 810 } |
796 | 811 |
797 GraphicsLayer* PaintLayerCompositor::rootGraphicsLayer() const { | 812 GraphicsLayer* PaintLayerCompositor::rootGraphicsLayer() const { |
798 return m_overflowControlsHostLayer.get(); | 813 if (m_overflowControlsHostLayer) |
799 } | 814 return m_overflowControlsHostLayer.get(); |
800 | 815 if (CompositedLayerMapping* clm = rootLayer()->compositedLayerMapping()) |
801 GraphicsLayer* PaintLayerCompositor::frameScrollLayer() const { | 816 return clm->childForSuperlayers(); |
802 return m_scrollLayer.get(); | 817 return nullptr; |
803 } | 818 } |
804 | 819 |
805 GraphicsLayer* PaintLayerCompositor::scrollLayer() const { | 820 GraphicsLayer* PaintLayerCompositor::scrollLayer() const { |
806 if (ScrollableArea* scrollableArea = | 821 if (ScrollableArea* scrollableArea = |
807 m_layoutView.frameView()->getScrollableArea()) | 822 m_layoutView.frameView()->getScrollableArea()) |
808 return scrollableArea->layerForScrolling(); | 823 return scrollableArea->layerForScrolling(); |
809 return nullptr; | 824 return nullptr; |
810 } | 825 } |
811 | 826 |
812 GraphicsLayer* PaintLayerCompositor::containerLayer() const { | |
813 return m_containerLayer.get(); | |
814 } | |
815 | |
816 GraphicsLayer* PaintLayerCompositor::rootContentLayer() const { | |
817 return m_rootContentLayer.get(); | |
818 } | |
819 | |
820 void PaintLayerCompositor::setIsInWindow(bool isInWindow) { | 827 void PaintLayerCompositor::setIsInWindow(bool isInWindow) { |
821 if (!staleInCompositingMode()) | 828 if (!staleInCompositingMode()) |
822 return; | 829 return; |
823 | 830 |
824 if (isInWindow) { | 831 if (isInWindow) { |
825 if (m_rootLayerAttachment != RootLayerUnattached) | 832 if (m_rootLayerAttachment != RootLayerUnattached) |
826 return; | 833 return; |
827 | 834 |
828 attachCompositorTimeline(); | 835 attachCompositorTimeline(); |
829 attachRootLayer(); | 836 attachRootLayer(); |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1114 m_layoutView.frameView()->positionScrollbarLayers(); | 1121 m_layoutView.frameView()->positionScrollbarLayers(); |
1115 } | 1122 } |
1116 | 1123 |
1117 void PaintLayerCompositor::ensureRootLayer() { | 1124 void PaintLayerCompositor::ensureRootLayer() { |
1118 if (m_rootLayerAttachment != RootLayerUnattached) | 1125 if (m_rootLayerAttachment != RootLayerUnattached) |
1119 return; | 1126 return; |
1120 | 1127 |
1121 if (isMainFrame()) | 1128 if (isMainFrame()) |
1122 visualViewport().createLayerTree(); | 1129 visualViewport().createLayerTree(); |
1123 | 1130 |
1124 if (!m_rootContentLayer) { | 1131 // When RLS is enabled, none of the PLC GraphicsLayers exist. |
| 1132 bool shouldCreateOwnLayers = |
| 1133 !RuntimeEnabledFeatures::rootLayerScrollingEnabled(); |
| 1134 |
| 1135 if (shouldCreateOwnLayers && !m_rootContentLayer) { |
1125 m_rootContentLayer = GraphicsLayer::create(this); | 1136 m_rootContentLayer = GraphicsLayer::create(this); |
1126 IntRect overflowRect = m_layoutView.pixelSnappedLayoutOverflowRect(); | 1137 IntRect overflowRect = m_layoutView.pixelSnappedLayoutOverflowRect(); |
1127 m_rootContentLayer->setSize( | 1138 m_rootContentLayer->setSize( |
1128 FloatSize(overflowRect.maxX(), overflowRect.maxY())); | 1139 FloatSize(overflowRect.maxX(), overflowRect.maxY())); |
1129 m_rootContentLayer->setPosition(FloatPoint()); | 1140 m_rootContentLayer->setPosition(FloatPoint()); |
1130 m_rootContentLayer->setOwnerNodeId( | 1141 m_rootContentLayer->setOwnerNodeId( |
1131 DOMNodeIds::idForNode(m_layoutView.node())); | 1142 DOMNodeIds::idForNode(m_layoutView.node())); |
1132 } | 1143 } |
1133 | 1144 |
1134 if (!m_overflowControlsHostLayer) { | 1145 if (shouldCreateOwnLayers && !m_overflowControlsHostLayer) { |
1135 ASSERT(!m_scrollLayer); | 1146 ASSERT(!m_scrollLayer); |
1136 ASSERT(!m_containerLayer); | 1147 ASSERT(!m_containerLayer); |
1137 | 1148 |
1138 // Create a layer to host the clipping layer and the overflow controls | 1149 // Create a layer to host the clipping layer and the overflow controls |
1139 // layers. Whether these layers mask the content below is determined | 1150 // layers. Whether these layers mask the content below is determined |
1140 // in updateClippingOnCompositorLayers. | 1151 // in updateClippingOnCompositorLayers. |
1141 m_overflowControlsHostLayer = GraphicsLayer::create(this); | 1152 m_overflowControlsHostLayer = GraphicsLayer::create(this); |
1142 m_containerLayer = GraphicsLayer::create(this); | 1153 m_containerLayer = GraphicsLayer::create(this); |
1143 | |
1144 // TODO(skobes): When root layer scrolling is enabled, we should not even | |
1145 // create m_scrollLayer or most of the layers in PLC. | |
1146 m_scrollLayer = GraphicsLayer::create(this); | 1154 m_scrollLayer = GraphicsLayer::create(this); |
1147 if (ScrollingCoordinator* scrollingCoordinator = | 1155 if (ScrollingCoordinator* scrollingCoordinator = |
1148 this->scrollingCoordinator()) | 1156 this->scrollingCoordinator()) |
1149 scrollingCoordinator->setLayerIsContainerForFixedPositionLayers( | 1157 scrollingCoordinator->setLayerIsContainerForFixedPositionLayers( |
1150 m_scrollLayer.get(), true); | 1158 m_scrollLayer.get(), true); |
1151 | 1159 |
1152 // In RLS mode, LayoutView scrolling contents layer gets this element ID (in | 1160 // In RLS mode, LayoutView scrolling contents layer gets this element ID (in |
1153 // CompositedLayerMapping::updateElementIdAndCompositorMutableProperties). | 1161 // CompositedLayerMapping::updateElementIdAndCompositorMutableProperties). |
1154 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 1162 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
1155 m_scrollLayer->setElementId(createCompositorElementId( | 1163 m_scrollLayer->setElementId(createCompositorElementId( |
1156 DOMNodeIds::idForNode(&m_layoutView.document()), | 1164 DOMNodeIds::idForNode(&m_layoutView.document()), |
1157 CompositorSubElementId::Scroll)); | 1165 CompositorSubElementId::Scroll)); |
1158 } | 1166 } |
1159 | 1167 |
1160 // Hook them up | 1168 // Hook them up |
1161 m_overflowControlsHostLayer->addChild(m_containerLayer.get()); | 1169 m_overflowControlsHostLayer->addChild(m_containerLayer.get()); |
1162 m_containerLayer->addChild(m_scrollLayer.get()); | 1170 m_containerLayer->addChild(m_scrollLayer.get()); |
1163 m_scrollLayer->addChild(m_rootContentLayer.get()); | 1171 m_scrollLayer->addChild(m_rootContentLayer.get()); |
1164 | 1172 |
1165 frameViewDidChangeSize(); | 1173 frameViewDidChangeSize(); |
1166 } | 1174 } |
1167 | 1175 |
1168 attachCompositorTimeline(); | 1176 attachCompositorTimeline(); |
1169 attachRootLayer(); | 1177 attachRootLayer(); |
1170 } | 1178 } |
1171 | 1179 |
1172 void PaintLayerCompositor::destroyRootLayer() { | 1180 void PaintLayerCompositor::destroyRootLayer() { |
1173 if (!m_rootContentLayer) | |
1174 return; | |
1175 | |
1176 detachRootLayer(); | 1181 detachRootLayer(); |
1177 | 1182 |
1178 if (m_layerForHorizontalScrollbar) { | 1183 if (m_layerForHorizontalScrollbar) { |
1179 m_layerForHorizontalScrollbar->removeFromParent(); | 1184 m_layerForHorizontalScrollbar->removeFromParent(); |
1180 m_layerForHorizontalScrollbar = nullptr; | 1185 m_layerForHorizontalScrollbar = nullptr; |
1181 if (ScrollingCoordinator* scrollingCoordinator = | 1186 if (ScrollingCoordinator* scrollingCoordinator = |
1182 this->scrollingCoordinator()) | 1187 this->scrollingCoordinator()) |
1183 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange( | 1188 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange( |
1184 m_layoutView.frameView(), HorizontalScrollbar); | 1189 m_layoutView.frameView(), HorizontalScrollbar); |
1185 m_layoutView.frameView()->setScrollbarNeedsPaintInvalidation( | 1190 m_layoutView.frameView()->setScrollbarNeedsPaintInvalidation( |
(...skipping 19 matching lines...) Expand all Loading... |
1205 if (m_overflowControlsHostLayer) { | 1210 if (m_overflowControlsHostLayer) { |
1206 m_overflowControlsHostLayer = nullptr; | 1211 m_overflowControlsHostLayer = nullptr; |
1207 m_containerLayer = nullptr; | 1212 m_containerLayer = nullptr; |
1208 m_scrollLayer = nullptr; | 1213 m_scrollLayer = nullptr; |
1209 } | 1214 } |
1210 ASSERT(!m_scrollLayer); | 1215 ASSERT(!m_scrollLayer); |
1211 m_rootContentLayer = nullptr; | 1216 m_rootContentLayer = nullptr; |
1212 } | 1217 } |
1213 | 1218 |
1214 void PaintLayerCompositor::attachRootLayer() { | 1219 void PaintLayerCompositor::attachRootLayer() { |
1215 if (!m_rootContentLayer) | |
1216 return; | |
1217 | |
1218 // In Slimming Paint v2, PaintArtifactCompositor is responsible for the root | 1220 // In Slimming Paint v2, PaintArtifactCompositor is responsible for the root |
1219 // layer. | 1221 // layer. |
1220 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | 1222 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
1221 return; | 1223 return; |
1222 | 1224 |
1223 if (m_layoutView.frame()->isLocalRoot()) { | 1225 if (m_layoutView.frame()->isLocalRoot()) { |
1224 m_rootLayerAttachment = RootLayerPendingAttachViaChromeClient; | 1226 m_rootLayerAttachment = RootLayerPendingAttachViaChromeClient; |
1225 } else { | 1227 } else { |
1226 HTMLFrameOwnerElement* ownerElement = m_layoutView.document().localOwner(); | 1228 HTMLFrameOwnerElement* ownerElement = m_layoutView.document().localOwner(); |
1227 DCHECK(ownerElement); | 1229 DCHECK(ownerElement); |
1228 // The layer will get hooked up via | 1230 // The layer will get hooked up via |
1229 // CompositedLayerMapping::updateGraphicsLayerConfiguration() for the | 1231 // CompositedLayerMapping::updateGraphicsLayerConfiguration() for the |
1230 // frame's layoutObject in the parent document. | 1232 // frame's layoutObject in the parent document. |
1231 ownerElement->setNeedsCompositingUpdate(); | 1233 ownerElement->setNeedsCompositingUpdate(); |
1232 m_rootLayerAttachment = RootLayerAttachedViaEnclosingFrame; | 1234 m_rootLayerAttachment = RootLayerAttachedViaEnclosingFrame; |
1233 } | 1235 } |
1234 } | 1236 } |
1235 | 1237 |
1236 void PaintLayerCompositor::detachRootLayer() { | 1238 void PaintLayerCompositor::detachRootLayer() { |
1237 if (!m_rootContentLayer || m_rootLayerAttachment == RootLayerUnattached) | 1239 if (m_rootLayerAttachment == RootLayerUnattached) |
1238 return; | 1240 return; |
1239 | 1241 |
1240 switch (m_rootLayerAttachment) { | 1242 switch (m_rootLayerAttachment) { |
1241 case RootLayerAttachedViaEnclosingFrame: { | 1243 case RootLayerAttachedViaEnclosingFrame: { |
1242 // The layer will get unhooked up via | 1244 // The layer will get unhooked up via |
1243 // CompositedLayerMapping::updateGraphicsLayerConfiguration() for the | 1245 // CompositedLayerMapping::updateGraphicsLayerConfiguration() for the |
1244 // frame's layoutObject in the parent document. | 1246 // frame's layoutObject in the parent document. |
1245 if (m_overflowControlsHostLayer) | 1247 if (m_overflowControlsHostLayer) |
1246 m_overflowControlsHostLayer->removeFromParent(); | 1248 m_overflowControlsHostLayer->removeFromParent(); |
1247 else | |
1248 m_rootContentLayer->removeFromParent(); | |
1249 | 1249 |
1250 if (HTMLFrameOwnerElement* ownerElement = | 1250 if (HTMLFrameOwnerElement* ownerElement = |
1251 m_layoutView.document().localOwner()) | 1251 m_layoutView.document().localOwner()) |
1252 ownerElement->setNeedsCompositingUpdate(); | 1252 ownerElement->setNeedsCompositingUpdate(); |
1253 break; | 1253 break; |
1254 } | 1254 } |
1255 case RootLayerAttachedViaChromeClient: { | 1255 case RootLayerAttachedViaChromeClient: { |
1256 LocalFrame& frame = m_layoutView.frameView()->frame(); | 1256 LocalFrame& frame = m_layoutView.frameView()->frame(); |
1257 Page* page = frame.page(); | 1257 Page* page = frame.page(); |
1258 if (!page) | 1258 if (!page) |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1335 } else if (graphicsLayer == m_scrollLayer.get()) { | 1335 } else if (graphicsLayer == m_scrollLayer.get()) { |
1336 name = "Frame Scrolling Layer"; | 1336 name = "Frame Scrolling Layer"; |
1337 } else { | 1337 } else { |
1338 ASSERT_NOT_REACHED(); | 1338 ASSERT_NOT_REACHED(); |
1339 } | 1339 } |
1340 | 1340 |
1341 return name; | 1341 return name; |
1342 } | 1342 } |
1343 | 1343 |
1344 } // namespace blink | 1344 } // namespace blink |
OLD | NEW |