Chromium Code Reviews| 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 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1702 // Should check this object for paint invalidation. | 1702 // Should check this object for paint invalidation. |
| 1703 if (!needsLayout()) | 1703 if (!needsLayout()) |
| 1704 setMayNeedPaintInvalidation(); | 1704 setMayNeedPaintInvalidation(); |
| 1705 | 1705 |
| 1706 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { | 1706 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { |
| 1707 if (shouldClipOverflow()) { | 1707 if (shouldClipOverflow()) { |
| 1708 // The overflow clip paint property depends on the border box rect through | 1708 // The overflow clip paint property depends on the border box rect through |
| 1709 // overflowClipRect(). The border box rect's size equals the frame rect's | 1709 // overflowClipRect(). The border box rect's size equals the frame rect's |
| 1710 // size so we trigger a paint property update when the frame rect changes. | 1710 // size so we trigger a paint property update when the frame rect changes. |
| 1711 setNeedsPaintPropertyUpdate(); | 1711 setNeedsPaintPropertyUpdate(); |
| 1712 } else if (styleRef().hasTransform()) { | 1712 } else if (styleRef().hasTransform() || styleRef().hasPerspective()) { |
| 1713 // The transform paint property's origin depends on the frame rect because | 1713 // Both transform-origin and perspective-origin can change if they use |
| 1714 // transform-origin can be sized with lengths relative to the frame rect. | 1714 // relative lengths and the frame rect changes. |
| 1715 // See: PaintPropertyTreeBuilder::updateTransform(...). | 1715 // See: PaintPropertyTreeBuilder's updateTransform and updatePerspective. |
| 1716 // TODO(pdr): We only need to update properties if the origin is specified | |
| 1717 // with relative lengths (e.g., percentage). | |
|
Xianzhu
2016/12/22 21:55:15
Nit: Other transform components can also be relati
| |
| 1716 setNeedsPaintPropertyUpdate(); | 1718 setNeedsPaintPropertyUpdate(); |
| 1717 } | 1719 } |
| 1718 } | 1720 } |
| 1719 } | 1721 } |
| 1720 | 1722 |
| 1721 bool LayoutBox::intersectsVisibleViewport() const { | 1723 bool LayoutBox::intersectsVisibleViewport() const { |
| 1722 LayoutRect rect = visualOverflowRect(); | 1724 LayoutRect rect = visualOverflowRect(); |
| 1723 LayoutView* layoutView = view(); | 1725 LayoutView* layoutView = view(); |
| 1724 while (!layoutView->frame()->ownerLayoutItem().isNull()) | 1726 while (!layoutView->frame()->ownerLayoutItem().isNull()) |
| 1725 layoutView = | 1727 layoutView = |
| (...skipping 3950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5676 block->adjustChildDebugRect(rect); | 5678 block->adjustChildDebugRect(rect); |
| 5677 | 5679 |
| 5678 return rect; | 5680 return rect; |
| 5679 } | 5681 } |
| 5680 | 5682 |
| 5681 bool LayoutBox::shouldClipOverflow() const { | 5683 bool LayoutBox::shouldClipOverflow() const { |
| 5682 return hasOverflowClip() || styleRef().containsPaint() || hasControlClip(); | 5684 return hasOverflowClip() || styleRef().containsPaint() || hasControlClip(); |
| 5683 } | 5685 } |
| 5684 | 5686 |
| 5685 } // namespace blink | 5687 } // namespace blink |
| OLD | NEW |