Chromium Code Reviews| Index: Source/core/layout/LayoutBlock.cpp |
| diff --git a/Source/core/layout/LayoutBlock.cpp b/Source/core/layout/LayoutBlock.cpp |
| index 116c979367c9b7c7fc0eb820d6eeff761531ee70..5ed9d6a3ba35c1c6af96047ada0cc1525352990c 100644 |
| --- a/Source/core/layout/LayoutBlock.cpp |
| +++ b/Source/core/layout/LayoutBlock.cpp |
| @@ -562,14 +562,14 @@ void LayoutBlock::promoteAllChildrenAndInsertAfter() |
| LayoutBlock* parent = toLayoutBlock(this->parent()); |
| LayoutObject* nextSiblingOfPromotees = nextSibling(); |
| for (LayoutObject* o = firstPromotee; o; o = o->nextSibling()) |
| - o->setParent(parent); |
| + DangerousLayoutTreeMutator(*o).setParent(parent); |
| children()->setFirstChild(nullptr); |
| children()->setLastChild(nullptr); |
| - firstPromotee->setPreviousSibling(this); |
| - setNextSibling(firstPromotee); |
| - lastPromotee->setNextSibling(nextSiblingOfPromotees); |
| + DangerousLayoutTreeMutator(*firstPromotee).setPreviousSibling(this); |
| + DangerousLayoutTreeMutator(*this).setNextSibling(firstPromotee); |
| + DangerousLayoutTreeMutator(*lastPromotee).setNextSibling(nextSiblingOfPromotees); |
| if (nextSiblingOfPromotees) |
| - nextSiblingOfPromotees->setPreviousSibling(lastPromotee); |
| + DangerousLayoutTreeMutator(*nextSiblingOfPromotees).setPreviousSibling(lastPromotee); |
|
esprehn
2015/08/21 21:20:32
Instead of having all methods I'd prefer it only h
Xianzhu
2015/08/21 22:52:19
Thanks for the finding. Actually I didn't look int
|
| if (parent->children()->lastChild() == this) |
| parent->children()->setLastChild(lastPromotee); |
| } |
| @@ -589,7 +589,7 @@ void LayoutBlock::removeLeftoverAnonymousBlock(LayoutBlock* child) |
| child->promoteAllChildrenAndInsertAfter(); |
| // Remove all the information in the flow thread associated with the leftover anonymous block. |
| - child->removeFromLayoutFlowThread(); |
| + DangerousLayoutTreeMutator(*child).removeFromLayoutFlowThread(); |
|
esprehn
2015/08/21 21:20:31
I think I would just make removeFromLayoutFlowThre
Xianzhu
2015/08/21 22:52:19
Done.
|
| // LayoutGrid keeps track of its children, we must notify it about changes in the tree. |
| if (child->parent()->isLayoutGrid()) |
| @@ -2778,7 +2778,7 @@ static bool recalcNormalFlowChildOverflowIfNeeded(LayoutObject* layoutObject) |
| bool LayoutBlock::recalcChildOverflowAfterStyleChange() |
| { |
| ASSERT(childNeedsOverflowRecalcAfterStyleChange()); |
| - setChildNeedsOverflowRecalcAfterStyleChange(false); |
| + clearChildNeedsOverflowRecalcAfterStyleChange(); |
| bool childrenOverflowChanged = false; |
| @@ -2834,7 +2834,7 @@ bool LayoutBlock::recalcOverflowAfterStyleChange() |
| if (!selfNeedsOverflowRecalcAfterStyleChange() && !childrenOverflowChanged) |
| return false; |
| - setSelfNeedsOverflowRecalcAfterStyleChange(false); |
| + clearSelfNeedsOverflowRecalcAfterStyleChange(); |
| // If the current block needs layout, overflow will be recalculated during |
| // layout time anyway. We can safely exit here. |
| if (needsLayout()) |