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 1730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1741 } else if (diff.needsPaintInvalidationObject() || | 1741 } else if (diff.needsPaintInvalidationObject() || |
1742 updatedDiff.needsPaintInvalidationObject()) { | 1742 updatedDiff.needsPaintInvalidationObject()) { |
1743 // TODO(wangxianzhu): For now LayoutSVGRoot::localVisualRect() depends on | 1743 // TODO(wangxianzhu): For now LayoutSVGRoot::localVisualRect() depends on |
1744 // several styles. Refactor to avoid this special case. | 1744 // several styles. Refactor to avoid this special case. |
1745 if (isSVGRoot()) | 1745 if (isSVGRoot()) |
1746 setShouldDoFullPaintInvalidation(); | 1746 setShouldDoFullPaintInvalidation(); |
1747 else | 1747 else |
1748 setShouldDoFullPaintInvalidationWithoutGeometryChange(); | 1748 setShouldDoFullPaintInvalidationWithoutGeometryChange(); |
1749 } | 1749 } |
1750 | 1750 |
1751 if (diff.needsVisualRectUpdate()) | |
1752 setMayNeedPaintInvalidation(); | |
1753 | |
1754 // Text nodes share style with their parents but the paint properties don't | 1751 // Text nodes share style with their parents but the paint properties don't |
1755 // apply to them, hence the !isText() check. | 1752 // apply to them, hence the !isText() check. |
1756 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && !isText() && | 1753 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && !isText() && |
1757 (diff.transformChanged() || diff.opacityChanged() || | 1754 (diff.transformChanged() || diff.opacityChanged() || |
1758 diff.zIndexChanged() || diff.filterChanged() || | 1755 diff.zIndexChanged() || diff.filterChanged() || |
1759 diff.backdropFilterChanged() || diff.cssClipChanged())) { | 1756 diff.backdropFilterChanged() || diff.cssClipChanged())) { |
1760 setNeedsPaintPropertyUpdate(); | 1757 setNeedsPaintPropertyUpdate(); |
1761 | 1758 |
1762 // We don't need to invalidate paint of objects on SPv2 when only paint | 1759 // We don't need to invalidate paint of objects on SPv2 when only paint |
1763 // property or paint order change. Mark the painting layer needing repaint | 1760 // property or paint order change. Mark the painting layer needing repaint |
1764 // for changed paint property or paint order. Raster invalidation will be | 1761 // for changed paint property or paint order. Raster invalidation will be |
1765 // issued if needed during paint. | 1762 // issued if needed during paint. |
1766 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && | 1763 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && |
1767 !shouldDoFullPaintInvalidation()) | 1764 !shouldDoFullPaintInvalidation()) |
1768 ObjectPaintInvalidator(*this).slowSetPaintingLayerNeedsRepaint(); | 1765 ObjectPaintInvalidator(*this).slowSetPaintingLayerNeedsRepaint(); |
1769 } | 1766 } |
1770 } | 1767 } |
1771 | 1768 |
1772 void LayoutObject::styleWillChange(StyleDifference diff, | 1769 void LayoutObject::styleWillChange(StyleDifference diff, |
1773 const ComputedStyle& newStyle) { | 1770 const ComputedStyle& newStyle) { |
1774 if (m_style) { | 1771 if (m_style) { |
1775 bool visibilityChanged = m_style->visibility() != newStyle.visibility(); | |
1776 // If our z-index changes value or our visibility changes, | 1772 // If our z-index changes value or our visibility changes, |
1777 // we need to dirty our stacking context's z-order list. | 1773 // we need to dirty our stacking context's z-order list. |
1778 if (visibilityChanged || m_style->zIndex() != newStyle.zIndex() || | 1774 bool visibilityChanged = |
1779 m_style->isStackingContext() != newStyle.isStackingContext()) { | 1775 m_style->visibility() != newStyle.visibility() || |
| 1776 m_style->zIndex() != newStyle.zIndex() || |
| 1777 m_style->isStackingContext() != newStyle.isStackingContext(); |
| 1778 if (visibilityChanged) { |
1780 document().setAnnotatedRegionsDirty(true); | 1779 document().setAnnotatedRegionsDirty(true); |
1781 if (AXObjectCache* cache = document().existingAXObjectCache()) | 1780 if (AXObjectCache* cache = document().existingAXObjectCache()) |
1782 cache->childrenChanged(parent()); | 1781 cache->childrenChanged(parent()); |
1783 } | 1782 } |
1784 | 1783 |
1785 // Keep layer hierarchy visibility bits up to date if visibility changes. | 1784 // Keep layer hierarchy visibility bits up to date if visibility changes. |
1786 if (visibilityChanged) { | 1785 if (m_style->visibility() != newStyle.visibility()) { |
1787 // We might not have an enclosing layer yet because we might not be in the | 1786 // We might not have an enclosing layer yet because we might not be in the |
1788 // tree. | 1787 // tree. |
1789 if (PaintLayer* layer = enclosingLayer()) | 1788 if (PaintLayer* layer = enclosingLayer()) |
1790 layer->dirtyVisibleContentStatus(); | 1789 layer->dirtyVisibleContentStatus(); |
1791 } | 1790 } |
1792 | 1791 |
1793 if (isFloating() && (m_style->floating() != newStyle.floating())) { | 1792 if (isFloating() && (m_style->floating() != newStyle.floating())) { |
1794 // For changes in float styles, we need to conceivably remove ourselves | 1793 // For changes in float styles, we need to conceivably remove ourselves |
1795 // from the floating objects list. | 1794 // from the floating objects list. |
1796 toLayoutBox(this)->removeFloatingOrPositionedChildFromBlockLists(); | 1795 toLayoutBox(this)->removeFloatingOrPositionedChildFromBlockLists(); |
(...skipping 1857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3654 const blink::LayoutObject* root = object1; | 3653 const blink::LayoutObject* root = object1; |
3655 while (root->parent()) | 3654 while (root->parent()) |
3656 root = root->parent(); | 3655 root = root->parent(); |
3657 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3656 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3658 } else { | 3657 } else { |
3659 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3658 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
3660 } | 3659 } |
3661 } | 3660 } |
3662 | 3661 |
3663 #endif | 3662 #endif |
OLD | NEW |