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

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

Issue 1383003002: [css-grid] Fix definite/indefinite size detection for abspos elements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/LayoutTests/fast/css-grid-layout/positioned-grid-container-percentage-tracks-expected.txt ('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/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 4e6ea451ddf87c2f79d158ea61560174f8cdd6c7..10637ce50139a5fe48c513e9fd6291e61ef33c71 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -2399,6 +2399,12 @@ LayoutUnit LayoutBox::computeIntrinsicLogicalContentHeightUsing(const Length& lo
LayoutUnit LayoutBox::computeContentAndScrollbarLogicalHeightUsing(SizeType heightType, const Length& height, LayoutUnit intrinsicContentHeight) const
{
+ if (isOutOfFlowPositioned() && height.isAuto() && !style()->logicalTop().isAuto() && !style()->logicalBottom().isAuto()) {
+ LogicalExtentComputedValues computedValues;
+ computeLogicalHeight(logicalHeight(), 0, computedValues);
mstensho (USE GERRIT) 2015/10/02 09:08:50 I don't think this is the right place to do this.
cbiesinger 2015/10/02 16:40:19 Yes, this is handled in computePositionedLogicalHe
Manuel Rego 2016/04/08 07:53:14 It seems this is not needed anymore, so I'm removi
+ return computedValues.m_extent - borderAndPaddingLogicalHeight() - scrollbarLogicalHeight();
+ }
+
if (height.isAuto())
return heightType == MinSize ? 0 : -1;
// FIXME(cbiesinger): The css-sizing spec is considering changing what min-content/max-content should resolve to.
@@ -4263,9 +4269,7 @@ static bool logicalWidthIsResolvable(const LayoutBox& layoutBox)
return true;
if (box->isLayoutView())
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 (box->isOutOfFlowPositioned())
+ if (box->isOutOfFlowPositioned() && box->style()->logicalWidth().isAuto() && !box->style()->logicalLeft().isAuto() && !box->style()->logicalRight().isAuto())
mstensho (USE GERRIT) 2015/10/02 09:08:50 The box->style()->logicalWidth().isAuto() confuses
cbiesinger 2015/10/02 16:40:19 I too am skeptical that this is correct... do you
Manuel Rego 2016/04/08 07:53:14 Yeah, we don't need to check if width is auto too,
return true;
if (box->hasOverrideContainingBlockLogicalWidth())
return box->overrideContainingBlockContentLogicalWidth() != -1;
@@ -4289,16 +4293,14 @@ bool LayoutBox::percentageLogicalHeightIsResolvable() const
bool LayoutBox::hasDefiniteLogicalHeight() const
{
const Length& logicalHeight = style()->logicalHeight();
- if (logicalHeight.isIntrinsicOrAuto())
- return false;
if (logicalHeight.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())
+ if (isOutOfFlowPositioned() && logicalHeight.isAuto() && !style()->logicalTop().isAuto() && !style()->logicalBottom().isAuto())
mstensho (USE GERRIT) 2015/10/02 09:08:50 Same question as in logicalWidthIsResolvable().
cbiesinger 2015/10/02 16:40:19 As I wrote in the other patch: I don't believe tha
Manuel Rego 2016/04/08 07:53:14 Again I've removed here the condition to check if
return true;
if (hasOverrideContainingBlockLogicalHeight())
return overrideContainingBlockContentLogicalHeight() != -1;
+ if (logicalHeight.isIntrinsicOrAuto())
+ return false;
return percentageLogicalHeightIsResolvable();
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/positioned-grid-container-percentage-tracks-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698