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

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

Issue 914993003: [CSS Grid Layout] Determine definite/indefinite size properly in nested grids (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rename isRenderView() calls to isLayoutView() Created 5 years, 10 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 25e6e319f7c3166d3cbbd772ce281967188a43bd..6c96e11737005747c74fae729231500dbf8e7f9b 100644
--- a/Source/core/layout/LayoutBox.cpp
+++ b/Source/core/layout/LayoutBox.cpp
@@ -4195,37 +4195,33 @@ void LayoutBox::clearLayoutOverflow()
m_overflow->setLayoutOverflow(noOverflowRect());
}
-bool LayoutBox::logicalWidthIsResolvableFromBlock(const LayoutBlock* containingBlock)
+static bool logicalWidthIsResolvable(const LayoutBox& layoutBox)
{
- const LayoutBlock* cb = containingBlock;
- while (!cb->isLayoutView() && !cb->isOutOfFlowPositioned() && (cb->style()->logicalWidth().isAuto() || cb->isAnonymousBlock()))
- cb = cb->containingBlock();
+ const LayoutBox* box = &layoutBox;
+ while (!box->isLayoutView() && !box->isOutOfFlowPositioned()
+ && (box->style()->logicalWidth().isAuto() || box->isAnonymousBlock())
+ && !box->hasOverrideContainingBlockLogicalWidth())
+ box = box->containingBlock();
- if (cb->style()->logicalWidth().isFixed())
+ if (box->style()->logicalWidth().isFixed())
return true;
- if (cb->isLayoutView())
+ if (box->isLayoutView())
return true;
- if (cb->isOutOfFlowPositioned())
+ // 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())
return true;
- if (cb->style()->logicalWidth().isPercent())
- return logicalWidthIsResolvableFromBlock(cb->containingBlock());
+ if (box->hasOverrideContainingBlockLogicalWidth())
+ return box->overrideContainingBlockContentLogicalWidth() != -1;
+ if (box->style()->logicalWidth().isPercent())
+ return logicalWidthIsResolvable(*box->containingBlock());
return false;
}
bool LayoutBox::hasDefiniteLogicalWidth() const
{
- const Length& logicalWidth = style()->logicalWidth();
- if (logicalWidth.isIntrinsic() || logicalWidth.isLegacyIntrinsic())
- return false;
- if (logicalWidth.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;
-
- return LayoutBox::logicalWidthIsResolvableFromBlock(containingBlock());
+ return logicalWidthIsResolvable(*this);
}
inline static bool percentageLogicalHeightIsResolvable(const LayoutBox* box)
@@ -4245,6 +4241,9 @@ bool LayoutBox::percentageLogicalHeightIsResolvableFromBlock(const LayoutBlock*
while (!cb->isLayoutView() && !cb->isBody() && !cb->isTableCell() && !cb->isOutOfFlowPositioned() && cb->style()->logicalHeight().isAuto()) {
if (!inQuirksMode && !cb->isAnonymousBlock())
break;
+ if (cb->hasOverrideContainingBlockLogicalHeight())
+ return cb->overrideContainingBlockContentLogicalHeight() != -1;
+
cb = cb->containingBlock();
}
@@ -4288,6 +4287,8 @@ bool LayoutBox::hasDefiniteLogicalHeight() const
// element (http://dev.w3.org/csswg/css-sizing-3/#definite).
if (isOutOfFlowPositioned())
return true;
+ if (hasOverrideContainingBlockLogicalHeight())
+ return overrideContainingBlockContentLogicalHeight() != -1;
return percentageLogicalHeightIsResolvable(this);
}
« 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