Chromium Code Reviews| Index: Source/core/layout/LayoutBox.cpp |
| diff --git a/Source/core/layout/LayoutBox.cpp b/Source/core/layout/LayoutBox.cpp |
| index 4876f2a0d35bb0bc3c57de942bc04df1ea750379..1738d871a169a089d3a3519ef4428aeb2c839ea4 100644 |
| --- a/Source/core/layout/LayoutBox.cpp |
| +++ b/Source/core/layout/LayoutBox.cpp |
| @@ -4265,27 +4265,21 @@ bool LayoutBox::hasDefiniteLogicalWidth() const |
| return logicalWidthIsResolvable(*this); |
| } |
| -bool LayoutBox::percentageLogicalHeightIsResolvable() const |
| +bool LayoutBox::logicalHeightIsDefinite(const Length& length) const |
| { |
| - Length fakeLength(100, Percent); |
| - return computePercentageLogicalHeight(fakeLength) != -1; |
| -} |
| - |
| -bool LayoutBox::hasDefiniteLogicalHeight() const |
| -{ |
| - const Length& logicalHeight = style()->logicalHeight(); |
| - if (logicalHeight.isIntrinsicOrAuto()) |
| + if (length.isIntrinsicOrAuto()) |
|
Manuel Rego
2015/09/23 10:22:02
I think this still has the original problem.
If t
cbiesinger
2015/10/02 16:16:43
I don't believe that's a correct interpretation of
|
| return false; |
| - if (logicalHeight.isFixed()) |
| + if (length.isFixed()) |
| return true; |
| - // The size of the containing block of an absolutely positioned element is always definite with respect to that |
| - // element (http://dev.w3.org/csswg/css-sizing-3/#definite). |
| - if (isOutOfFlowPositioned()) |
| - return true; |
| - if (hasOverrideContainingBlockLogicalHeight()) |
| - return overrideContainingBlockContentLogicalHeight() != -1; |
| + if (length.hasPercent()) { |
| + if (hasOverrideContainingBlockLogicalHeight()) |
| + return overrideContainingBlockContentLogicalHeight() != -1; |
| - return percentageLogicalHeightIsResolvable(); |
| + return computePercentageLogicalHeight(length) != -1; |
| + } |
| + if (length.isMaxSizeNone()) |
|
Manuel Rego
2015/09/23 10:22:02
I don't get what the max-height has to do in order
|
| + return true; |
| + return false; |
| } |
| bool LayoutBox::hasUnsplittableScrollingOverflow() const |
| @@ -4301,8 +4295,8 @@ bool LayoutBox::hasUnsplittableScrollingOverflow() const |
| // conditions, but it should work out to be good enough for common cases. Paginating overflow |
| // with scrollbars present is not the end of the world and is what we used to do in the old model anyway. |
| return !style()->logicalHeight().isIntrinsicOrAuto() |
| - || (!style()->logicalMaxHeight().isIntrinsicOrAuto() && !style()->logicalMaxHeight().isMaxSizeNone() && (!style()->logicalMaxHeight().hasPercent() || percentageLogicalHeightIsResolvable())) |
| - || (!style()->logicalMinHeight().isIntrinsicOrAuto() && style()->logicalMinHeight().isPositive() && (!style()->logicalMinHeight().hasPercent() || percentageLogicalHeightIsResolvable())); |
| + || (logicalHeightIsDefinite(style()->logicalMaxHeight()) && !style()->logicalMaxHeight().isMaxSizeNone()) |
| + || (logicalHeightIsDefinite(style()->logicalMinHeight()) && style()->logicalMinHeight().isPositive()); |
| } |
| bool LayoutBox::isUnsplittableForPagination() const |