Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 1551573002: Clear box from percentage descendants when it is split off from the ancestor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 4640 matching lines...) Expand 10 before | Expand all | Expand 10 after
4651 // We need to invalidate the |parentBox| before inserting the new no de 4651 // We need to invalidate the |parentBox| before inserting the new no de
4652 // so that the table paint invalidation logic knows the structure is dirty. 4652 // so that the table paint invalidation logic knows the structure is dirty.
4653 // See for example LayoutTableCell:clippedOverflowRectForPaintInvali dation. 4653 // See for example LayoutTableCell:clippedOverflowRectForPaintInvali dation.
4654 markBoxForRelayoutAfterSplit(parentBox); 4654 markBoxForRelayoutAfterSplit(parentBox);
4655 parentBox->virtualChildren()->insertChildNode(parentBox, postBox, bo xToSplit->nextSibling()); 4655 parentBox->virtualChildren()->insertChildNode(parentBox, postBox, bo xToSplit->nextSibling());
4656 boxToSplit->moveChildrenTo(postBox, beforeChild, 0, true); 4656 boxToSplit->moveChildrenTo(postBox, beforeChild, 0, true);
4657 4657
4658 markBoxForRelayoutAfterSplit(boxToSplit); 4658 markBoxForRelayoutAfterSplit(boxToSplit);
4659 markBoxForRelayoutAfterSplit(postBox); 4659 markBoxForRelayoutAfterSplit(postBox);
4660 4660
4661 // Splitting the box means the left side of the container chain will lose any percent height descendants
4662 // below |postBox| in the right hand side.
4663 if (LayoutBlock::hasPercentHeightContainerMap())
mstensho (USE GERRIT) 2016/01/18 20:06:24 Can this be moved to a separate CL? This change is
mstensho (USE GERRIT) 2016/01/21 19:12:32 Well? :)
4664 LayoutBlock::clearPercentHeightDescendantsFrom(postBox);
4665
4661 beforeChild = postBox; 4666 beforeChild = postBox;
4662 } else { 4667 } else {
4663 beforeChild = boxToSplit; 4668 // If a lone anonymous block is now unnecessary. Collapse it away an d skip to its parent.
mstensho (USE GERRIT) 2016/01/18 20:06:24 "If" without "then". :-P Did you mean to write th
4669 if (!boxToSplit->isLayoutBlock() || !toLayoutBlock(boxToSplit)->coll apseLoneAnonymousBlock(toLayoutBlock(boxToSplit)))
mstensho (USE GERRIT) 2016/01/18 20:06:24 I hope collapseLoneAnonymousBlock() can be static.
4670 beforeChild = boxToSplit;
4664 } 4671 }
mstensho (USE GERRIT) 2016/01/18 20:06:24 What if collapseLoneAnonymousBlock() did something
4665 } 4672 }
4666 4673
4667 if (didSplitParentAnonymousBoxes) 4674 if (didSplitParentAnonymousBoxes)
4668 markBoxForRelayoutAfterSplit(this); 4675 markBoxForRelayoutAfterSplit(this);
4669 4676
4670 ASSERT(beforeChild->parent() == this); 4677 ASSERT(beforeChild->parent() == this);
4671 return beforeChild; 4678 return beforeChild;
4672 } 4679 }
4673 4680
4674 LayoutUnit LayoutBox::offsetFromLogicalTopOfFirstPage() const 4681 LayoutUnit LayoutBox::offsetFromLogicalTopOfFirstPage() const
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
4868 } 4875 }
4869 4876
4870 void LayoutBox::clearPreviousPaintInvalidationRects() 4877 void LayoutBox::clearPreviousPaintInvalidationRects()
4871 { 4878 {
4872 LayoutBoxModelObject::clearPreviousPaintInvalidationRects(); 4879 LayoutBoxModelObject::clearPreviousPaintInvalidationRects();
4873 if (PaintLayerScrollableArea* scrollableArea = this->scrollableArea()) 4880 if (PaintLayerScrollableArea* scrollableArea = this->scrollableArea())
4874 scrollableArea->clearPreviousPaintInvalidationRects(); 4881 scrollableArea->clearPreviousPaintInvalidationRects();
4875 } 4882 }
4876 4883
4877 } // namespace blink 4884 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698