Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(649)

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp

Issue 1827043003: Disable subsequence caching when didLayoutWithPendingStylesheets is true. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/DocumentLoadingRenderingTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
index 247131c992ee286e3388696ab902b38545ceef4c..9855530a2d82a77c5e66a6b989a8497cea3fe0d3 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -36,12 +36,12 @@
namespace blink {
-static inline bool shouldSuppressPaintingLayer(PaintLayer* layer)
+static inline bool shouldSuppressPaintingLayer(const PaintLayer& layer)
{
// Avoid painting descendants of the root layer when stylesheets haven't loaded. This eliminates FOUC.
// It's ok not to draw, because later on, when all the stylesheets do load, updateStyleSelector on the Document
// will do a full paintInvalidationForWholeLayoutObject().
- if (layer->layoutObject()->document().didLayoutWithPendingStylesheets() && !layer->isRootLayer() && !layer->layoutObject()->isDocumentElement())
+ if (layer.layoutObject()->document().didLayoutWithPendingStylesheets() && !layer.isRootLayer() && !layer.layoutObject()->isDocumentElement())
return true;
return false;
@@ -77,7 +77,7 @@ PaintLayerPainter::PaintResult PaintLayerPainter::paintLayer(GraphicsContext& co
if (!m_paintLayer.isSelfPaintingLayer() && !m_paintLayer.hasSelfPaintingLayerDescendant())
return FullyPainted;
- if (shouldSuppressPaintingLayer(&m_paintLayer))
+ if (shouldSuppressPaintingLayer(m_paintLayer))
return FullyPainted;
if (m_paintLayer.layoutObject()->isLayoutView() && toLayoutView(m_paintLayer.layoutObject())->frameView()->shouldThrottleRendering())
@@ -209,6 +209,12 @@ static bool shouldCreateSubsequence(const PaintLayer& paintLayer, GraphicsContex
if (!PaintLayerStackingNodeIterator(*paintLayer.stackingNode(), AllChildren).next())
return false;
+ // When in FOUC-avoidance mode, don't cache any subsequences, to avoid having
+ // to invalidate all of them when leaving this mode. There is an early-out in BlockPainter::paintContents that may result
+ // in nothing getting painted in thos mode, in addition to early-out logic in PaintLayerPainter.
+ if (paintLayer.layoutObject()->document().didLayoutWithPendingStylesheets())
+ return false;
+
return true;
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/DocumentLoadingRenderingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698