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

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

Issue 2121173002: [css-grid] Fix percentage height resolution for replaced elements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make hasAutoHeightOrContainingBlockWithAutoHeight(bool) private Created 4 years, 5 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 | « third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b79d4d6bbb6958acc35faf9942a375174d0ed3c5..3b8daff1a8c1f64730cd7999110873ae89f034b1 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
@@ -555,7 +555,7 @@ LayoutBlock* LayoutBoxModelObject::containingBlockForAutoHeightDetection(Length
return cb;
}
-bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight() const
+bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight(bool checkingContainingBlock) const
{
const LayoutBox* thisBox = isBox() ? toLayoutBox(this) : nullptr;
Length logicalHeightLength = style()->logicalHeight();
@@ -567,6 +567,12 @@ bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight() const
if (flexBox.childLogicalHeightForPercentageResolution(*thisBox) != LayoutUnit(-1))
return false;
}
+ if (thisBox && thisBox->isGridItem()) {
+ if (checkingContainingBlock && thisBox->hasOverrideLogicalContentHeight())
+ return false;
+ if (!checkingContainingBlock && thisBox->hasOverrideContainingBlockLogicalHeight())
+ return false;
+ }
if (logicalHeightLength.isAuto())
return true;
@@ -575,10 +581,15 @@ bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight() const
// If the height of the containing block computes to 'auto', then it hasn't been 'specified explicitly'.
if (cb)
- return cb->hasAutoHeightOrContainingBlockWithAutoHeight();
+ return cb->hasAutoHeightOrContainingBlockWithAutoHeight(true);
return false;
}
+bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight() const
+{
+ return hasAutoHeightOrContainingBlockWithAutoHeight(false);
+}
+
LayoutSize LayoutBoxModelObject::relativePositionOffset() const
{
LayoutSize offset = accumulateInFlowPositionOffsets();
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698