Chromium Code Reviews| 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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. |
| 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 4355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4366 toLayoutTable(box)->forceSectionsRecalc(); | 4366 toLayoutTable(box)->forceSectionsRecalc(); |
| 4367 } else if (box->isTableSection()) { | 4367 } else if (box->isTableSection()) { |
| 4368 toLayoutTableSection(box)->setNeedsCellRecalc(); | 4368 toLayoutTableSection(box)->setNeedsCellRecalc(); |
| 4369 } | 4369 } |
| 4370 | 4370 |
| 4371 box->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalid ationReason::AnonymousBlockChange); | 4371 box->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalid ationReason::AnonymousBlockChange); |
| 4372 } | 4372 } |
| 4373 | 4373 |
| 4374 LayoutObject* LayoutBox::splitAnonymousBoxesAroundChild(LayoutObject* beforeChil d) | 4374 LayoutObject* LayoutBox::splitAnonymousBoxesAroundChild(LayoutObject* beforeChil d) |
| 4375 { | 4375 { |
| 4376 bool didSplitParentAnonymousBoxes = false; | 4376 LayoutBox* boxAtTopOfNewBranch = nullptr; |
| 4377 | 4377 |
| 4378 while (beforeChild->parent() != this) { | 4378 while (beforeChild->parent() != this) { |
| 4379 LayoutBox* boxToSplit = toLayoutBox(beforeChild->parent()); | 4379 LayoutBox* boxToSplit = toLayoutBox(beforeChild->parent()); |
| 4380 if (boxToSplit->slowFirstChild() != beforeChild && boxToSplit->isAnonymo us()) { | 4380 if (boxToSplit->slowFirstChild() != beforeChild && boxToSplit->isAnonymo us()) { |
| 4381 didSplitParentAnonymousBoxes = true; | |
| 4382 | 4381 |
| 4383 // We have to split the parent box into two boxes and move children | 4382 // We have to split the parent box into two boxes and move children |
| 4384 // from |beforeChild| to end into the new post box. | 4383 // from |beforeChild| to end into the new post box. |
| 4385 LayoutBox* postBox = boxToSplit->createAnonymousBoxWithSameTypeAs(th is); | 4384 LayoutBox* postBox = boxToSplit->createAnonymousBoxWithSameTypeAs(th is); |
| 4386 postBox->setChildrenInline(boxToSplit->childrenInline()); | 4385 postBox->setChildrenInline(boxToSplit->childrenInline()); |
| 4387 LayoutBox* parentBox = toLayoutBox(boxToSplit->parent()); | 4386 LayoutBox* parentBox = toLayoutBox(boxToSplit->parent()); |
| 4388 // We need to invalidate the |parentBox| before inserting the new no de | 4387 // We need to invalidate the |parentBox| before inserting the new no de |
| 4389 // so that the table paint invalidation logic knows the structure is dirty. | 4388 // so that the table paint invalidation logic knows the structure is dirty. |
| 4390 // See for example LayoutTableCell:clippedOverflowRectForPaintInvali dation. | 4389 // See for example LayoutTableCell:clippedOverflowRectForPaintInvali dation. |
| 4391 markBoxForRelayoutAfterSplit(parentBox); | 4390 markBoxForRelayoutAfterSplit(parentBox); |
| 4392 parentBox->virtualChildren()->insertChildNode(parentBox, postBox, bo xToSplit->nextSibling()); | 4391 parentBox->virtualChildren()->insertChildNode(parentBox, postBox, bo xToSplit->nextSibling()); |
| 4393 boxToSplit->moveChildrenTo(postBox, beforeChild, 0, true); | 4392 boxToSplit->moveChildrenTo(postBox, beforeChild, 0, true); |
| 4394 | 4393 |
| 4395 markBoxForRelayoutAfterSplit(boxToSplit); | 4394 markBoxForRelayoutAfterSplit(boxToSplit); |
| 4396 markBoxForRelayoutAfterSplit(postBox); | 4395 markBoxForRelayoutAfterSplit(postBox); |
| 4396 boxAtTopOfNewBranch = postBox; | |
| 4397 | 4397 |
| 4398 beforeChild = postBox; | 4398 beforeChild = postBox; |
| 4399 } else { | 4399 } else { |
| 4400 beforeChild = boxToSplit; | 4400 beforeChild = boxToSplit; |
| 4401 } | 4401 } |
| 4402 } | 4402 } |
| 4403 | 4403 |
| 4404 if (didSplitParentAnonymousBoxes) | 4404 // Splitting the box means the left side of the container chain will lose an y percent height descendants |
| 4405 // below |boxAtTopOfNewBranch| on the right hand side. | |
| 4406 if (boxAtTopOfNewBranch && LayoutBlock::hasPercentHeightContainerMap()) | |
| 4407 LayoutBlock::clearPercentHeightDescendantsFrom(boxAtTopOfNewBranch); | |
| 4408 | |
| 4409 if (boxAtTopOfNewBranch) | |
|
mstensho (USE GERRIT)
2016/01/25 19:37:07
We could if for |boxAtTopOfNewBranch| only once.
| |
| 4405 markBoxForRelayoutAfterSplit(this); | 4410 markBoxForRelayoutAfterSplit(this); |
| 4406 | 4411 |
| 4407 ASSERT(beforeChild->parent() == this); | 4412 ASSERT(beforeChild->parent() == this); |
| 4408 return beforeChild; | 4413 return beforeChild; |
| 4409 } | 4414 } |
| 4410 | 4415 |
| 4411 LayoutUnit LayoutBox::offsetFromLogicalTopOfFirstPage() const | 4416 LayoutUnit LayoutBox::offsetFromLogicalTopOfFirstPage() const |
| 4412 { | 4417 { |
| 4413 LayoutState* layoutState = view()->layoutState(); | 4418 LayoutState* layoutState = view()->layoutState(); |
| 4414 if (!layoutState || !layoutState->isPaginated()) | 4419 if (!layoutState || !layoutState->isPaginated()) |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4605 } | 4610 } |
| 4606 | 4611 |
| 4607 void LayoutBox::clearPreviousPaintInvalidationRects() | 4612 void LayoutBox::clearPreviousPaintInvalidationRects() |
| 4608 { | 4613 { |
| 4609 LayoutBoxModelObject::clearPreviousPaintInvalidationRects(); | 4614 LayoutBoxModelObject::clearPreviousPaintInvalidationRects(); |
| 4610 if (PaintLayerScrollableArea* scrollableArea = this->scrollableArea()) | 4615 if (PaintLayerScrollableArea* scrollableArea = this->scrollableArea()) |
| 4611 scrollableArea->clearPreviousPaintInvalidationRects(); | 4616 scrollableArea->clearPreviousPaintInvalidationRects(); |
| 4612 } | 4617 } |
| 4613 | 4618 |
| 4614 } // namespace blink | 4619 } // namespace blink |
| OLD | NEW |