Index: third_party/WebKit/Source/core/paint/BlockFlowPainter.cpp |
diff --git a/third_party/WebKit/Source/core/paint/BlockFlowPainter.cpp b/third_party/WebKit/Source/core/paint/BlockFlowPainter.cpp |
index a36a6003e736455472f78e6bd44d374bfd2e3cd7..ecc3e67b6d82dbe9b469532517bdb395c9b029bf 100644 |
--- a/third_party/WebKit/Source/core/paint/BlockFlowPainter.cpp |
+++ b/third_party/WebKit/Source/core/paint/BlockFlowPainter.cpp |
@@ -6,14 +6,31 @@ |
#include "core/layout/FloatingObjects.h" |
#include "core/layout/LayoutBlockFlow.h" |
-#include "core/paint/ClipScope.h" |
-#include "core/paint/LayoutObjectDrawingRecorder.h" |
+#include "core/paint/BlockPainter.h" |
+#include "core/paint/LineBoxListPainter.h" |
#include "core/paint/ObjectPainter.h" |
#include "core/paint/PaintInfo.h" |
-#include "core/paint/PaintLayer.h" |
namespace blink { |
+void BlockFlowPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
+{ |
+ // 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, styleResolverMayHaveChanged() |
+ // on Document will trigger a full paint invalidation. |
+ if (m_layoutBlockFlow.document().didLayoutWithPendingStylesheets() && !m_layoutBlockFlow.isLayoutView()) |
+ return; |
+ |
+ if (!m_layoutBlockFlow.childrenInline()) { |
+ BlockPainter(m_layoutBlockFlow).paintContents(paintInfo, paintOffset); |
+ return; |
+ } |
+ if (shouldPaintDescendantOutlines(paintInfo.phase)) |
+ ObjectPainter(m_layoutBlockFlow).paintInlineChildrenOutlines(paintInfo, paintOffset); |
+ else |
+ LineBoxListPainter(m_layoutBlockFlow.lineBoxes()).paint(m_layoutBlockFlow, paintInfo, paintOffset); |
+} |
+ |
void BlockFlowPainter::paintFloats(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
{ |
if (!m_layoutBlockFlow.floatingObjects()) |