| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
| 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 3808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3819 } | 3819 } |
| 3820 | 3820 |
| 3821 // If the transform is not identity or translation, incremental invalidation
is not applicable | 3821 // If the transform is not identity or translation, incremental invalidation
is not applicable |
| 3822 // because the difference between oldBounds and newBounds doesn't cover all
area needing invalidation. | 3822 // because the difference between oldBounds and newBounds doesn't cover all
area needing invalidation. |
| 3823 // FIXME: Should also consider ancestor transforms since paintInvalidationCo
ntainer. crbug.com/426111. | 3823 // FIXME: Should also consider ancestor transforms since paintInvalidationCo
ntainer. crbug.com/426111. |
| 3824 if (invalidationReason == PaintInvalidationIncremental | 3824 if (invalidationReason == PaintInvalidationIncremental |
| 3825 && paintInvalidationContainer != this | 3825 && paintInvalidationContainer != this |
| 3826 && hasLayer() && layer()->transform() && !layer()->transform()->isIdenti
tyOrTranslation()) | 3826 && hasLayer() && layer()->transform() && !layer()->transform()->isIdenti
tyOrTranslation()) |
| 3827 return PaintInvalidationBoundsChange; | 3827 return PaintInvalidationBoundsChange; |
| 3828 | 3828 |
| 3829 if (style()->backgroundLayers().thisOrNextLayersUseContentBox() || style()->
maskLayers().thisOrNextLayersUseContentBox() || style()->boxSizing() == BoxSizin
gBorderBox) { |
| 3830 LayoutRect oldContentBoxRect = m_rareData ? m_rareData->m_previousConten
tBoxRect : LayoutRect(); |
| 3831 LayoutRect newContentBoxRect = contentBoxRect(); |
| 3832 if (oldContentBoxRect != newContentBoxRect) |
| 3833 return PaintInvalidationContentBoxChange; |
| 3834 } |
| 3835 |
| 3829 if (!style()->hasBackground() && !style()->hasBoxDecorations()) { | 3836 if (!style()->hasBackground() && !style()->hasBoxDecorations()) { |
| 3830 // We could let incremental invalidation cover non-composited scrollbars
, but just | 3837 // We could let incremental invalidation cover non-composited scrollbars
, but just |
| 3831 // do a full invalidation because incremental invalidation will go away
with slimming paint. | 3838 // do a full invalidation because incremental invalidation will go away
with slimming paint. |
| 3832 if (invalidationReason == PaintInvalidationIncremental && hasNonComposit
edScrollbars()) | 3839 if (invalidationReason == PaintInvalidationIncremental && hasNonComposit
edScrollbars()) |
| 3833 return PaintInvalidationBorderBoxChange; | 3840 return PaintInvalidationBorderBoxChange; |
| 3834 return invalidationReason; | 3841 return invalidationReason; |
| 3835 } | 3842 } |
| 3836 | 3843 |
| 3837 if (style()->backgroundLayers().thisOrNextLayersUseContentBox() || style()->
maskLayers().thisOrNextLayersUseContentBox()) { | |
| 3838 LayoutRect oldContentBoxRect = m_rareData ? m_rareData->m_previousConten
tBoxRect : LayoutRect(); | |
| 3839 LayoutRect newContentBoxRect = contentBoxRect(); | |
| 3840 if (oldContentBoxRect != newContentBoxRect) | |
| 3841 return PaintInvalidationContentBoxChange; | |
| 3842 } | |
| 3843 | |
| 3844 if (style()->backgroundLayers().thisOrNextLayersHaveLocalAttachment()) { | 3844 if (style()->backgroundLayers().thisOrNextLayersHaveLocalAttachment()) { |
| 3845 LayoutRect oldLayoutOverflowRect = m_rareData ? m_rareData->m_previousLa
youtOverflowRect : LayoutRect(); | 3845 LayoutRect oldLayoutOverflowRect = m_rareData ? m_rareData->m_previousLa
youtOverflowRect : LayoutRect(); |
| 3846 LayoutRect newLayoutOverflowRect = layoutOverflowRect(); | 3846 LayoutRect newLayoutOverflowRect = layoutOverflowRect(); |
| 3847 if (oldLayoutOverflowRect != newLayoutOverflowRect) | 3847 if (oldLayoutOverflowRect != newLayoutOverflowRect) |
| 3848 return PaintInvalidationLayoutOverflowBoxChange; | 3848 return PaintInvalidationLayoutOverflowBoxChange; |
| 3849 } | 3849 } |
| 3850 | 3850 |
| 3851 LayoutSize oldBorderBoxSize = computePreviousBorderBoxSize(oldBounds.size())
; | 3851 LayoutSize oldBorderBoxSize = computePreviousBorderBoxSize(oldBounds.size())
; |
| 3852 LayoutSize newBorderBoxSize = size(); | 3852 LayoutSize newBorderBoxSize = size(); |
| 3853 | 3853 |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4510 // If m_rareData is already created, always save. | 4510 // If m_rareData is already created, always save. |
| 4511 if (m_rareData) | 4511 if (m_rareData) |
| 4512 return true; | 4512 return true; |
| 4513 | 4513 |
| 4514 LayoutSize paintInvalidationSize = previousPaintInvalidationRectSize(); | 4514 LayoutSize paintInvalidationSize = previousPaintInvalidationRectSize(); |
| 4515 // Don't save old box sizes if the paint rect is empty because we'll | 4515 // Don't save old box sizes if the paint rect is empty because we'll |
| 4516 // full invalidate once the paint rect becomes non-empty. | 4516 // full invalidate once the paint rect becomes non-empty. |
| 4517 if (paintInvalidationSize.isEmpty()) | 4517 if (paintInvalidationSize.isEmpty()) |
| 4518 return false; | 4518 return false; |
| 4519 | 4519 |
| 4520 // If we use border-box sizing we need to track changes in the size of the c
ontent box. |
| 4521 if (style()->boxSizing() == BoxSizingBorderBox) |
| 4522 return true; |
| 4523 |
| 4520 // We need the old box sizes only when the box has background, decorations,
or masks. | 4524 // We need the old box sizes only when the box has background, decorations,
or masks. |
| 4521 // Main LayoutView paints base background, thus interested in box size. | 4525 // Main LayoutView paints base background, thus interested in box size. |
| 4522 if (!isLayoutView() && !style()->hasBackground() && !style()->hasBoxDecorati
ons() && !style()->hasMask()) | 4526 if (!isLayoutView() && !style()->hasBackground() && !style()->hasBoxDecorati
ons() && !style()->hasMask()) |
| 4523 return false; | 4527 return false; |
| 4524 | 4528 |
| 4525 // No need to save old border box size if we can use size of the old paint | 4529 // No need to save old border box size if we can use size of the old paint |
| 4526 // rect as the old border box size in the next invalidation. | 4530 // rect as the old border box size in the next invalidation. |
| 4527 if (paintInvalidationSize != size()) | 4531 if (paintInvalidationSize != size()) |
| 4528 return true; | 4532 return true; |
| 4529 | 4533 |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4752 if (!flowThread) { | 4756 if (!flowThread) { |
| 4753 // If there's no flow thread, we're not nested. All pages have the same
height. Give up. | 4757 // If there's no flow thread, we're not nested. All pages have the same
height. Give up. |
| 4754 return strutToNextPage; | 4758 return strutToNextPage; |
| 4755 } | 4759 } |
| 4756 // Start searching for a suitable offset at the top of the next page or colu
mn. | 4760 // Start searching for a suitable offset at the top of the next page or colu
mn. |
| 4757 LayoutUnit flowThreadOffset = offsetFromLogicalTopOfFirstPage() + nextPageLo
gicalTop; | 4761 LayoutUnit flowThreadOffset = offsetFromLogicalTopOfFirstPage() + nextPageLo
gicalTop; |
| 4758 return strutToNextPage + flowThread->nextLogicalTopForUnbreakableContent(flo
wThreadOffset, contentLogicalHeight) - flowThreadOffset; | 4762 return strutToNextPage + flowThread->nextLogicalTopForUnbreakableContent(flo
wThreadOffset, contentLogicalHeight) - flowThreadOffset; |
| 4759 } | 4763 } |
| 4760 | 4764 |
| 4761 } // namespace blink | 4765 } // namespace blink |
| OLD | NEW |