Delete dead painting code around m_pendingSheetLayout.

m_pendingSheetLayout is never set to a non-default value.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/837633003
This commit is contained in:
Ojan Vafai 2015-01-12 17:15:26 -08:00
parent 544a24a448
commit 1729b054e2
4 changed files with 2 additions and 40 deletions

View File

@ -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<Node> newHoverNode)

View File

@ -445,11 +445,6 @@ public:
void pushCurrentScript(PassRefPtr<HTMLScriptElement>);
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<CanvasRenderingContext2D>&, RefPtr<WebGLRenderingContext>&);
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<LocalDOMWindow> m_domWindow;
// FIXME: oilpan: when we get rid of the transition types change the

View File

@ -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.

View File

@ -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;