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

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

Issue 1591043002: Treat percent-height boxes inside auto-height cells as auto (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@3_cell_height
Patch Set: make layout tests all pass 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 2570 matching lines...) Expand 10 before | Expand all | Expand 10 after
2581 bool isOutOfFlowPositionedWithSpecifiedHeight = cb->isOutOfFlowPositioned() && (!cbstyle.logicalHeight().isAuto() || (!cbstyle.logicalTop().isAuto() && !cbs tyle.logicalBottom().isAuto())); 2581 bool isOutOfFlowPositionedWithSpecifiedHeight = cb->isOutOfFlowPositioned() && (!cbstyle.logicalHeight().isAuto() || (!cbstyle.logicalTop().isAuto() && !cbs tyle.logicalBottom().isAuto()));
2582 2582
2583 bool includeBorderPadding = isTable(); 2583 bool includeBorderPadding = isTable();
2584 2584
2585 if (isHorizontalWritingMode() != cb->isHorizontalWritingMode()) { 2585 if (isHorizontalWritingMode() != cb->isHorizontalWritingMode()) {
2586 availableHeight = containingBlockChild->containingBlockLogicalWidthForCo ntent(); 2586 availableHeight = containingBlockChild->containingBlockLogicalWidthForCo ntent();
2587 } else if (hasOverrideContainingBlockLogicalHeight()) { 2587 } else if (hasOverrideContainingBlockLogicalHeight()) {
2588 availableHeight = overrideContainingBlockContentLogicalHeight(); 2588 availableHeight = overrideContainingBlockContentLogicalHeight();
2589 } else if (cb->isTableCell()) { 2589 } else if (cb->isTableCell()) {
2590 if (!skippedAutoHeightContainingBlock) { 2590 if (!skippedAutoHeightContainingBlock) {
2591 // Table cells violate what the CSS spec says to do with heights. Ba sically we 2591 // The second clause in this conditional (after the ||) is to suppor t this line from the
2592 // don't care if the cell specified a height or not. We just always make ourselves 2592 // definition of height in CSS 2.2:
2593 // be a percentage of the cell's current content height. 2593 // "If the height of the containing block is not specified explicitl y (i.e., it depends on
2594 if (!cb->hasOverrideLogicalContentHeight()) { 2594 // content height), and this element is not absolutely positioned, t he used height is
2595 // calculated as if 'auto' was specified."
2596 // But FF doesn't apply this logic (1) in quirks mode or (2) when "t his element" is a table.
mstensho (USE GERRIT) 2016/01/21 20:21:33 https://dev.windows.com/en-us/microsoft-edge/tools
dgrogan 2016/01/22 00:08:09 Yeah, Edge shows the red square :(
mstensho (USE GERRIT) 2016/01/22 10:15:36 I still think we take the chance and land this cha
dgrogan 2016/01/22 17:41:48 His answer for now is "don't know, will ask around
2597 // Though I can't find documentation to support either of those.
mstensho (USE GERRIT) 2016/01/21 20:21:33 And I don't think you ever will. Because, tables!!
dgrogan 2016/01/22 00:08:09 Done.
2598 if (!cb->hasOverrideLogicalContentHeight() || (!document().inQuirksM ode() && !isTable() && cbstyle.logicalHeight().isAuto())) {
2595 // Normally we would let the cell size intrinsically, but scroll ing overflow has to be 2599 // Normally we would let the cell size intrinsically, but scroll ing overflow has to be
2596 // treated differently, since WinIE lets scrolled overflow regio ns shrink as needed. 2600 // treated differently, since WinIE lets scrolled overflow regio ns shrink as needed.
2597 // While we can't get all cases right, we can at least detect wh en the cell has a specified 2601 // While we can't get all cases right, we can at least detect wh en the cell has a specified
2598 // height or when the table has a specified height. In these cas es we want to initially have 2602 // height or when the table has a specified height. In these cas es we want to initially have
2599 // no size and allow the flexing of the table or the cell to its specified height to cause us 2603 // no size and allow the flexing of the table or the cell to its specified height to cause us
2600 // to grow to fill the space. This could end up being wrong in s ome cases, but it is 2604 // to grow to fill the space. This could end up being wrong in s ome cases, but it is
2601 // preferable to the alternative (sizing intrinsically and makin g the row end up too big). 2605 // preferable to the alternative (sizing intrinsically and makin g the row end up too big).
2602 LayoutTableCell* cell = toLayoutTableCell(cb); 2606 LayoutTableCell* cell = toLayoutTableCell(cb);
2603 if (scrollsOverflowY() && (!cell->style()->logicalHeight().isAut o() || !cell->table()->style()->logicalHeight().isAuto())) 2607 if (scrollsOverflowY() && (!cell->style()->logicalHeight().isAut o() || !cell->table()->style()->logicalHeight().isAuto()))
2604 return LayoutUnit(); 2608 return LayoutUnit();
(...skipping 2289 matching lines...) Expand 10 before | Expand all | Expand 10 after
4894 } 4898 }
4895 4899
4896 void LayoutBox::clearPreviousPaintInvalidationRects() 4900 void LayoutBox::clearPreviousPaintInvalidationRects()
4897 { 4901 {
4898 LayoutBoxModelObject::clearPreviousPaintInvalidationRects(); 4902 LayoutBoxModelObject::clearPreviousPaintInvalidationRects();
4899 if (PaintLayerScrollableArea* scrollableArea = this->scrollableArea()) 4903 if (PaintLayerScrollableArea* scrollableArea = this->scrollableArea())
4900 scrollableArea->clearPreviousPaintInvalidationRects(); 4904 scrollableArea->clearPreviousPaintInvalidationRects();
4901 } 4905 }
4902 4906
4903 } // namespace blink 4907 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698