OLD | NEW |
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 2588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2599 bool isOutOfFlowPositionedWithSpecifiedHeight = cb->isOutOfFlowPositioned()
&& (!cbstyle.logicalHeight().isAuto() || (!cbstyle.logicalTop().isAuto() && !cbs
tyle.logicalBottom().isAuto())); | 2599 bool isOutOfFlowPositionedWithSpecifiedHeight = cb->isOutOfFlowPositioned()
&& (!cbstyle.logicalHeight().isAuto() || (!cbstyle.logicalTop().isAuto() && !cbs
tyle.logicalBottom().isAuto())); |
2600 | 2600 |
2601 bool includeBorderPadding = isTable(); | 2601 bool includeBorderPadding = isTable(); |
2602 | 2602 |
2603 if (isHorizontalWritingMode() != cb->isHorizontalWritingMode()) { | 2603 if (isHorizontalWritingMode() != cb->isHorizontalWritingMode()) { |
2604 availableHeight = containingBlockChild->containingBlockLogicalWidthForCo
ntent(); | 2604 availableHeight = containingBlockChild->containingBlockLogicalWidthForCo
ntent(); |
2605 } else if (hasOverrideContainingBlockLogicalHeight()) { | 2605 } else if (hasOverrideContainingBlockLogicalHeight()) { |
2606 availableHeight = overrideContainingBlockContentLogicalHeight(); | 2606 availableHeight = overrideContainingBlockContentLogicalHeight(); |
2607 } else if (cb->isTableCell()) { | 2607 } else if (cb->isTableCell()) { |
2608 if (!skippedAutoHeightContainingBlock) { | 2608 if (!skippedAutoHeightContainingBlock) { |
2609 // The second clause in this conditional (after the ||) is to suppor
t this line from the | 2609 // Table cells violate what the CSS spec says to do with heights. Ba
sically we |
2610 // definition of height in CSS 2.2: | 2610 // don't care if the cell specified a height or not. We just always
make ourselves |
2611 // "If the height of the containing block is not specified explicitl
y (i.e., it depends on | 2611 // be a percentage of the cell's current content height. |
2612 // content height), and this element is not absolutely positioned, t
he used height is | 2612 if (!cb->hasOverrideLogicalContentHeight()) { |
2613 // calculated as if 'auto' was specified." | |
2614 // But FF doesn't apply this logic (1) in quirks mode or (2) when "t
his element" is a table. | |
2615 // TODO(dgrogan): Maybe we shouldn't make tables an exception. See h
ttps://crbug.com/353580 | |
2616 if (!cb->hasOverrideLogicalContentHeight() || (!document().inQuirksM
ode() && !isTable() && cbstyle.logicalHeight().isAuto())) { | |
2617 // Normally we would let the cell size intrinsically, but scroll
ing overflow has to be | 2613 // Normally we would let the cell size intrinsically, but scroll
ing overflow has to be |
2618 // treated differently, since WinIE lets scrolled overflow regio
ns shrink as needed. | 2614 // treated differently, since WinIE lets scrolled overflow regio
ns shrink as needed. |
2619 // While we can't get all cases right, we can at least detect wh
en the cell has a specified | 2615 // While we can't get all cases right, we can at least detect wh
en the cell has a specified |
2620 // height or when the table has a specified height. In these cas
es we want to initially have | 2616 // height or when the table has a specified height. In these cas
es we want to initially have |
2621 // no size and allow the flexing of the table or the cell to its
specified height to cause us | 2617 // no size and allow the flexing of the table or the cell to its
specified height to cause us |
2622 // to grow to fill the space. This could end up being wrong in s
ome cases, but it is | 2618 // to grow to fill the space. This could end up being wrong in s
ome cases, but it is |
2623 // preferable to the alternative (sizing intrinsically and makin
g the row end up too big). | 2619 // preferable to the alternative (sizing intrinsically and makin
g the row end up too big). |
2624 LayoutTableCell* cell = toLayoutTableCell(cb); | 2620 LayoutTableCell* cell = toLayoutTableCell(cb); |
2625 if (scrollsOverflowY() && (!cell->style()->logicalHeight().isAut
o() || !cell->table()->style()->logicalHeight().isAuto())) | 2621 if (scrollsOverflowY() && (!cell->style()->logicalHeight().isAut
o() || !cell->table()->style()->logicalHeight().isAuto())) |
2626 return LayoutUnit(); | 2622 return LayoutUnit(); |
(...skipping 2055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4682 } | 4678 } |
4683 | 4679 |
4684 void LayoutBox::IntrinsicSizingInfo::transpose() | 4680 void LayoutBox::IntrinsicSizingInfo::transpose() |
4685 { | 4681 { |
4686 size = size.transposedSize(); | 4682 size = size.transposedSize(); |
4687 aspectRatio = aspectRatio.transposedSize(); | 4683 aspectRatio = aspectRatio.transposedSize(); |
4688 std::swap(hasWidth, hasHeight); | 4684 std::swap(hasWidth, hasHeight); |
4689 } | 4685 } |
4690 | 4686 |
4691 } // namespace blink | 4687 } // namespace blink |
OLD | NEW |