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

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

Issue 1181483005: Avoid stretching the parent of a column spanner. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update unit tests that used to test the container stretching mechanism Created 5 years, 6 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/LayoutPagedFlowThread.h ('k') | Source/core/layout/MultiColumnFragmentainerGroup.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutPagedFlowThread.cpp
diff --git a/Source/core/layout/LayoutPagedFlowThread.cpp b/Source/core/layout/LayoutPagedFlowThread.cpp
index f43233e9143cdf268ce84e2809cb31cb5c9415d1..43105d001bc2e2daa969ca01a0d9fa6d4922b733 100644
--- a/Source/core/layout/LayoutPagedFlowThread.cpp
+++ b/Source/core/layout/LayoutPagedFlowThread.cpp
@@ -5,6 +5,8 @@
#include "config.h"
#include "core/layout/LayoutPagedFlowThread.h"
+#include "core/layout/LayoutMultiColumnSet.h"
+
namespace blink {
LayoutPagedFlowThread* LayoutPagedFlowThread::createAnonymous(Document& document, const ComputedStyle& parentStyle)
@@ -15,6 +17,13 @@ LayoutPagedFlowThread* LayoutPagedFlowThread::createAnonymous(Document& document
return LayoutObject;
}
+int LayoutPagedFlowThread::pageCount()
+{
+ if (LayoutMultiColumnSet* columnSet = firstMultiColumnSet())
+ return columnSet->actualColumnCount();
+ return 1;
+}
+
bool LayoutPagedFlowThread::needsNewWidth() const
{
return progressionIsInline() != pagedBlockFlow()->style()->hasInlinePaginationAxis();
@@ -30,8 +39,21 @@ void LayoutPagedFlowThread::updateLogicalWidth()
void LayoutPagedFlowThread::layout()
{
+ ASSERT(firstMultiColumnBox() == lastMultiColumnBox()); // There should either be zero or one of those for paged layout.
setProgressionIsInline(pagedBlockFlow()->style()->hasInlinePaginationAxis());
LayoutMultiColumnFlowThread::layout();
+
+ LayoutMultiColumnSet* columnSet = firstMultiColumnSet();
+ if (!columnSet)
+ return;
+ LayoutUnit pageLogicalHeight = columnSet->pageLogicalHeight();
+ if (!pageLogicalHeight)
+ return; // Page height not calculated yet. Happens in the first layout pass when height is auto.
+ // Ensure uniform page height. We don't want the last page to be shorter than the others,
+ // or it'll be impossible to scroll that whole page into view.
+ LayoutUnit paddedLogicalBottomInFlowThread = pageLogicalHeight * pageCount();
+ ASSERT(paddedLogicalBottomInFlowThread >= columnSet->logicalBottomInFlowThread());
+ columnSet->endFlow(paddedLogicalBottomInFlowThread);
}
} // namespace blink
« no previous file with comments | « Source/core/layout/LayoutPagedFlowThread.h ('k') | Source/core/layout/MultiColumnFragmentainerGroup.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698