| 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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 } | 612 } |
| 613 | 613 |
| 614 PaintLayer* LayoutObject::paintingLayer() const { | 614 PaintLayer* LayoutObject::paintingLayer() const { |
| 615 for (const LayoutObject* current = this; current; | 615 for (const LayoutObject* current = this; current; |
| 616 // Use containingBlock instead of paintInvalidationParent for floating | 616 // Use containingBlock instead of paintInvalidationParent for floating |
| 617 // object to omit any self-painting layers of inline objects that don't | 617 // object to omit any self-painting layers of inline objects that don't |
| 618 // paint the floating object. | 618 // paint the floating object. |
| 619 current = current->isFloating() ? current->containingBlock() | 619 current = current->isFloating() ? current->containingBlock() |
| 620 : current->paintInvalidationParent()) { | 620 : current->paintInvalidationParent()) { |
| 621 if (current->hasLayer() && | 621 if (current->hasLayer() && |
| 622 toLayoutBoxModelObject(current)->layer()->isSelfPaintingLayer()) | 622 toLayoutBoxModelObject(current)->layer()->isSelfPaintingLayer()) { |
| 623 return toLayoutBoxModelObject(current)->layer(); | 623 return toLayoutBoxModelObject(current)->layer(); |
| 624 } else if (current->isColumnSpanAll()) { |
| 625 // Column spanners paint through their multicolumn containers which can |
| 626 // be accessed through the associated out-of-flow placeholder's parent. |
| 627 current = current->spannerPlaceholder(); |
| 628 } |
| 624 } | 629 } |
| 625 // TODO(crbug.com/365897): we should get rid of detached layout subtrees, at | 630 // TODO(crbug.com/365897): we should get rid of detached layout subtrees, at |
| 626 // which point this code should not be reached. | 631 // which point this code should not be reached. |
| 627 return nullptr; | 632 return nullptr; |
| 628 } | 633 } |
| 629 | 634 |
| 630 bool LayoutObject::scrollRectToVisible(const LayoutRect& rect, | 635 bool LayoutObject::scrollRectToVisible(const LayoutRect& rect, |
| 631 const ScrollAlignment& alignX, | 636 const ScrollAlignment& alignX, |
| 632 const ScrollAlignment& alignY, | 637 const ScrollAlignment& alignY, |
| 633 ScrollType scrollType, | 638 ScrollType scrollType, |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1183 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); | 1188 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); |
| 1184 | 1189 |
| 1185 clearPaintInvalidationFlags(); | 1190 clearPaintInvalidationFlags(); |
| 1186 } | 1191 } |
| 1187 | 1192 |
| 1188 DISABLE_CFI_PERF | 1193 DISABLE_CFI_PERF |
| 1189 void LayoutObject::invalidatePaintOfSubtreesIfNeeded( | 1194 void LayoutObject::invalidatePaintOfSubtreesIfNeeded( |
| 1190 const PaintInvalidationState& childPaintInvalidationState) { | 1195 const PaintInvalidationState& childPaintInvalidationState) { |
| 1191 DCHECK(!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); | 1196 DCHECK(!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); |
| 1192 | 1197 |
| 1193 for (LayoutObject* child = slowFirstChild(); child; | 1198 for (auto* child = slowFirstChild(); child; child = child->nextSibling()) |
| 1194 child = child->nextSibling()) { | |
| 1195 // Column spanners are invalidated through their placeholders. See | |
| 1196 // LayoutMultiColumnSpannerPlaceholder::invalidatePaintOfSubtreesIfNeeded(). | |
| 1197 if (child->isColumnSpanAll()) | |
| 1198 continue; | |
| 1199 child->invalidateTreeIfNeeded(childPaintInvalidationState); | 1199 child->invalidateTreeIfNeeded(childPaintInvalidationState); |
| 1200 } | |
| 1201 } | 1200 } |
| 1202 | 1201 |
| 1203 LayoutRect LayoutObject::selectionRectInViewCoordinates() const { | 1202 LayoutRect LayoutObject::selectionRectInViewCoordinates() const { |
| 1204 LayoutRect selectionRect = localSelectionRect(); | 1203 LayoutRect selectionRect = localSelectionRect(); |
| 1205 if (!selectionRect.isEmpty()) | 1204 if (!selectionRect.isEmpty()) |
| 1206 mapToVisualRectInAncestorSpace(view(), selectionRect); | 1205 mapToVisualRectInAncestorSpace(view(), selectionRect); |
| 1207 return selectionRect; | 1206 return selectionRect; |
| 1208 } | 1207 } |
| 1209 | 1208 |
| 1210 PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded( | 1209 PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded( |
| (...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2547 | 2546 |
| 2548 if (isFloating()) | 2547 if (isFloating()) |
| 2549 return containingBlock(ancestor, ancestorSkipped, filterSkipped); | 2548 return containingBlock(ancestor, ancestorSkipped, filterSkipped); |
| 2550 | 2549 |
| 2551 return parent(); | 2550 return parent(); |
| 2552 } | 2551 } |
| 2553 | 2552 |
| 2554 inline LayoutObject* LayoutObject::paintInvalidationParent() const { | 2553 inline LayoutObject* LayoutObject::paintInvalidationParent() const { |
| 2555 if (isLayoutView()) | 2554 if (isLayoutView()) |
| 2556 return LayoutAPIShim::layoutObjectFrom(frame()->ownerLayoutItem()); | 2555 return LayoutAPIShim::layoutObjectFrom(frame()->ownerLayoutItem()); |
| 2557 if (isColumnSpanAll()) | |
| 2558 return spannerPlaceholder(); | |
| 2559 return parent(); | 2556 return parent(); |
| 2560 } | 2557 } |
| 2561 | 2558 |
| 2562 LayoutObject* LayoutObject::slowPaintInvalidationParentForTesting() const { | 2559 LayoutObject* LayoutObject::slowPaintInvalidationParentForTesting() const { |
| 2563 return paintInvalidationParent(); | 2560 return paintInvalidationParent(); |
| 2564 } | 2561 } |
| 2565 | 2562 |
| 2566 bool LayoutObject::isSelectionBorder() const { | 2563 bool LayoutObject::isSelectionBorder() const { |
| 2567 SelectionState st = getSelectionState(); | 2564 SelectionState st = getSelectionState(); |
| 2568 return st == SelectionStart || st == SelectionEnd || st == SelectionBoth; | 2565 return st == SelectionStart || st == SelectionEnd || st == SelectionBoth; |
| (...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3540 const blink::LayoutObject* root = object1; | 3537 const blink::LayoutObject* root = object1; |
| 3541 while (root->parent()) | 3538 while (root->parent()) |
| 3542 root = root->parent(); | 3539 root = root->parent(); |
| 3543 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3540 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3544 } else { | 3541 } else { |
| 3545 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3542 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
| 3546 } | 3543 } |
| 3547 } | 3544 } |
| 3548 | 3545 |
| 3549 #endif | 3546 #endif |
| OLD | NEW |