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/Caret.h" | 8 #include "core/editing/Caret.h" |
9 #include "core/editing/FrameSelection.h" | 9 #include "core/editing/FrameSelection.h" |
10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 // inline element having outline-style:auto paints the whole focus ring. | 220 // inline element having outline-style:auto paints the whole focus ring. |
221 if (!m_renderBlock.style()->outlineStyleIsAuto() || !m_renderBlock.isAno
nymousBlockContinuation()) | 221 if (!m_renderBlock.style()->outlineStyleIsAuto() || !m_renderBlock.isAno
nymousBlockContinuation()) |
222 ObjectPainter(m_renderBlock).paintOutline(paintInfo, LayoutRect(pain
tOffset, m_renderBlock.size())); | 222 ObjectPainter(m_renderBlock).paintOutline(paintInfo, LayoutRect(pain
tOffset, m_renderBlock.size())); |
223 } | 223 } |
224 | 224 |
225 if (paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseChildOutlines
) | 225 if (paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseChildOutlines
) |
226 paintContinuationOutlines(paintInfo, paintOffset); | 226 paintContinuationOutlines(paintInfo, paintOffset); |
227 | 227 |
228 // If the caret's node's render object's containing block is this block, and
the paint action is PaintPhaseForeground, | 228 // If the caret's node's render object's containing block is this block, and
the paint action is PaintPhaseForeground, |
229 // then paint the caret. | 229 // then paint the caret. |
230 if (paintPhase == PaintPhaseForeground) { | 230 if (paintPhase == PaintPhaseForeground && hasCaret()) { |
231 RenderDrawingRecorder recorder(paintInfo.context, m_renderBlock, paintPh
ase, bounds); | 231 RenderDrawingRecorder recorder(paintInfo.context, m_renderBlock, PaintPh
aseCaret, bounds); |
232 if (!recorder.canUseCachedDrawing()) | 232 if (!recorder.canUseCachedDrawing()) |
233 paintCarets(paintInfo, paintOffset); | 233 paintCarets(paintInfo, paintOffset); |
234 } | 234 } |
235 } | 235 } |
236 | 236 |
237 static inline bool caretBrowsingEnabled(const Frame* frame) | 237 static inline bool caretBrowsingEnabled(const Frame* frame) |
238 { | 238 { |
239 Settings* settings = frame->settings(); | 239 Settings* settings = frame->settings(); |
240 return settings && settings->caretBrowsingEnabled(); | 240 return settings && settings->caretBrowsingEnabled(); |
241 } | 241 } |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 RenderBlock* block = flow->containingBlock(); | 489 RenderBlock* block = flow->containingBlock(); |
490 for ( ; block && block != &m_renderBlock; block = block->containingBlock
()) | 490 for ( ; block && block != &m_renderBlock; block = block->containingBlock
()) |
491 accumulatedPaintOffset.moveBy(block->location()); | 491 accumulatedPaintOffset.moveBy(block->location()); |
492 ASSERT(block); | 492 ASSERT(block); |
493 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset); | 493 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset); |
494 } | 494 } |
495 } | 495 } |
496 | 496 |
497 | 497 |
498 } // namespace blink | 498 } // namespace blink |
OLD | NEW |