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

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

Issue 1420713003: Deduct pagination struts when calculating initial column height. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review Created 5 years, 1 month 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/MultiColumnFragmentainerGroup.h ('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/MultiColumnFragmentainerGroup.cpp
diff --git a/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp b/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp
index b695356cea3bc2c030ff1c876937aa416bb3aa41..0acf7d3ede3ef5fe2cf1822681b842a37fb58598 100644
--- a/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp
+++ b/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp
@@ -55,14 +55,15 @@ void MultiColumnFragmentainerGroup::resetColumnHeight()
m_maxColumnHeight = calculateMaxColumnHeight();
LayoutMultiColumnFlowThread* flowThread = m_columnSet.multiColumnFlowThread();
- LayoutMultiColumnFlowThread* enclosingFlowThread = flowThread->enclosingFlowThread();
- if (enclosingFlowThread && enclosingFlowThread->isPageLogicalHeightKnown()) {
- // TODO(mstensho): Do this better. If height is auto here, we shouldn't set a
- // height, or forced breaks and pagination struts might mess up column balancing.
- LayoutUnit columnHeight = heightIsAuto() ? m_maxColumnHeight : heightAdjustedForRowOffset(flowThread->columnHeightAvailable());
- setAndConstrainColumnHeight(columnHeight);
- } else if (heightIsAuto()) {
- m_columnHeight = LayoutUnit();
+ if (heightIsAuto()) {
+ LayoutMultiColumnFlowThread* enclosingFlowThread = flowThread->enclosingFlowThread();
+ if (enclosingFlowThread && enclosingFlowThread->isPageLogicalHeightKnown()) {
+ // Even if height is auto, we set an initial height, in order to tell how much content
+ // this MultiColumnFragmentainerGroup can hold, and when we need to append a new one.
+ m_columnHeight = m_maxColumnHeight;
+ } else {
+ m_columnHeight = LayoutUnit();
+ }
} else {
setAndConstrainColumnHeight(heightAdjustedForRowOffset(flowThread->columnHeightAvailable()));
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698