Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| index c9bf7393540467dee08ab8c15b8e043ae016d421..1e0237ef08ef2acf3d26c1b9d090547e0294ba6d 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| @@ -1341,10 +1341,8 @@ void LayoutObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInv |
| void LayoutObject::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationState& childPaintInvalidationState) |
| { |
| - for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibling()) { |
| - if (!child->isOutOfFlowPositioned()) |
| - child->invalidateTreeIfNeeded(childPaintInvalidationState); |
| - } |
| + for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibling()) |
|
chrishtr
2016/03/31 00:15:02
Document the new traversal order and any other per
Xianzhu
2016/03/31 01:41:28
Done.
|
| + child->invalidateTreeIfNeeded(childPaintInvalidationState); |
| } |
| static PassOwnPtr<TracedValue> jsonObjectForOldAndNewRects(const LayoutRect& oldRect, const LayoutPoint& oldLocation, const LayoutRect& newRect, const LayoutPoint& newLocation) |
| @@ -1435,8 +1433,7 @@ PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(const PaintInvalid |
| return PaintInvalidationNone; // Don't invalidate paints if we're printing. |
| const LayoutBoxModelObject& paintInvalidationContainer = paintInvalidationState.paintInvalidationContainer(); |
| - // TODO(wangxianzhu): Enable this assert after we fix all paintInvalidationContainer mismatch issues. crbug.com/360286 |
| - // ASSERT(paintInvalidationContainer == containerForPaintInvalidation()); |
| + ASSERT(paintInvalidationContainer == containerForPaintInvalidation()); |
| const LayoutRect oldBounds = previousPaintInvalidationRect(); |
| const LayoutPoint oldLocation = RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() ? LayoutPoint() : previousPositionFromPaintInvalidationBacking(); |
| @@ -2628,6 +2625,11 @@ LayoutObject* LayoutObject::containerCrossingFrameBoundaries() const |
| return isLayoutView() ? frame()->ownerLayoutObject() : container(); |
|
chrishtr
2016/03/31 00:15:02
Delete this method?
Xianzhu
2016/03/31 01:41:28
Done.
|
| } |
| +LayoutObject* LayoutObject::parentCrossingFrameBoundaries() const |
| +{ |
| + return isLayoutView() ? frame()->ownerLayoutObject() : parent(); |
| +} |
| + |
| bool LayoutObject::isSelectionBorder() const |
| { |
| SelectionState st = getSelectionState(); |
| @@ -3429,9 +3431,9 @@ static PaintInvalidationReason documentLifecycleBasedPaintInvalidationReason(con |
| } |
| } |
| -inline void LayoutObject::markContainerChainForPaintInvalidation() |
| +inline void LayoutObject::markAncestorsForPaintInvalidation() |
| { |
| - for (LayoutObject* container = this->containerCrossingFrameBoundaries(); container && !container->shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState(); container = container->containerCrossingFrameBoundaries()) |
| + for (LayoutObject* container = this->parentCrossingFrameBoundaries(); container && !container->shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState(); container = container->parentCrossingFrameBoundaries()) |
| container->m_bitfields.setChildShouldCheckForPaintInvalidation(true); |
| } |
| @@ -3440,7 +3442,7 @@ void LayoutObject::setShouldInvalidateSelection() |
| if (!canUpdateSelectionOnRootLineBoxes()) |
| return; |
| m_bitfields.setShouldInvalidateSelection(true); |
| - markContainerChainForPaintInvalidation(); |
| + markAncestorsForPaintInvalidation(); |
| frameView()->scheduleVisualUpdateForPaintInvalidationIfNeeded(); |
| } |
| @@ -3456,7 +3458,7 @@ void LayoutObject::setShouldDoFullPaintInvalidation(PaintInvalidationReason reas |
| reason = documentLifecycleBasedPaintInvalidationReason(document().lifecycle()); |
| m_bitfields.setFullPaintInvalidationReason(reason); |
| if (!isUpgradingDelayedFullToFull) |
| - markContainerChainForPaintInvalidation(); |
| + markAncestorsForPaintInvalidation(); |
| } |
| frameView()->scheduleVisualUpdateForPaintInvalidationIfNeeded(); |
| @@ -3467,7 +3469,7 @@ void LayoutObject::setMayNeedPaintInvalidation() |
| if (mayNeedPaintInvalidation()) |
| return; |
| m_bitfields.setMayNeedPaintInvalidation(true); |
| - markContainerChainForPaintInvalidation(); |
| + markAncestorsForPaintInvalidation(); |
| frameView()->scheduleVisualUpdateForPaintInvalidationIfNeeded(); |
| } |