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

Unified Diff: Source/core/rendering/RenderBox.cpp

Issue 906323003: [CSS Grid Layout] Columns set in percentages collapse to auto width (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@sergio-indefinite
Patch Set: 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/rendering/RenderBox.h ('k') | Source/core/rendering/RenderGrid.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBox.cpp
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index 0eda85b297b14ee6bd05d903a5584d838902cc55..f52a95e8afdc1a07b4dd846c5f7f267f6895b285 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -4194,6 +4194,40 @@ void RenderBox::clearLayoutOverflow()
m_overflow->setLayoutOverflow(noOverflowRect());
}
+bool RenderBox::logicalWidthIsResolvableFromBlock(const RenderBlock* containingBlock)
+{
+ const RenderBlock* cb = containingBlock;
+ while (!cb->isRenderView() && !cb->isOutOfFlowPositioned() && (cb->style()->logicalWidth().isAuto() || cb->isAnonymousBlock()))
+ cb = cb->containingBlock();
+ // Doesn't anonymousBlocks have all of them cb->style()->logicalWidth().isAuto()
+
+ if (cb->style()->logicalWidth().isFixed())
+ return true;
+ if (cb->isRenderView())
+ return true;
+ if (cb->isOutOfFlowPositioned())
+ return true;
+ if (cb->style()->logicalWidth().isPercent())
+ return logicalWidthIsResolvableFromBlock(cb->containingBlock());
+
+ return false;
+}
+
+bool RenderBox::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 RenderBox::logicalWidthIsResolvableFromBlock(containingBlock());
+}
+
inline static bool percentageLogicalHeightIsResolvable(const RenderBox* box)
{
return RenderBox::percentageLogicalHeightIsResolvableFromBlock(box->containingBlock(), box->isOutOfFlowPositioned());
@@ -4243,6 +4277,21 @@ bool RenderBox::percentageLogicalHeightIsResolvableFromBlock(const RenderBlock*
return false;
}
+bool RenderBox::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())
+ return true;
+
+ return percentageLogicalHeightIsResolvable(this);
+}
+
bool RenderBox::hasUnsplittableScrollingOverflow() const
{
// We will paginate as long as we don't scroll overflow in the pagination direction.
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderGrid.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698