diff --git a/engine/core/dom/Document.cpp b/engine/core/dom/Document.cpp index 25f6ef19940..f2d6ac805db 100644 --- a/engine/core/dom/Document.cpp +++ b/engine/core/dom/Document.cpp @@ -242,7 +242,6 @@ Document::Document(const DocumentInit& initializer, DocumentClassFlags documentC , TreeScope(*this) , m_module(nullptr) , m_evaluateMediaQueriesOnStyleRecalc(false) - , m_pendingSheetLayout(NoLayoutWithPendingSheets) , m_frame(initializer.frame()) , m_domWindow(m_frame ? m_frame->domWindow() : 0) , m_importsController(initializer.importsController()) @@ -1640,15 +1639,7 @@ void Document::styleResolverChanged() // We just skip that case. if (!m_styleEngine) return; - m_styleEngine->resolverChanged(); - - // FIXME(sky): didLayoutWithPendingStylesheets never returns true anymore. Remove this. - if (didLayoutWithPendingStylesheets()) { - // We need to manually repaint because we avoid doing all repaints in layout or style - // recalc while sheets are still loading to avoid FOUC. - m_pendingSheetLayout = IgnoreLayoutWithPendingSheets; - } } void Document::setHoverNode(PassRefPtr newHoverNode) diff --git a/engine/core/dom/Document.h b/engine/core/dom/Document.h index a0f4f13dade..d02dc770210 100644 --- a/engine/core/dom/Document.h +++ b/engine/core/dom/Document.h @@ -445,11 +445,6 @@ public: void pushCurrentScript(PassRefPtr); void popCurrentScript(); - enum PendingSheetLayout { NoLayoutWithPendingSheets, DidLayoutWithPendingSheets, IgnoreLayoutWithPendingSheets }; - - bool didLayoutWithPendingStylesheets() const { return m_pendingSheetLayout == DidLayoutWithPendingSheets; } - bool ignoreLayoutWithPendingStylesheets() const { return m_pendingSheetLayout == IgnoreLayoutWithPendingSheets; } - // Extension for manipulating canvas drawing contexts for use in CSS void getCSSCanvasContext(const String& type, const String& name, int width, int height, RefPtr&, RefPtr&); HTMLCanvasElement& getCSSCanvasElement(const String& name); @@ -662,11 +657,6 @@ private: bool m_evaluateMediaQueriesOnStyleRecalc; - // If we do ignore the pending stylesheet count, then we need to add a boolean - // to track that this happened so that we can do a full repaint when the stylesheets - // do eventually load. - PendingSheetLayout m_pendingSheetLayout; - LocalFrame* m_frame; RawPtr m_domWindow; // FIXME: oilpan: when we get rid of the transition types change the diff --git a/engine/core/rendering/RenderBlock.cpp b/engine/core/rendering/RenderBlock.cpp index 00cc6d52759..bd99cd42dae 100644 --- a/engine/core/rendering/RenderBlock.cpp +++ b/engine/core/rendering/RenderBlock.cpp @@ -658,13 +658,8 @@ void RenderBlock::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffs if (paintPhase == PaintPhaseBlockBackground) return; - if (paintPhase != PaintPhaseSelfOutline) { - // Avoid painting descendants of the root element when stylesheets haven't loaded. This eliminates FOUC. - // It's ok not to draw, because later on, when all the stylesheets do load, styleResolverChanged() on the Document - // will do a full paint invalidation. - if (!document().didLayoutWithPendingStylesheets() || isRenderView()) - paintContents(paintInfo, scrolledOffset); - } + if (paintPhase != PaintPhaseSelfOutline) + paintContents(paintInfo, scrolledOffset); paintSelection(paintInfo, scrolledOffset); // Fill in gaps in selection on lines and between blocks. diff --git a/engine/core/rendering/RenderLayer.cpp b/engine/core/rendering/RenderLayer.cpp index b020b23408f..769644107ad 100644 --- a/engine/core/rendering/RenderLayer.cpp +++ b/engine/core/rendering/RenderLayer.cpp @@ -909,26 +909,12 @@ void RenderLayer::restoreClip(GraphicsContext* context, const LayoutRect& paintD context->restore(); } -static inline bool shouldSuppressPaintingLayer(RenderLayer* 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 paintInvalidationForWholeRenderer(). - if (layer->renderer()->document().didLayoutWithPendingStylesheets() && !layer->isRootLayer() && !layer->renderer()->isDocumentElement()) - return true; - - return false; -} - void RenderLayer::paintLayer(GraphicsContext* context, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags) { // Non self-painting leaf layers don't need to be painted as their renderer() should properly paint itself. if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) return; - if (shouldSuppressPaintingLayer(this)) - return; - // If this layer is totally invisible then there is nothing to paint. if (!renderer()->opacity()) return;