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 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1705 else | 1705 else |
1706 setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::StyleChange); | 1706 setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::StyleChange); |
1707 } | 1707 } |
1708 | 1708 |
1709 if (diff.needsPaintInvalidationSubtree() || | 1709 if (diff.needsPaintInvalidationSubtree() || |
1710 updatedDiff.needsPaintInvalidationSubtree()) | 1710 updatedDiff.needsPaintInvalidationSubtree()) |
1711 setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants(); | 1711 setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants(); |
1712 else if (diff.needsPaintInvalidationObject() || | 1712 else if (diff.needsPaintInvalidationObject() || |
1713 updatedDiff.needsPaintInvalidationObject()) | 1713 updatedDiff.needsPaintInvalidationObject()) |
1714 setShouldDoFullPaintInvalidation(); | 1714 setShouldDoFullPaintInvalidation(); |
1715 else if (diff.needsPaintInvalidationSelection()) | |
1716 invalidatePaintForSelection(); | |
1715 | 1717 |
1716 // Text nodes share style with their parents but the paint properties don't | 1718 // Text nodes share style with their parents but the paint properties don't |
1717 // apply to them, hence the !isText() check. | 1719 // apply to them, hence the !isText() check. |
1718 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && !isText() && | 1720 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && !isText() && |
1719 (diff.transformChanged() || diff.opacityChanged() || | 1721 (diff.transformChanged() || diff.opacityChanged() || |
1720 diff.zIndexChanged() || diff.filterChanged() || | 1722 diff.zIndexChanged() || diff.filterChanged() || |
1721 diff.backdropFilterChanged() || diff.cssClipChanged())) { | 1723 diff.backdropFilterChanged() || diff.cssClipChanged())) { |
1722 setNeedsPaintPropertyUpdate(); | 1724 setNeedsPaintPropertyUpdate(); |
1723 | 1725 |
1724 // We don't need to invalidate paint of objects on SPv2 when only paint | 1726 // We don't need to invalidate paint of objects on SPv2 when only paint |
(...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3460 | 3462 |
3461 LayoutRect LayoutObject::debugRect() const { | 3463 LayoutRect LayoutObject::debugRect() const { |
3462 LayoutRect rect; | 3464 LayoutRect rect; |
3463 LayoutBlock* block = containingBlock(); | 3465 LayoutBlock* block = containingBlock(); |
3464 if (block) | 3466 if (block) |
3465 block->adjustChildDebugRect(rect); | 3467 block->adjustChildDebugRect(rect); |
3466 | 3468 |
3467 return rect; | 3469 return rect; |
3468 } | 3470 } |
3469 | 3471 |
3472 void LayoutObject::invalidatePaintForSelection() { | |
3473 LayoutBlock* block = | |
3474 isLayoutBlock() ? toLayoutBlock(this) : containingBlock(); | |
mstensho (USE GERRIT)
2017/02/21 21:03:54
Even if you also explain it in the commit comment,
rune
2017/02/21 21:42:00
OK.
rune
2017/02/21 22:34:57
Done.
| |
3475 if (!block) | |
3476 return; | |
3477 if (!block->hasSelectedChildren()) | |
3478 return; | |
3479 for (LayoutObject* child = slowFirstChild(); child; | |
mstensho (USE GERRIT)
2017/02/21 21:03:54
Likewise, I think it's worth mentioning right here
rune
2017/02/21 21:42:00
Acknowledged.
rune
2017/02/21 22:34:57
Done.
| |
3480 child = child->nextSibling()) { | |
3481 if (!child->canBeSelectionLeaf()) | |
3482 continue; | |
3483 if (child->getSelectionState() == SelectionNone) | |
3484 continue; | |
3485 child->setShouldInvalidateSelection(); | |
3486 } | |
3487 } | |
3488 | |
3470 } // namespace blink | 3489 } // namespace blink |
3471 | 3490 |
3472 #ifndef NDEBUG | 3491 #ifndef NDEBUG |
3473 | 3492 |
3474 void showTree(const blink::LayoutObject* object) { | 3493 void showTree(const blink::LayoutObject* object) { |
3475 if (object) | 3494 if (object) |
3476 object->showTreeForThis(); | 3495 object->showTreeForThis(); |
3477 else | 3496 else |
3478 WTFLogAlways("%s", "Cannot showTree. Root is (nil)"); | 3497 WTFLogAlways("%s", "Cannot showTree. Root is (nil)"); |
3479 } | 3498 } |
(...skipping 15 matching lines...) Expand all Loading... | |
3495 const blink::LayoutObject* root = object1; | 3514 const blink::LayoutObject* root = object1; |
3496 while (root->parent()) | 3515 while (root->parent()) |
3497 root = root->parent(); | 3516 root = root->parent(); |
3498 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3517 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3499 } else { | 3518 } else { |
3500 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3519 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
3501 } | 3520 } |
3502 } | 3521 } |
3503 | 3522 |
3504 #endif | 3523 #endif |
OLD | NEW |