Changeset 241788 in webkit
- Timestamp:
- Feb 19, 2019 5:39:34 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r241787 r241788 1 2019-02-19 Simon Fraser <simon.fraser@apple.com> 2 3 REGRESSION (r238090): Toggling visibility on the <html> element can result in a blank web view 4 https://bugs.webkit.org/show_bug.cgi?id=194827 5 rdar://problem/47620594 6 7 Reviewed by Antti Koivisto. 8 9 Test dumps layer tree with RenderLayerBacking::shouldDumpPropertyForLayer to show that the root has (drawsContent 1) 10 11 * compositing/visibility/root-visibility-toggle-expected.txt: Added. 12 * compositing/visibility/root-visibility-toggle.html: Added. 13 * platform/mac-wk1/compositing/visibility/root-visibility-toggle-expected.txt: Added. 14 1 15 2019-02-19 Joseph Pecoraro <pecoraro@apple.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r241780 r241788 1 2019-02-19 Simon Fraser <simon.fraser@apple.com> 2 3 REGRESSION (r238090): Toggling visibility on the <html> element can result in a blank web view 4 https://bugs.webkit.org/show_bug.cgi?id=194827 5 rdar://problem/47620594 6 7 Reviewed by Antti Koivisto. 8 9 Incremental compositing updates, added in rr238090, use repaints as a trigger for re-evaluating 10 layer configurations, since a repaint implies that a layer gains painted content. This is done 11 via the call to setNeedsCompositingConfigurationUpdate() in RenderLayerBacking::setContentsNeedDisplay{InRect}. 12 The RenderView's layer is opted out of this to avoid doing lots of redundant layer config recomputation 13 for the root. The configuration state that matters here is whether the layer contains painted content, 14 and therefore needs backing store; this is computed by RenderLayerBacking::isSimpleContainerCompositingLayer(), 15 and feeds into GraphicsLayer::drawsContent(). 16 17 However, if <html> starts as "visibility:hidden" or "opacity:0", as some sites do to hide incremental loading, 18 then we'll fail to recompute 'drawsContent' for the root and leave the root with drawsContent=false, which 19 causes RenderLayerBacking::setContentsNeedDisplay{InRect} to short-circuit, and then we paint nothing. 20 21 Ironically, 'drawsContent' doesn't actually save any backing store for the root, since it has no affect on 22 the root tile caches; we always make tiles. So the simple fix here is to change RenderLayerBacking::isSimpleContainerCompositingLayer() 23 to always return false for the RenderView's layer (the root). 24 25 Testing this was tricky; ref testing doesn't work because we force repaint, and we normally skip 26 properties of the root in layer tree dumps to hide WK1/WK2 differences. Therefore I had to add 27 LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES and fix RenderLayerBacking::shouldDumpPropertyForLayer to 28 respect it. 29 30 Test: compositing/visibility/root-visibility-toggle.html 31 32 * page/Frame.h: 33 * platform/graphics/GraphicsLayer.cpp: 34 (WebCore::GraphicsLayer::dumpProperties const): 35 * platform/graphics/GraphicsLayerClient.h: 36 (WebCore::GraphicsLayerClient::shouldDumpPropertyForLayer const): 37 * rendering/RenderLayerBacking.cpp: 38 (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const): 39 (WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const): 40 * rendering/RenderLayerBacking.h: 41 * rendering/RenderLayerCompositor.cpp: 42 (WebCore::RenderLayerCompositor::layerTreeAsText): 43 * testing/Internals.cpp: 44 (WebCore::toLayerTreeFlags): 45 * testing/Internals.h: 46 * testing/Internals.idl: 47 1 48 2019-02-19 Ryosuke Niwa <rniwa@webkit.org> 2 49 -
trunk/Source/WebCore/page/Frame.h
r241320 r241788 115 115 LayerTreeFlagsIncludeAcceleratesDrawing = 1 << 6, 116 116 LayerTreeFlagsIncludeBackingStoreAttached = 1 << 7, 117 LayerTreeFlagsIncludeRootLayerProperties = 1 << 8, 117 118 }; 118 119 typedef unsigned LayerTreeFlags; -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp
r241183 r241788 837 837 ts << indent << "(preserves3D " << m_preserves3D << ")\n"; 838 838 839 if (m_drawsContent && client().shouldDumpPropertyForLayer(this, "drawsContent" ))839 if (m_drawsContent && client().shouldDumpPropertyForLayer(this, "drawsContent", behavior)) 840 840 ts << indent << "(drawsContent " << m_drawsContent << ")\n"; 841 841 … … 851 851 } 852 852 853 if (m_backgroundColor.isValid() && client().shouldDumpPropertyForLayer(this, "backgroundColor" ))853 if (m_backgroundColor.isValid() && client().shouldDumpPropertyForLayer(this, "backgroundColor", behavior)) 854 854 ts << indent << "(backgroundColor " << m_backgroundColor.nameForRenderTreeAsText() << ")\n"; 855 855 … … 905 905 } 906 906 907 if (behavior & LayerTreeAsTextIncludeRepaintRects && repaintRectMap().contains(this) && !repaintRectMap().get(this).isEmpty() && client().shouldDumpPropertyForLayer(this, "repaintRects" )) {907 if (behavior & LayerTreeAsTextIncludeRepaintRects && repaintRectMap().contains(this) && !repaintRectMap().get(this).isEmpty() && client().shouldDumpPropertyForLayer(this, "repaintRects", behavior)) { 908 908 ts << indent << "(repaint rects\n"; 909 909 for (size_t i = 0; i < repaintRectMap().get(this).size(); ++i) { -
trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h
r240047 r241788 73 73 LayerTreeAsTextIncludeAcceleratesDrawing = 1 << 7, 74 74 LayerTreeAsTextIncludeBackingStoreAttached = 1 << 8, 75 LayerTreeAsTextIncludeRootLayerProperties = 1 << 9, 75 76 LayerTreeAsTextShowAll = 0xFFFF 76 77 }; … … 124 125 125 126 virtual bool shouldSkipLayerInDump(const GraphicsLayer*, LayerTreeAsTextBehavior) const { return false; } 126 virtual bool shouldDumpPropertyForLayer(const GraphicsLayer*, const char* ) const { return true; }127 virtual bool shouldDumpPropertyForLayer(const GraphicsLayer*, const char*, LayerTreeAsTextBehavior) const { return true; } 127 128 128 129 virtual bool shouldAggressivelyRetainTiles(const GraphicsLayer*) const { return false; } -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r240941 r241788 2100 2100 bool RenderLayerBacking::isSimpleContainerCompositingLayer(PaintedContentsInfo& contentsInfo) const 2101 2101 { 2102 if (m_owningLayer.isRenderViewLayer()) 2103 return false; 2104 2102 2105 if (renderer().isRenderReplaced() && (!isCompositedPlugin(renderer()) || isRestartedPlugin(renderer()))) 2103 2106 return false; … … 2114 2117 if (renderer().isDocumentElementRenderer() && m_owningLayer.isolatesCompositedBlending()) 2115 2118 return false; 2116 2117 if (renderer().isRenderView()) {2118 // Look to see if the root object has a non-simple background2119 auto* rootObject = renderer().document().documentElement() ? renderer().document().documentElement()->renderer() : nullptr;2120 if (!rootObject)2121 return false;2122 2123 // Reject anything that has a border, a border-radius or outline,2124 // or is not a simple background (no background, or solid color).2125 if (hasPaintedBoxDecorationsOrBackgroundImage(rootObject->style()))2126 return false;2127 2128 // Now look at the body's renderer.2129 auto* body = renderer().document().body();2130 if (!body)2131 return false;2132 auto* bodyRenderer = body->renderer();2133 if (!bodyRenderer)2134 return false;2135 2136 if (hasPaintedBoxDecorationsOrBackgroundImage(bodyRenderer->style()))2137 return false;2138 }2139 2119 2140 2120 return true; … … 2725 2705 } 2726 2706 2727 bool RenderLayerBacking::shouldDumpPropertyForLayer(const GraphicsLayer* layer, const char* propertyName ) const2707 bool RenderLayerBacking::shouldDumpPropertyForLayer(const GraphicsLayer* layer, const char* propertyName, LayerTreeAsTextBehavior flags) const 2728 2708 { 2729 2709 // For backwards compatibility with WebKit1 and other platforms, 2730 2710 // skip some properties on the root tile cache. 2731 if (m_isMainFrameRenderViewLayer && layer == m_graphicsLayer.get() ) {2711 if (m_isMainFrameRenderViewLayer && layer == m_graphicsLayer.get() && !(flags & LayerTreeAsTextIncludeRootLayerProperties)) { 2732 2712 if (!strcmp(propertyName, "drawsContent")) 2733 2713 return false; -
trunk/Source/WebCore/rendering/RenderLayerBacking.h
r240899 r241788 228 228 bool isTrackingRepaints() const override; 229 229 bool shouldSkipLayerInDump(const GraphicsLayer*, LayerTreeAsTextBehavior) const override; 230 bool shouldDumpPropertyForLayer(const GraphicsLayer*, const char* propertyName ) const override;230 bool shouldDumpPropertyForLayer(const GraphicsLayer*, const char* propertyName, LayerTreeAsTextBehavior) const override; 231 231 232 232 bool shouldAggressivelyRetainTiles(const GraphicsLayer*) const override; -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r240940 r241788 1919 1919 if (flags & LayerTreeFlagsIncludeBackingStoreAttached) 1920 1920 layerTreeBehavior |= LayerTreeAsTextIncludeBackingStoreAttached; 1921 if (flags & LayerTreeFlagsIncludeRootLayerProperties) 1922 layerTreeBehavior |= LayerTreeAsTextIncludeRootLayerProperties; 1921 1923 1922 1924 // We skip dumping the scroll and clip layers to keep layerTreeAsText output … … 1926 1928 // Dump an empty layer tree only if the only composited layer is the main frame's tiled backing, 1927 1929 // so that tests expecting us to drop out of accelerated compositing when there are no layers succeed. 1928 if (!hasContentCompositingLayers() && documentUsesTiledBacking() && !(layerTreeBehavior & LayerTreeAsTextIncludeTileCaches) )1930 if (!hasContentCompositingLayers() && documentUsesTiledBacking() && !(layerTreeBehavior & LayerTreeAsTextIncludeTileCaches) && !(layerTreeBehavior & LayerTreeAsTextIncludeRootLayerProperties)) 1929 1931 layerTreeText = emptyString(); 1930 1932 -
trunk/Source/WebCore/testing/Internals.cpp
r241761 r241788 2516 2516 if (flags & Internals::LAYER_TREE_INCLUDES_BACKING_STORE_ATTACHED) 2517 2517 layerTreeFlags |= LayerTreeFlagsIncludeBackingStoreAttached; 2518 if (flags & Internals::LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES) 2519 layerTreeFlags |= LayerTreeFlagsIncludeRootLayerProperties; 2518 2520 2519 2521 return layerTreeFlags; -
trunk/Source/WebCore/testing/Internals.h
r241761 r241788 348 348 LAYER_TREE_INCLUDES_ACCELERATES_DRAWING = 32, 349 349 LAYER_TREE_INCLUDES_BACKING_STORE_ATTACHED = 64, 350 LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES = 128, 350 351 }; 351 352 ExceptionOr<String> layerTreeAsText(Document&, unsigned short flags) const; -
trunk/Source/WebCore/testing/Internals.idl
r241761 r241788 373 373 const unsigned short LAYER_TREE_INCLUDES_ACCELERATES_DRAWING = 32; 374 374 const unsigned short LAYER_TREE_INCLUDES_BACKING_STORE_ATTACHED = 64; 375 const unsigned short LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES = 128; 375 376 [MayThrowException] DOMString layerTreeAsText(Document document, optional unsigned short flags = 0); 376 377
Note: See TracChangeset
for help on using the changeset viewer.