OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "core/paint/BlockFlowPaintInvalidator.h" |
| 6 |
| 7 #include "core/layout/LayoutBlockFlow.h" |
| 8 #include "core/paint/BoxPaintInvalidator.h" |
| 9 #include "core/paint/PaintInvalidator.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 PaintInvalidationReason BlockFlowPaintInvalidator::invalidatePaintIfNeeded() |
| 14 { |
| 15 PaintInvalidationReason reason = BoxPaintInvalidator(m_blockFlow, m_context)
.invalidatePaintIfNeeded(); |
| 16 |
| 17 if (reason == PaintInvalidationNone || reason == PaintInvalidationDelayedFul
l) |
| 18 return reason; |
| 19 |
| 20 RootInlineBox* line = m_blockFlow.firstRootBox(); |
| 21 if (line && line->isFirstLineStyle()) { |
| 22 // It's the RootInlineBox that paints the ::first-line background. Note
that since it may be |
| 23 // expensive to figure out if the first line is affected by any ::first-
line selectors at all, |
| 24 // we just invalidate it unconditionally which is typically cheaper. |
| 25 m_blockFlow.invalidateDisplayItemClient(*line, reason); |
| 26 } |
| 27 return reason; |
| 28 } |
| 29 |
| 30 } // namespace blink |
OLD | NEW |