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 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1549 if (fullInvalidationReason == PaintInvalidationDelayedFull) { | 1549 if (fullInvalidationReason == PaintInvalidationDelayedFull) { |
1550 if (!intersectsVisibleViewport()) | 1550 if (!intersectsVisibleViewport()) |
1551 return PaintInvalidationDelayedFull; | 1551 return PaintInvalidationDelayedFull; |
1552 | 1552 |
1553 // Reset state back to regular full paint invalidation if the object is
onscreen. | 1553 // Reset state back to regular full paint invalidation if the object is
onscreen. |
1554 setShouldDoFullPaintInvalidation(PaintInvalidationFull); | 1554 setShouldDoFullPaintInvalidation(PaintInvalidationFull); |
1555 } | 1555 } |
1556 | 1556 |
1557 PaintInvalidationReason reason = LayoutBoxModelObject::invalidatePaintIfNeed
ed(paintInvalidationState); | 1557 PaintInvalidationReason reason = LayoutBoxModelObject::invalidatePaintIfNeed
ed(paintInvalidationState); |
1558 | 1558 |
1559 if (!view()->doingFullPaintInvalidation() && !isFullPaintInvalidationReason(
reason)) | 1559 if (!isFullPaintInvalidationReason(reason)) |
1560 invalidatePaintForOverflowIfNeeded(); | 1560 invalidatePaintForOverflowIfNeeded(); |
1561 | 1561 |
1562 if (PaintLayerScrollableArea* area = getScrollableArea()) | 1562 if (PaintLayerScrollableArea* area = getScrollableArea()) |
1563 area->invalidatePaintOfScrollControlsIfNeeded(paintInvalidationState); | 1563 area->invalidatePaintOfScrollControlsIfNeeded(paintInvalidationState); |
1564 | 1564 |
1565 // This is for the next invalidatePaintIfNeeded so must be at the end. | 1565 // This is for the next invalidatePaintIfNeeded so must be at the end. |
1566 savePreviousBoxSizesIfNeeded(); | 1566 savePreviousBoxSizesIfNeeded(); |
1567 return reason; | 1567 return reason; |
1568 } | 1568 } |
1569 | 1569 |
(...skipping 3093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4663 computedValues.m_margins.m_start = marginStart(); | 4663 computedValues.m_margins.m_start = marginStart(); |
4664 computedValues.m_margins.m_end = marginEnd(); | 4664 computedValues.m_margins.m_end = marginEnd(); |
4665 | 4665 |
4666 setLogicalTop(oldLogicalTop); | 4666 setLogicalTop(oldLogicalTop); |
4667 setLogicalWidth(oldLogicalWidth); | 4667 setLogicalWidth(oldLogicalWidth); |
4668 setLogicalLeft(oldLogicalLeft); | 4668 setLogicalLeft(oldLogicalLeft); |
4669 setMarginLeft(oldMarginLeft); | 4669 setMarginLeft(oldMarginLeft); |
4670 setMarginRight(oldMarginRight); | 4670 setMarginRight(oldMarginRight); |
4671 } | 4671 } |
4672 | 4672 |
4673 inline bool LayoutBox::mustInvalidateFillLayersPaintOnWidthChange(const FillLaye
r& layer) const | 4673 bool LayoutBox::mustInvalidateFillLayersPaintOnHeightChange(const FillLayer& lay
er) const |
4674 { | 4674 { |
4675 // Nobody will use multiple layers without wanting fancy positioning. | 4675 // Nobody will use multiple layers without wanting fancy positioning. |
4676 if (layer.next()) | 4676 if (layer.next()) |
| 4677 return true; |
| 4678 |
| 4679 // Make sure we have a valid image. |
| 4680 StyleImage* img = layer.image(); |
| 4681 if (!img || !img->canRender()) |
| 4682 return false; |
| 4683 |
| 4684 if (layer.repeatY() != RepeatFill && layer.repeatY() != NoRepeatFill) |
| 4685 return true; |
| 4686 |
| 4687 // TODO(alancutter): Make this work correctly for calc lengths. |
| 4688 if (layer.yPosition().hasPercent() && !layer.yPosition().isZero()) |
| 4689 return true; |
| 4690 |
| 4691 if (layer.backgroundYOrigin() != TopEdge) |
| 4692 return true; |
| 4693 |
| 4694 EFillSizeType sizeType = layer.sizeType(); |
| 4695 |
| 4696 if (sizeType == Contain || sizeType == Cover) |
| 4697 return true; |
| 4698 |
| 4699 if (sizeType == SizeLength) { |
| 4700 // TODO(alancutter): Make this work correctly for calc lengths. |
| 4701 if (layer.sizeLength().height().hasPercent() && !layer.sizeLength().heig
ht().isZero()) |
| 4702 return true; |
| 4703 if (img->isGeneratedImage() && layer.sizeLength().height().isAuto()) |
| 4704 return true; |
| 4705 } else if (img->usesImageContainerSize()) { |
| 4706 return true; |
| 4707 } |
| 4708 |
| 4709 return false; |
| 4710 } |
| 4711 |
| 4712 bool LayoutBox::mustInvalidateFillLayersPaintOnWidthChange(const FillLayer& laye
r) const |
| 4713 { |
| 4714 // Nobody will use multiple layers without wanting fancy positioning. |
| 4715 if (layer.next()) |
4677 return true; | 4716 return true; |
4678 | 4717 |
4679 // Make sure we have a valid image. | 4718 // Make sure we have a valid image. |
4680 StyleImage* img = layer.image(); | 4719 StyleImage* img = layer.image(); |
4681 if (!img || !img->canRender()) | 4720 if (!img || !img->canRender()) |
4682 return false; | 4721 return false; |
4683 | 4722 |
4684 if (layer.repeatX() != RepeatFill && layer.repeatX() != NoRepeatFill) | 4723 if (layer.repeatX() != RepeatFill && layer.repeatX() != NoRepeatFill) |
4685 return true; | 4724 return true; |
4686 | 4725 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4886 m_rareData->m_snapAreas->remove(&snapArea); | 4925 m_rareData->m_snapAreas->remove(&snapArea); |
4887 } | 4926 } |
4888 } | 4927 } |
4889 | 4928 |
4890 SnapAreaSet* LayoutBox::snapAreas() const | 4929 SnapAreaSet* LayoutBox::snapAreas() const |
4891 { | 4930 { |
4892 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; | 4931 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; |
4893 } | 4932 } |
4894 | 4933 |
4895 } // namespace blink | 4934 } // namespace blink |
OLD | NEW |