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

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

Issue 2086083002: Fix percentage handling for replaced elements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: with test Created 4 years, 6 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/LayoutBox.cpp ('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 a9bafeec3a831b64657df4197067748cb266d3b3..b79d4d6bbb6958acc35faf9942a375174d0ed3c5 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
@@ -558,12 +558,15 @@ LayoutBlock* LayoutBoxModelObject::containingBlockForAutoHeightDetection(Length
bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight() const
{
const LayoutBox* thisBox = isBox() ? toLayoutBox(this) : nullptr;
+ Length logicalHeightLength = style()->logicalHeight();
+ LayoutBlock* cb = containingBlockForAutoHeightDetection(logicalHeightLength);
+ if (logicalHeightLength.hasPercent() && cb && isBox())
+ cb->addPercentHeightDescendant(const_cast<LayoutBox*>(toLayoutBox(this)));
if (thisBox && thisBox->isFlexItem()) {
LayoutFlexibleBox& flexBox = toLayoutFlexibleBox(*parent());
if (flexBox.childLogicalHeightForPercentageResolution(*thisBox) != LayoutUnit(-1))
return false;
}
- Length logicalHeightLength = style()->logicalHeight();
if (logicalHeightLength.isAuto())
return true;
@@ -571,7 +574,7 @@ bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight() const
return false;
// If the height of the containing block computes to 'auto', then it hasn't been 'specified explicitly'.
- if (LayoutBlock* cb = containingBlockForAutoHeightDetection(logicalHeightLength))
+ if (cb)
return cb->hasAutoHeightOrContainingBlockWithAutoHeight();
return false;
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698