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

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

Issue 1899053002: Revert "Treat percent-height div inside auto-height cells as auto" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaseline Created 4 years, 8 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 2654 matching lines...) Expand 10 before | Expand all | Expand 10 after
2665 stretchedFlexHeight = toLayoutFlexibleBox(cb->parent())->childLogicalHei ghtForPercentageResolution(*cb); 2665 stretchedFlexHeight = toLayoutFlexibleBox(cb->parent())->childLogicalHei ghtForPercentageResolution(*cb);
2666 2666
2667 if (isHorizontalWritingMode() != cb->isHorizontalWritingMode()) { 2667 if (isHorizontalWritingMode() != cb->isHorizontalWritingMode()) {
2668 availableHeight = containingBlockChild->containingBlockLogicalWidthForCo ntent(); 2668 availableHeight = containingBlockChild->containingBlockLogicalWidthForCo ntent();
2669 } else if (stretchedFlexHeight != LayoutUnit(-1)) { 2669 } else if (stretchedFlexHeight != LayoutUnit(-1)) {
2670 availableHeight = stretchedFlexHeight; 2670 availableHeight = stretchedFlexHeight;
2671 } else if (hasOverrideContainingBlockLogicalHeight()) { 2671 } else if (hasOverrideContainingBlockLogicalHeight()) {
2672 availableHeight = overrideContainingBlockContentLogicalHeight(); 2672 availableHeight = overrideContainingBlockContentLogicalHeight();
2673 } else if (cb->isTableCell()) { 2673 } else if (cb->isTableCell()) {
2674 if (!skippedAutoHeightContainingBlock) { 2674 if (!skippedAutoHeightContainingBlock) {
2675 // The second clause in this conditional (after the ||) is to suppor t this line from the 2675 // Table cells violate what the CSS spec says to do with heights. Ba sically we
2676 // definition of height in CSS 2.2: 2676 // don't care if the cell specified a height or not. We just always make ourselves
2677 // "If the height of the containing block is not specified explicitl y (i.e., it depends on 2677 // be a percentage of the cell's current content height.
2678 // content height), and this element is not absolutely positioned, t he used height is 2678 if (!cb->hasOverrideLogicalContentHeight()) {
2679 // calculated as if 'auto' was specified."
2680 // But FF doesn't apply this logic (1) in quirks mode or (2) when "t his element" is a table.
2681 // TODO(dgrogan): Maybe we shouldn't make tables an exception. See h ttps://crbug.com/353580
2682 if (!cb->hasOverrideLogicalContentHeight() || (!document().inQuirksM ode() && !isTable() && cbstyle.logicalHeight().isAuto())) {
2683 // Normally we would let the cell size intrinsically, but scroll ing overflow has to be 2679 // Normally we would let the cell size intrinsically, but scroll ing overflow has to be
2684 // treated differently, since WinIE lets scrolled overflow regio ns shrink as needed. 2680 // treated differently, since WinIE lets scrolled overflow regio ns shrink as needed.
2685 // While we can't get all cases right, we can at least detect wh en the cell has a specified 2681 // While we can't get all cases right, we can at least detect wh en the cell has a specified
2686 // height or when the table has a specified height. In these cas es we want to initially have 2682 // height or when the table has a specified height. In these cas es we want to initially have
2687 // no size and allow the flexing of the table or the cell to its specified height to cause us 2683 // no size and allow the flexing of the table or the cell to its specified height to cause us
2688 // to grow to fill the space. This could end up being wrong in s ome cases, but it is 2684 // to grow to fill the space. This could end up being wrong in s ome cases, but it is
2689 // preferable to the alternative (sizing intrinsically and makin g the row end up too big). 2685 // preferable to the alternative (sizing intrinsically and makin g the row end up too big).
2690 LayoutTableCell* cell = toLayoutTableCell(cb); 2686 LayoutTableCell* cell = toLayoutTableCell(cb);
2691 if (scrollsOverflowY() && (!cell->style()->logicalHeight().isAut o() || !cell->table()->style()->logicalHeight().isAuto())) 2687 if (scrollsOverflowY() && (!cell->style()->logicalHeight().isAut o() || !cell->table()->style()->logicalHeight().isAuto()))
2692 return LayoutUnit(); 2688 return LayoutUnit();
(...skipping 2044 matching lines...) Expand 10 before | Expand all | Expand 10 after
4737 4733
4738 void LayoutBox::clearPercentHeightDescendants() 4734 void LayoutBox::clearPercentHeightDescendants()
4739 { 4735 {
4740 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) { 4736 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) {
4741 if (curr->isBox()) 4737 if (curr->isBox())
4742 toLayoutBox(curr)->removeFromPercentHeightContainer(); 4738 toLayoutBox(curr)->removeFromPercentHeightContainer();
4743 } 4739 }
4744 } 4740 }
4745 4741
4746 } // namespace blink 4742 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/linux/fast/table/split-table-section-before-anonymous-block-4-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698