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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp

Issue 2288563002: Treat implicit height on positioned objects as non-auto (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bug 61049 Created 4 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
Index: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
index 691734c6f921a96e44ac6dc707bae503e4cce547..ed78616803b87a59df5d35e81a762f3145104742 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
@@ -492,6 +492,11 @@ void LayoutBoxModelObject::updateFromStyle()
setHorizontalWritingMode(styleToUse.isHorizontalWritingMode());
}
+static bool isOutOfFlowPositionedWithImplicitHeight(LayoutBlock* child)
mstensho (USE GERRIT) 2016/08/29 16:02:26 static inline and const LayoutBlock?
+{
+ return child->isOutOfFlowPositioned() && !child->style()->logicalTop().isAuto() && !child->style()->logicalBottom().isAuto();
+}
+
LayoutBlock* LayoutBoxModelObject::containingBlockForAutoHeightDetection(Length logicalHeight) const
{
// For percentage heights: The percentage is calculated with respect to the height of the generated box's
@@ -519,7 +524,7 @@ LayoutBlock* LayoutBoxModelObject::containingBlockForAutoHeightDetection(Length
if (cb->isLayoutView())
return nullptr;
- if (cb->isOutOfFlowPositioned() && !cb->style()->logicalTop().isAuto() && !cb->style()->logicalBottom().isAuto())
+ if (isOutOfFlowPositionedWithImplicitHeight(cb))
return nullptr;
return cb;
@@ -543,7 +548,7 @@ bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight(bool che
if (!checkingContainingBlock && thisBox->hasOverrideContainingBlockLogicalHeight())
return false;
}
- if (logicalHeightLength.isAuto())
+ if (logicalHeightLength.isAuto() && !isOutOfFlowPositionedWithImplicitHeight(this))
return true;
if (document().inQuirksMode())

Powered by Google App Engine
This is Rietveld 408576698