| 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 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1387 // during DeprecatedPaintLayerScrollableArea::invalidateScrollbarRec
t(). However, for now we still need to | 1387 // during DeprecatedPaintLayerScrollableArea::invalidateScrollbarRec
t(). However, for now we still need to |
| 1388 // invalidate the rectangles to trigger repaints. | 1388 // invalidate the rectangles to trigger repaints. |
| 1389 if (area->hasVerticalBarDamage()) | 1389 if (area->hasVerticalBarDamage()) |
| 1390 invalidatePaintRectangleNotInvalidatingDisplayItemClients(Layout
Rect(area->verticalBarDamage())); | 1390 invalidatePaintRectangleNotInvalidatingDisplayItemClients(Layout
Rect(area->verticalBarDamage())); |
| 1391 if (area->hasHorizontalBarDamage()) | 1391 if (area->hasHorizontalBarDamage()) |
| 1392 invalidatePaintRectangleNotInvalidatingDisplayItemClients(Layout
Rect(area->horizontalBarDamage())); | 1392 invalidatePaintRectangleNotInvalidatingDisplayItemClients(Layout
Rect(area->horizontalBarDamage())); |
| 1393 } | 1393 } |
| 1394 } | 1394 } |
| 1395 | 1395 |
| 1396 // This is for the next invalidatePaintIfNeeded so must be at the end. | 1396 // This is for the next invalidatePaintIfNeeded so must be at the end. |
| 1397 savePreviousBoxSizesIfNeeded(newPaintInvalidationContainer); | 1397 savePreviousBoxSizesIfNeeded(); |
| 1398 return reason; | 1398 return reason; |
| 1399 } | 1399 } |
| 1400 | 1400 |
| 1401 void LayoutBox::clearPaintInvalidationState(const PaintInvalidationState& paintI
nvalidationState) | 1401 void LayoutBox::clearPaintInvalidationState(const PaintInvalidationState& paintI
nvalidationState) |
| 1402 { | 1402 { |
| 1403 LayoutBoxModelObject::clearPaintInvalidationState(paintInvalidationState); | 1403 LayoutBoxModelObject::clearPaintInvalidationState(paintInvalidationState); |
| 1404 | 1404 |
| 1405 if (ScrollableArea* area = scrollableArea()) | 1405 if (ScrollableArea* area = scrollableArea()) |
| 1406 area->resetScrollbarDamage(); | 1406 area->resetScrollbarDamage(); |
| 1407 } | 1407 } |
| (...skipping 3157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4565 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); | 4565 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); |
| 4566 } | 4566 } |
| 4567 | 4567 |
| 4568 void LayoutBox::setPageLogicalOffset(LayoutUnit offset) | 4568 void LayoutBox::setPageLogicalOffset(LayoutUnit offset) |
| 4569 { | 4569 { |
| 4570 if (!m_rareData && !offset) | 4570 if (!m_rareData && !offset) |
| 4571 return; | 4571 return; |
| 4572 ensureRareData().m_pageLogicalOffset = offset; | 4572 ensureRareData().m_pageLogicalOffset = offset; |
| 4573 } | 4573 } |
| 4574 | 4574 |
| 4575 bool LayoutBox::needToSavePreviousBoxSizes(const LayoutBoxModelObject& paintInva
lidationContainer) | 4575 bool LayoutBox::needToSavePreviousBoxSizes() |
| 4576 { | 4576 { |
| 4577 // If m_rareData is already created, always save. | 4577 // If m_rareData is already created, always save. |
| 4578 if (m_rareData) | 4578 if (m_rareData) |
| 4579 return true; | 4579 return true; |
| 4580 | 4580 |
| 4581 LayoutSize paintInvalidationSize = previousPaintInvalidationRectIncludingCom
positedScrolling(paintInvalidationContainer).size(); | 4581 LayoutSize paintInvalidationSize = previousPaintInvalidationRectSize(); |
| 4582 // Don't save old box sizes if the paint rect is empty because we'll | 4582 // Don't save old box sizes if the paint rect is empty because we'll |
| 4583 // full invalidate once the paint rect becomes non-empty. | 4583 // full invalidate once the paint rect becomes non-empty. |
| 4584 if (paintInvalidationSize.isEmpty()) | 4584 if (paintInvalidationSize.isEmpty()) |
| 4585 return false; | 4585 return false; |
| 4586 | 4586 |
| 4587 // We need the old box sizes only when the box has background, decorations,
or masks. | 4587 // We need the old box sizes only when the box has background, decorations,
or masks. |
| 4588 // Main LayoutView paints base background, thus interested in box size. | 4588 // Main LayoutView paints base background, thus interested in box size. |
| 4589 if (!isLayoutView() && !style()->hasBackground() && !style()->hasBoxDecorati
ons() && !style()->hasMask()) | 4589 if (!isLayoutView() && !style()->hasBackground() && !style()->hasBoxDecorati
ons() && !style()->hasMask()) |
| 4590 return false; | 4590 return false; |
| 4591 | 4591 |
| 4592 // No need to save old border box size if we can use size of the old paint | 4592 // No need to save old border box size if we can use size of the old paint |
| 4593 // rect as the old border box size in the next invalidation. | 4593 // rect as the old border box size in the next invalidation. |
| 4594 if (paintInvalidationSize != size()) | 4594 if (paintInvalidationSize != size()) |
| 4595 return true; | 4595 return true; |
| 4596 | 4596 |
| 4597 // Background and mask layers can depend on other boxes than border box. See
crbug.com/490533 | 4597 // Background and mask layers can depend on other boxes than border box. See
crbug.com/490533 |
| 4598 if (style()->backgroundLayers().thisOrNextLayersUseContentBox() || style()->
backgroundLayers().thisOrNextLayersHaveLocalAttachment() | 4598 if (style()->backgroundLayers().thisOrNextLayersUseContentBox() || style()->
backgroundLayers().thisOrNextLayersHaveLocalAttachment() |
| 4599 || style()->maskLayers().thisOrNextLayersUseContentBox()) | 4599 || style()->maskLayers().thisOrNextLayersUseContentBox()) |
| 4600 return true; | 4600 return true; |
| 4601 | 4601 |
| 4602 return false; | 4602 return false; |
| 4603 } | 4603 } |
| 4604 | 4604 |
| 4605 void LayoutBox::savePreviousBoxSizesIfNeeded(const LayoutBoxModelObject& paintIn
validationContainer) | 4605 void LayoutBox::savePreviousBoxSizesIfNeeded() |
| 4606 { | 4606 { |
| 4607 if (!needToSavePreviousBoxSizes(paintInvalidationContainer)) | 4607 if (!needToSavePreviousBoxSizes()) |
| 4608 return; | 4608 return; |
| 4609 | 4609 |
| 4610 LayoutBoxRareData& rareData = ensureRareData(); | 4610 LayoutBoxRareData& rareData = ensureRareData(); |
| 4611 rareData.m_previousBorderBoxSize = size(); | 4611 rareData.m_previousBorderBoxSize = size(); |
| 4612 rareData.m_previousContentBoxRect = contentBoxRect(); | 4612 rareData.m_previousContentBoxRect = contentBoxRect(); |
| 4613 rareData.m_previousLayoutOverflowRect = layoutOverflowRect(); | 4613 rareData.m_previousLayoutOverflowRect = layoutOverflowRect(); |
| 4614 } | 4614 } |
| 4615 | 4615 |
| 4616 LayoutSize LayoutBox::computePreviousBorderBoxSize(const LayoutSize& previousBou
ndsSize) const | 4616 LayoutSize LayoutBox::computePreviousBorderBoxSize(const LayoutSize& previousBou
ndsSize) const |
| 4617 { | 4617 { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4734 StyleImage* borderImage = style()->borderImage().image(); | 4734 StyleImage* borderImage = style()->borderImage().image(); |
| 4735 return borderImage && borderImage->canRender(*this, style()->effectiveZoom()
) && borderImage->isLoaded(); | 4735 return borderImage && borderImage->canRender(*this, style()->effectiveZoom()
) && borderImage->isLoaded(); |
| 4736 } | 4736 } |
| 4737 | 4737 |
| 4738 ShapeOutsideInfo* LayoutBox::shapeOutsideInfo() const | 4738 ShapeOutsideInfo* LayoutBox::shapeOutsideInfo() const |
| 4739 { | 4739 { |
| 4740 return ShapeOutsideInfo::isEnabledFor(*this) ? ShapeOutsideInfo::info(*this)
: nullptr; | 4740 return ShapeOutsideInfo::isEnabledFor(*this) ? ShapeOutsideInfo::info(*this)
: nullptr; |
| 4741 } | 4741 } |
| 4742 | 4742 |
| 4743 } // namespace blink | 4743 } // namespace blink |
| OLD | NEW |