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

Unified Diff: Source/core/layout/LayoutBox.cpp

Issue 1081433005: LayoutBox::hasDefiniteLogicalHeight() should not consider abspos boxes as definite (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove flexbox change Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/layout/LayoutBox.h ('k') | Source/core/layout/LayoutGrid.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/core/layout/LayoutBox.h ('k') | Source/core/layout/LayoutGrid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698