| 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. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. |
| 7 * All rights reserved. | 7 * All rights reserved. |
| 8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1721 void LayoutBox::sizeChanged() { | 1721 void LayoutBox::sizeChanged() { |
| 1722 // The size may change because of layout of other objects. Should check this | 1722 // The size may change because of layout of other objects. Should check this |
| 1723 // object for paint invalidation. | 1723 // object for paint invalidation. |
| 1724 if (!needsLayout()) | 1724 if (!needsLayout()) |
| 1725 setMayNeedPaintInvalidation(); | 1725 setMayNeedPaintInvalidation(); |
| 1726 | 1726 |
| 1727 if (node() && node()->isElementNode()) { | 1727 if (node() && node()->isElementNode()) { |
| 1728 Element& element = toElement(*node()); | 1728 Element& element = toElement(*node()); |
| 1729 element.setNeedsResizeObserverUpdate(); | 1729 element.setNeedsResizeObserverUpdate(); |
| 1730 } | 1730 } |
| 1731 | |
| 1732 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { | |
| 1733 if (shouldClipOverflow()) { | |
| 1734 // The overflow clip paint property depends on the border box rect through | |
| 1735 // overflowClipRect(). The border box rect's size equals the frame rect's | |
| 1736 // size so we trigger a paint property update when the frame rect changes. | |
| 1737 setNeedsPaintPropertyUpdate(); | |
| 1738 } else if (hasClip()) { | |
| 1739 // The used value of CSS clip may depend on size of the box, e.g. for | |
| 1740 // clip: rect(auto auto auto -5px). | |
| 1741 setNeedsPaintPropertyUpdate(); | |
| 1742 } else if (styleRef().hasTransform() || styleRef().hasPerspective()) { | |
| 1743 // Relative lengths (e.g., percentage values) in transform, perspective, | |
| 1744 // transform-origin, and perspective-origin can depend on the size of the | |
| 1745 // frame rect, so force a property update if it changes. | |
| 1746 // TODO(pdr): We only need to update properties if there are relative | |
| 1747 // lengths. | |
| 1748 setNeedsPaintPropertyUpdate(); | |
| 1749 } | |
| 1750 } | |
| 1751 } | 1731 } |
| 1752 | 1732 |
| 1753 bool LayoutBox::intersectsVisibleViewport() const { | 1733 bool LayoutBox::intersectsVisibleViewport() const { |
| 1754 LayoutRect rect = visualOverflowRect(); | 1734 LayoutRect rect = visualOverflowRect(); |
| 1755 LayoutView* layoutView = view(); | 1735 LayoutView* layoutView = view(); |
| 1756 while (!layoutView->frame()->ownerLayoutItem().isNull()) | 1736 while (!layoutView->frame()->ownerLayoutItem().isNull()) |
| 1757 layoutView = | 1737 layoutView = |
| 1758 LayoutAPIShim::layoutObjectFrom(layoutView->frame()->ownerLayoutItem()) | 1738 LayoutAPIShim::layoutObjectFrom(layoutView->frame()->ownerLayoutItem()) |
| 1759 ->view(); | 1739 ->view(); |
| 1760 mapToVisualRectInAncestorSpace(layoutView, rect); | 1740 mapToVisualRectInAncestorSpace(layoutView, rect); |
| (...skipping 3973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5734 | 5714 |
| 5735 void LayoutBox::MutableForPainting:: | 5715 void LayoutBox::MutableForPainting:: |
| 5736 savePreviousContentBoxSizeAndLayoutOverflowRect() { | 5716 savePreviousContentBoxSizeAndLayoutOverflowRect() { |
| 5737 auto& rareData = layoutBox().ensureRareData(); | 5717 auto& rareData = layoutBox().ensureRareData(); |
| 5738 rareData.m_hasPreviousContentBoxSizeAndLayoutOverflowRect = true; | 5718 rareData.m_hasPreviousContentBoxSizeAndLayoutOverflowRect = true; |
| 5739 rareData.m_previousContentBoxSize = layoutBox().contentBoxRect().size(); | 5719 rareData.m_previousContentBoxSize = layoutBox().contentBoxRect().size(); |
| 5740 rareData.m_previousLayoutOverflowRect = layoutBox().layoutOverflowRect(); | 5720 rareData.m_previousLayoutOverflowRect = layoutBox().layoutOverflowRect(); |
| 5741 } | 5721 } |
| 5742 | 5722 |
| 5743 } // namespace blink | 5723 } // namespace blink |
| OLD | NEW |