OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/paint/BlockPainter.h" | 6 #include "core/paint/BlockPainter.h" |
7 | 7 |
8 #include "core/editing/DragCaretController.h" | 8 #include "core/editing/DragCaretController.h" |
9 #include "core/editing/FrameSelection.h" | 9 #include "core/editing/FrameSelection.h" |
10 #include "core/frame/Settings.h" | 10 #include "core/frame/Settings.h" |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 283 |
284 bool BlockPainter::hasCaret() const | 284 bool BlockPainter::hasCaret() const |
285 { | 285 { |
286 LocalFrame* frame = m_layoutBlock.frame(); | 286 LocalFrame* frame = m_layoutBlock.frame(); |
287 return hasCursorCaret(frame->selection(), &m_layoutBlock, frame) | 287 return hasCursorCaret(frame->selection(), &m_layoutBlock, frame) |
288 || hasDragCaret(frame->page()->dragCaretController(), &m_layoutBlock, fr
ame); | 288 || hasDragCaret(frame->page()->dragCaretController(), &m_layoutBlock, fr
ame); |
289 } | 289 } |
290 | 290 |
291 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) | 291 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) |
292 { | 292 { |
| 293 // Avoid painting descendants of the root element when stylesheets haven't l
oaded. This eliminates FOUC. |
| 294 // It's ok not to draw, because later on, when all the stylesheets do load,
styleResolverChanged() on the Document |
| 295 // will do a full paint invalidation. |
| 296 if (m_layoutBlock.document().didLayoutWithPendingStylesheets() && !m_layoutB
lock.isLayoutView()) |
| 297 return; |
| 298 |
293 if (m_layoutBlock.childrenInline()) { | 299 if (m_layoutBlock.childrenInline()) { |
294 LineBoxListPainter(*m_layoutBlock.lineBoxes()).paint(&m_layoutBlock, pai
ntInfo, paintOffset); | 300 LineBoxListPainter(*m_layoutBlock.lineBoxes()).paint(&m_layoutBlock, pai
ntInfo, paintOffset); |
295 } else { | 301 } else { |
296 PaintPhase newPhase = (paintInfo.phase == PaintPhaseChildOutlines) ? Pai
ntPhaseOutline : paintInfo.phase; | 302 PaintPhase newPhase = (paintInfo.phase == PaintPhaseChildOutlines) ? Pai
ntPhaseOutline : paintInfo.phase; |
297 newPhase = (newPhase == PaintPhaseChildBlockBackgrounds) ? PaintPhaseChi
ldBlockBackground : newPhase; | 303 newPhase = (newPhase == PaintPhaseChildBlockBackgrounds) ? PaintPhaseChi
ldBlockBackground : newPhase; |
298 | 304 |
299 // We don't paint our own background, but we do let the kids paint their
backgrounds. | 305 // We don't paint our own background, but we do let the kids paint their
backgrounds. |
300 PaintInfo paintInfoForChild(paintInfo); | 306 PaintInfo paintInfoForChild(paintInfo); |
301 paintInfoForChild.phase = newPhase; | 307 paintInfoForChild.phase = newPhase; |
302 paintInfoForChild.updatePaintingRootForChildren(&m_layoutBlock); | 308 paintInfoForChild.updatePaintingRootForChildren(&m_layoutBlock); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 LayoutBlock* block = flow->containingBlock(); | 354 LayoutBlock* block = flow->containingBlock(); |
349 for ( ; block && block != &m_layoutBlock; block = block->containingBlock
()) | 355 for ( ; block && block != &m_layoutBlock; block = block->containingBlock
()) |
350 accumulatedPaintOffset.moveBy(block->location()); | 356 accumulatedPaintOffset.moveBy(block->location()); |
351 ASSERT(block); | 357 ASSERT(block); |
352 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset); | 358 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset); |
353 } | 359 } |
354 } | 360 } |
355 | 361 |
356 | 362 |
357 } // namespace blink | 363 } // namespace blink |
OLD | NEW |