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

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

Issue 2670603002: Avoid pathological layout on nested percent height tables (Closed)
Patch Set: bug 687061 Created 3 years, 10 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) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc.
8 * All rights reserved. 8 * All rights reserved.
9 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 9 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
10 * 10 *
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 } 444 }
445 445
446 void LayoutTable::layoutSection(LayoutTableSection& section, 446 void LayoutTable::layoutSection(LayoutTableSection& section,
447 SubtreeLayoutScope& layouter, 447 SubtreeLayoutScope& layouter,
448 LayoutUnit logicalLeft) { 448 LayoutUnit logicalLeft) {
449 section.setLogicalLocation(LayoutPoint(logicalLeft, logicalHeight())); 449 section.setLogicalLocation(LayoutPoint(logicalLeft, logicalHeight()));
450 if (m_columnLogicalWidthChanged) 450 if (m_columnLogicalWidthChanged)
451 layouter.setChildNeedsLayout(&section); 451 layouter.setChildNeedsLayout(&section);
452 if (!section.needsLayout()) 452 if (!section.needsLayout())
453 markChildForPaginationRelayoutIfNeeded(section, layouter); 453 markChildForPaginationRelayoutIfNeeded(section, layouter);
454 bool neededLayout = section.needsLayout();
mstensho (USE GERRIT) 2017/02/06 21:11:07 Might as well do: if (section.needsLayout()) {
rhogan 2017/02/06 21:21:08 section.layout() is private, should I just make it
mstensho (USE GERRIT) 2017/02/06 21:25:27 Oh. Yes. This is exactly why it's problematic to o
454 section.layoutIfNeeded(); 455 section.layoutIfNeeded();
455 int sectionLogicalHeight = section.calcRowLogicalHeight(); 456 if (neededLayout)
456 section.setLogicalHeight(LayoutUnit(sectionLogicalHeight)); 457 section.setLogicalHeight(LayoutUnit(section.calcRowLogicalHeight()));
457 if (view()->layoutState()->isPaginated()) 458 if (view()->layoutState()->isPaginated())
458 updateFragmentationInfoForChild(section); 459 updateFragmentationInfoForChild(section);
459 setLogicalHeight(logicalHeight() + sectionLogicalHeight); 460 setLogicalHeight(logicalHeight() + section.logicalHeight());
460 } 461 }
461 462
462 LayoutUnit LayoutTable::logicalHeightFromStyle() const { 463 LayoutUnit LayoutTable::logicalHeightFromStyle() const {
463 LayoutUnit computedLogicalHeight; 464 LayoutUnit computedLogicalHeight;
464 Length logicalHeightLength = style()->logicalHeight(); 465 Length logicalHeightLength = style()->logicalHeight();
465 if (logicalHeightLength.isIntrinsic() || 466 if (logicalHeightLength.isIntrinsic() ||
466 (logicalHeightLength.isSpecified() && logicalHeightLength.isPositive())) { 467 (logicalHeightLength.isSpecified() && logicalHeightLength.isPositive())) {
467 computedLogicalHeight = 468 computedLogicalHeight =
468 convertStyleLogicalHeightToComputedHeight(logicalHeightLength); 469 convertStyleLogicalHeightToComputedHeight(logicalHeightLength);
469 } 470 }
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after
1688 } 1689 }
1689 1690
1690 LayoutUnit LayoutTable::paddingRight() const { 1691 LayoutUnit LayoutTable::paddingRight() const {
1691 if (collapseBorders()) 1692 if (collapseBorders())
1692 return LayoutUnit(); 1693 return LayoutUnit();
1693 1694
1694 return LayoutBlock::paddingRight(); 1695 return LayoutBlock::paddingRight();
1695 } 1696 }
1696 1697
1697 } // namespace blink 1698 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698