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

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

Issue 2700183003: Revert of Avoid pathological layout on nested percent height tables (Closed)
Patch Set: 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 if (section.needsLayout()) { 454 section.layoutIfNeeded();
455 section.layout(); 455 int sectionLogicalHeight = section.calcRowLogicalHeight();
456 section.setLogicalHeight(LayoutUnit(section.calcRowLogicalHeight())); 456 section.setLogicalHeight(LayoutUnit(sectionLogicalHeight));
457 }
458 if (view()->layoutState()->isPaginated()) 457 if (view()->layoutState()->isPaginated())
459 updateFragmentationInfoForChild(section); 458 updateFragmentationInfoForChild(section);
460 setLogicalHeight(logicalHeight() + section.logicalHeight()); 459 setLogicalHeight(logicalHeight() + sectionLogicalHeight);
461 } 460 }
462 461
463 LayoutUnit LayoutTable::logicalHeightFromStyle() const { 462 LayoutUnit LayoutTable::logicalHeightFromStyle() const {
464 LayoutUnit computedLogicalHeight; 463 LayoutUnit computedLogicalHeight;
465 Length logicalHeightLength = style()->logicalHeight(); 464 Length logicalHeightLength = style()->logicalHeight();
466 if (logicalHeightLength.isIntrinsic() || 465 if (logicalHeightLength.isIntrinsic() ||
467 (logicalHeightLength.isSpecified() && logicalHeightLength.isPositive())) { 466 (logicalHeightLength.isSpecified() && logicalHeightLength.isPositive())) {
468 computedLogicalHeight = 467 computedLogicalHeight =
469 convertStyleLogicalHeightToComputedHeight(logicalHeightLength); 468 convertStyleLogicalHeightToComputedHeight(logicalHeightLength);
470 } 469 }
(...skipping 24 matching lines...) Expand all
495 void LayoutTable::distributeExtraLogicalHeight(int extraLogicalHeight) { 494 void LayoutTable::distributeExtraLogicalHeight(int extraLogicalHeight) {
496 if (extraLogicalHeight <= 0) 495 if (extraLogicalHeight <= 0)
497 return; 496 return;
498 497
499 // FIXME: Distribute the extra logical height between all table sections 498 // FIXME: Distribute the extra logical height between all table sections
500 // instead of giving it all to the first one. 499 // instead of giving it all to the first one.
501 if (LayoutTableSection* section = firstBody()) 500 if (LayoutTableSection* section = firstBody())
502 extraLogicalHeight -= 501 extraLogicalHeight -=
503 section->distributeExtraLogicalHeightToRows(extraLogicalHeight); 502 section->distributeExtraLogicalHeightToRows(extraLogicalHeight);
504 503
505 // crbug.com/690087: We really would like to enable this ASSERT to ensure that 504 // FIXME: We really would like to enable this ASSERT to ensure that all the
506 // all the extra space has been distributed. 505 // extra space has been distributed.
507 // However our current distribution algorithm does not round properly and thus 506 // However our current distribution algorithm does not round properly and thus
508 // we can have some remaining height. 507 // we can have some remaining height.
509 // ASSERT(!topSection() || !extraLogicalHeight); 508 // ASSERT(!topSection() || !extraLogicalHeight);
510 } 509 }
511 510
512 void LayoutTable::simplifiedNormalFlowLayout() { 511 void LayoutTable::simplifiedNormalFlowLayout() {
513 // FIXME: We should walk through the items in the tree in tree order to do the 512 // FIXME: We should walk through the items in the tree in tree order to do the
514 // layout here instead of walking through individual parts of the tree. 513 // layout here instead of walking through individual parts of the tree.
515 // crbug.com/442737 514 // crbug.com/442737
516 for (auto& caption : m_captions) 515 for (auto& caption : m_captions)
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1689 } 1688 }
1690 1689
1691 LayoutUnit LayoutTable::paddingRight() const { 1690 LayoutUnit LayoutTable::paddingRight() const {
1692 if (collapseBorders()) 1691 if (collapseBorders())
1693 return LayoutUnit(); 1692 return LayoutUnit();
1694 1693
1695 return LayoutBlock::paddingRight(); 1694 return LayoutBlock::paddingRight();
1696 } 1695 }
1697 1696
1698 } // namespace blink 1697 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698