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

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

Issue 1696713003: Introduce maxColumnLogicalHeight() and clean up a little. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp b/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp
index fbc996b507e046373021b1d64e4c87efff5f9faa..084792c090c72a9e9fe7fd5d333273ae0d28d8ae 100644
--- a/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp
@@ -275,6 +275,23 @@ void LayoutMultiColumnFlowThread::evacuateAndDestroy()
destroy();
}
+LayoutUnit LayoutMultiColumnFlowThread::maxColumnLogicalHeight() const
+{
+ if (m_columnHeightAvailable) {
+ // If height is non-auto, it's already constrained against max-height as well.
+ // Just return it.
+ return m_columnHeightAvailable;
+ }
+ const LayoutBlockFlow* multicolBlock = multiColumnBlockFlow();
+ Length logicalMaxHeight = multicolBlock->style()->logicalMaxHeight();
+ if (!logicalMaxHeight.isMaxSizeNone()) {
+ LayoutUnit resolvedLogicalMaxHeight = multicolBlock->computeContentLogicalHeight(MaxSize, logicalMaxHeight, -1);
+ if (resolvedLogicalMaxHeight != -1)
+ return resolvedLogicalMaxHeight;
+ }
+ return LayoutUnit::max();
+}
+
LayoutUnit LayoutMultiColumnFlowThread::tallestUnbreakableLogicalHeight(LayoutUnit offsetInFlowThread) const
{
if (LayoutMultiColumnSet* multicolSet = columnSetAtBlockOffset(offsetInFlowThread))

Powered by Google App Engine
This is Rietveld 408576698