| 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. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
| 7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 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 1534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1545 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRe
ct, invalidationReason); | 1545 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRe
ct, invalidationReason); |
| 1546 | 1546 |
| 1547 if (oldBounds.contains(newBounds)) | 1547 if (oldBounds.contains(newBounds)) |
| 1548 return; | 1548 return; |
| 1549 } | 1549 } |
| 1550 | 1550 |
| 1551 LayoutRect invalidationRect = newBounds; | 1551 LayoutRect invalidationRect = newBounds; |
| 1552 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect,
invalidationReason); | 1552 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect,
invalidationReason); |
| 1553 } | 1553 } |
| 1554 | 1554 |
| 1555 void LayoutObject::invalidatePaintForOverflow() | |
| 1556 { | |
| 1557 } | |
| 1558 | |
| 1559 void LayoutObject::invalidatePaintForOverflowIfNeeded() | |
| 1560 { | |
| 1561 if (shouldInvalidateOverflowForPaint()) | |
| 1562 invalidatePaintForOverflow(); | |
| 1563 } | |
| 1564 | |
| 1565 LayoutRect LayoutObject::absoluteClippedOverflowRect() const | 1555 LayoutRect LayoutObject::absoluteClippedOverflowRect() const |
| 1566 { | 1556 { |
| 1567 LayoutRect rect = localOverflowRectForPaintInvalidation(); | 1557 LayoutRect rect = localOverflowRectForPaintInvalidation(); |
| 1568 mapToVisualRectInAncestorSpace(view(), rect); | 1558 mapToVisualRectInAncestorSpace(view(), rect); |
| 1569 return rect; | 1559 return rect; |
| 1570 } | 1560 } |
| 1571 | 1561 |
| 1572 LayoutRect LayoutObject::localOverflowRectForPaintInvalidation() const | 1562 LayoutRect LayoutObject::localOverflowRectForPaintInvalidation() const |
| 1573 { | 1563 { |
| 1574 ASSERT_NOT_REACHED(); | 1564 ASSERT_NOT_REACHED(); |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1831 firstLineContainer = toLayoutBlock(this)->nearestInnerBlockWithFirst
Line(); | 1821 firstLineContainer = toLayoutBlock(this)->nearestInnerBlockWithFirst
Line(); |
| 1832 } else if (isLayoutInline()) { | 1822 } else if (isLayoutInline()) { |
| 1833 // This object is a LayoutInline having FIRST_LINE_INHERITED pesudo
style changed. | 1823 // This object is a LayoutInline having FIRST_LINE_INHERITED pesudo
style changed. |
| 1834 // This method can be called even if the LayoutInline doesn't inters
ect the first line, | 1824 // This method can be called even if the LayoutInline doesn't inters
ect the first line, |
| 1835 // but we only need to invalidate if it does. | 1825 // but we only need to invalidate if it does. |
| 1836 if (InlineBox* firstLineBox = toLayoutInline(this)->firstLineBoxIncl
udingCulling()) { | 1826 if (InlineBox* firstLineBox = toLayoutInline(this)->firstLineBoxIncl
udingCulling()) { |
| 1837 if (firstLineBox->isFirstLineStyle()) | 1827 if (firstLineBox->isFirstLineStyle()) |
| 1838 firstLineContainer = toLayoutBlockFlow(containingBlock()); | 1828 firstLineContainer = toLayoutBlockFlow(containingBlock()); |
| 1839 } | 1829 } |
| 1840 } | 1830 } |
| 1841 if (firstLineContainer) { | 1831 if (firstLineContainer) |
| 1842 firstLineContainer->invalidateDisplayItemClientsOfFirstLine(); | 1832 firstLineContainer->setShouldDoFullPaintInvalidationForFirstLine(); |
| 1843 // The following is for rect invalidation. For slimming paint v2, we
can invalidate the rects | |
| 1844 // of the first line display item clients instead of the whole rect
of the container. | |
| 1845 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | |
| 1846 firstLineContainer->setShouldDoFullPaintInvalidation(); | |
| 1847 } | |
| 1848 } | 1833 } |
| 1849 if (diff.needsLayout()) | 1834 if (diff.needsLayout()) |
| 1850 setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::StyleChange)
; | 1835 setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::StyleChange)
; |
| 1851 } | 1836 } |
| 1852 | 1837 |
| 1853 void LayoutObject::markAncestorsForOverflowRecalcIfNeeded() | 1838 void LayoutObject::markAncestorsForOverflowRecalcIfNeeded() |
| 1854 { | 1839 { |
| 1855 LayoutObject* object = this; | 1840 LayoutObject* object = this; |
| 1856 do { | 1841 do { |
| 1857 // Cell and row need to propagate the flag to their containing section a
nd row as their containing block is the table wrapper. | 1842 // Cell and row need to propagate the flag to their containing section a
nd row as their containing block is the table wrapper. |
| (...skipping 1566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3424 } | 3409 } |
| 3425 | 3410 |
| 3426 void LayoutObject::clearPaintInvalidationFlags(const PaintInvalidationState& pai
ntInvalidationState) | 3411 void LayoutObject::clearPaintInvalidationFlags(const PaintInvalidationState& pai
ntInvalidationState) |
| 3427 { | 3412 { |
| 3428 // paintInvalidationStateIsDirty should be kept in sync with the | 3413 // paintInvalidationStateIsDirty should be kept in sync with the |
| 3429 // booleans that are cleared below. | 3414 // booleans that are cleared below. |
| 3430 ASSERT(!shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState()
|| paintInvalidationStateIsDirty()); | 3415 ASSERT(!shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState()
|| paintInvalidationStateIsDirty()); |
| 3431 clearShouldDoFullPaintInvalidation(); | 3416 clearShouldDoFullPaintInvalidation(); |
| 3432 m_bitfields.setChildShouldCheckForPaintInvalidation(false); | 3417 m_bitfields.setChildShouldCheckForPaintInvalidation(false); |
| 3433 m_bitfields.setNeededLayoutBecauseOfChildren(false); | 3418 m_bitfields.setNeededLayoutBecauseOfChildren(false); |
| 3434 m_bitfields.setShouldInvalidateOverflowForPaint(false); | |
| 3435 m_bitfields.setMayNeedPaintInvalidation(false); | 3419 m_bitfields.setMayNeedPaintInvalidation(false); |
| 3436 m_bitfields.setMayNeedPaintInvalidationSubtree(false); | 3420 m_bitfields.setMayNeedPaintInvalidationSubtree(false); |
| 3437 m_bitfields.setShouldInvalidateSelection(false); | 3421 m_bitfields.setShouldInvalidateSelection(false); |
| 3438 } | 3422 } |
| 3439 | 3423 |
| 3440 bool LayoutObject::isAllowedToModifyLayoutTreeStructure(Document& document) | 3424 bool LayoutObject::isAllowedToModifyLayoutTreeStructure(Document& document) |
| 3441 { | 3425 { |
| 3442 return DeprecatedDisableModifyLayoutTreeStructureAsserts::canModifyLayoutTre
eStateInAnyState() | 3426 return DeprecatedDisableModifyLayoutTreeStructureAsserts::canModifyLayoutTre
eStateInAnyState() |
| 3443 || document.lifecycle().stateAllowsLayoutTreeMutations(); | 3427 || document.lifecycle().stateAllowsLayoutTreeMutations(); |
| 3444 } | 3428 } |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3653 const blink::LayoutObject* root = object1; | 3637 const blink::LayoutObject* root = object1; |
| 3654 while (root->parent()) | 3638 while (root->parent()) |
| 3655 root = root->parent(); | 3639 root = root->parent(); |
| 3656 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3640 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3657 } else { | 3641 } else { |
| 3658 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3642 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
| 3659 } | 3643 } |
| 3660 } | 3644 } |
| 3661 | 3645 |
| 3662 #endif | 3646 #endif |
| OLD | NEW |