| 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) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. |
| 7 * All rights reserved. | 7 * All rights reserved. |
| 8 * Copyright (C) 2009 Google Inc. All rights reserved. | 8 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. | 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. |
| 10 * (http://www.torchmobile.com/) | 10 * (http://www.torchmobile.com/) |
| (...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1729 } else if (diff.needsPaintInvalidationObject() || | 1729 } else if (diff.needsPaintInvalidationObject() || |
| 1730 updatedDiff.needsPaintInvalidationObject()) { | 1730 updatedDiff.needsPaintInvalidationObject()) { |
| 1731 // TODO(wangxianzhu): For now LayoutSVGRoot::localVisualRect() depends on | 1731 // TODO(wangxianzhu): For now LayoutSVGRoot::localVisualRect() depends on |
| 1732 // several styles. Refactor to avoid this special case. | 1732 // several styles. Refactor to avoid this special case. |
| 1733 if (isSVGRoot()) | 1733 if (isSVGRoot()) |
| 1734 setShouldDoFullPaintInvalidation(); | 1734 setShouldDoFullPaintInvalidation(); |
| 1735 else | 1735 else |
| 1736 setShouldDoFullPaintInvalidationWithoutGeometryChange(); | 1736 setShouldDoFullPaintInvalidationWithoutGeometryChange(); |
| 1737 } | 1737 } |
| 1738 | 1738 |
| 1739 if (diff.needsVisualRectUpdate()) | |
| 1740 setMayNeedPaintInvalidation(); | |
| 1741 | |
| 1742 // Text nodes share style with their parents but the paint properties don't | 1739 // Text nodes share style with their parents but the paint properties don't |
| 1743 // apply to them, hence the !isText() check. | 1740 // apply to them, hence the !isText() check. |
| 1744 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && !isText() && | 1741 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && !isText() && |
| 1745 (diff.transformChanged() || diff.opacityChanged() || | 1742 (diff.transformChanged() || diff.opacityChanged() || |
| 1746 diff.zIndexChanged() || diff.filterChanged() || | 1743 diff.zIndexChanged() || diff.filterChanged() || |
| 1747 diff.backdropFilterChanged() || diff.cssClipChanged())) { | 1744 diff.backdropFilterChanged() || diff.cssClipChanged())) { |
| 1748 setNeedsPaintPropertyUpdate(); | 1745 setNeedsPaintPropertyUpdate(); |
| 1749 | 1746 |
| 1750 // We don't need to invalidate paint of objects on SPv2 when only paint | 1747 // We don't need to invalidate paint of objects on SPv2 when only paint |
| 1751 // property or paint order change. Mark the painting layer needing repaint | 1748 // property or paint order change. Mark the painting layer needing repaint |
| 1752 // for changed paint property or paint order. Raster invalidation will be | 1749 // for changed paint property or paint order. Raster invalidation will be |
| 1753 // issued if needed during paint. | 1750 // issued if needed during paint. |
| 1754 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && | 1751 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && |
| 1755 !shouldDoFullPaintInvalidation()) | 1752 !shouldDoFullPaintInvalidation()) |
| 1756 ObjectPaintInvalidator(*this).slowSetPaintingLayerNeedsRepaint(); | 1753 ObjectPaintInvalidator(*this).slowSetPaintingLayerNeedsRepaint(); |
| 1757 } | 1754 } |
| 1758 } | 1755 } |
| 1759 | 1756 |
| 1760 void LayoutObject::styleWillChange(StyleDifference diff, | 1757 void LayoutObject::styleWillChange(StyleDifference diff, |
| 1761 const ComputedStyle& newStyle) { | 1758 const ComputedStyle& newStyle) { |
| 1762 if (m_style) { | 1759 if (m_style) { |
| 1763 bool visibilityChanged = m_style->visibility() != newStyle.visibility(); | |
| 1764 // If our z-index changes value or our visibility changes, | 1760 // If our z-index changes value or our visibility changes, |
| 1765 // we need to dirty our stacking context's z-order list. | 1761 // we need to dirty our stacking context's z-order list. |
| 1766 if (visibilityChanged || m_style->zIndex() != newStyle.zIndex() || | 1762 bool visibilityChanged = |
| 1767 m_style->isStackingContext() != newStyle.isStackingContext()) { | 1763 m_style->visibility() != newStyle.visibility() || |
| 1764 m_style->zIndex() != newStyle.zIndex() || |
| 1765 m_style->isStackingContext() != newStyle.isStackingContext(); |
| 1766 if (visibilityChanged) { |
| 1768 document().setAnnotatedRegionsDirty(true); | 1767 document().setAnnotatedRegionsDirty(true); |
| 1769 if (AXObjectCache* cache = document().existingAXObjectCache()) | 1768 if (AXObjectCache* cache = document().existingAXObjectCache()) |
| 1770 cache->childrenChanged(parent()); | 1769 cache->childrenChanged(parent()); |
| 1771 } | 1770 } |
| 1772 | 1771 |
| 1773 // Keep layer hierarchy visibility bits up to date if visibility changes. | 1772 // Keep layer hierarchy visibility bits up to date if visibility changes. |
| 1774 if (visibilityChanged) { | 1773 if (m_style->visibility() != newStyle.visibility()) { |
| 1775 // We might not have an enclosing layer yet because we might not be in the | 1774 // We might not have an enclosing layer yet because we might not be in the |
| 1776 // tree. | 1775 // tree. |
| 1777 if (PaintLayer* layer = enclosingLayer()) | 1776 if (PaintLayer* layer = enclosingLayer()) |
| 1778 layer->dirtyVisibleContentStatus(); | 1777 layer->dirtyVisibleContentStatus(); |
| 1779 } | 1778 } |
| 1780 | 1779 |
| 1781 if (isFloating() && (m_style->floating() != newStyle.floating())) { | 1780 if (isFloating() && (m_style->floating() != newStyle.floating())) { |
| 1782 // For changes in float styles, we need to conceivably remove ourselves | 1781 // For changes in float styles, we need to conceivably remove ourselves |
| 1783 // from the floating objects list. | 1782 // from the floating objects list. |
| 1784 toLayoutBox(this)->removeFloatingOrPositionedChildFromBlockLists(); | 1783 toLayoutBox(this)->removeFloatingOrPositionedChildFromBlockLists(); |
| (...skipping 1841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3626 const blink::LayoutObject* root = object1; | 3625 const blink::LayoutObject* root = object1; |
| 3627 while (root->parent()) | 3626 while (root->parent()) |
| 3628 root = root->parent(); | 3627 root = root->parent(); |
| 3629 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3628 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3630 } else { | 3629 } else { |
| 3631 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3630 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
| 3632 } | 3631 } |
| 3633 } | 3632 } |
| 3634 | 3633 |
| 3635 #endif | 3634 #endif |
| OLD | NEW |