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

Unified Diff: Source/core/layout/MultiColumnFragmentainerGroup.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.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/MultiColumnFragmentainerGroup.cpp
diff --git a/Source/core/layout/MultiColumnFragmentainerGroup.cpp b/Source/core/layout/MultiColumnFragmentainerGroup.cpp
index 317ec3d63298d46cbe011bf15fb0abd0427b02e1..7e1db806b18d6d84d8401be50ed7ac76ff953e37 100644
--- a/Source/core/layout/MultiColumnFragmentainerGroup.cpp
+++ b/Source/core/layout/MultiColumnFragmentainerGroup.cpp
@@ -462,6 +462,13 @@ LayoutRect MultiColumnFragmentainerGroup::columnRectAt(unsigned columnIndex) con
LayoutUnit columnLogicalTop;
LayoutUnit columnLogicalLeft;
LayoutUnit columnGap = m_columnSet.columnGap();
+ LayoutUnit portionOutsideFlowThread = logicalTopInFlowThread() + (columnIndex + 1) * columnLogicalHeight - logicalBottomInFlowThread();
+ if (portionOutsideFlowThread > 0) {
+ // The last column may not be using all available space.
+ ASSERT(columnIndex + 1 == actualColumnCount());
+ columnLogicalHeight -= portionOutsideFlowThread;
+ ASSERT(columnLogicalHeight >= 0);
+ }
if (m_columnSet.multiColumnFlowThread()->progressionIsInline()) {
if (m_columnSet.style()->isLeftToRightDirection())
@@ -469,7 +476,7 @@ LayoutRect MultiColumnFragmentainerGroup::columnRectAt(unsigned columnIndex) con
else
columnLogicalLeft += m_columnSet.contentLogicalWidth() - columnLogicalWidth - columnIndex * (columnLogicalWidth + columnGap);
} else {
- columnLogicalTop += columnIndex * (columnLogicalHeight + columnGap);
+ columnLogicalTop += columnIndex * (m_columnHeight + columnGap);
}
LayoutRect columnRect(columnLogicalLeft, columnLogicalTop, columnLogicalWidth, columnLogicalHeight);
@@ -481,9 +488,17 @@ LayoutRect MultiColumnFragmentainerGroup::columnRectAt(unsigned columnIndex) con
LayoutRect MultiColumnFragmentainerGroup::flowThreadPortionRectAt(unsigned columnIndex) const
{
LayoutUnit logicalTop = logicalTopInFlowThreadAt(columnIndex);
+ LayoutUnit logicalBottom = logicalTop + m_columnHeight;
+ if (logicalBottom > logicalBottomInFlowThread()) {
+ // The last column may not be using all available space.
+ ASSERT(columnIndex + 1 == actualColumnCount());
+ logicalBottom = logicalBottomInFlowThread();
+ ASSERT(logicalBottom >= logicalTop);
+ }
+ LayoutUnit portionLogicalHeight = logicalBottom - logicalTop;
if (m_columnSet.isHorizontalWritingMode())
- return LayoutRect(LayoutUnit(), logicalTop, m_columnSet.pageLogicalWidth(), m_columnHeight);
- return LayoutRect(logicalTop, LayoutUnit(), m_columnHeight, m_columnSet.pageLogicalWidth());
+ return LayoutRect(LayoutUnit(), logicalTop, m_columnSet.pageLogicalWidth(), portionLogicalHeight);
+ return LayoutRect(logicalTop, LayoutUnit(), portionLogicalHeight, m_columnSet.pageLogicalWidth());
}
LayoutRect MultiColumnFragmentainerGroup::flowThreadPortionOverflowRect(const LayoutRect& portionRect, unsigned columnIndex, unsigned columnCount, LayoutUnit columnGap) const
« no previous file with comments | « Source/core/layout/LayoutPagedFlowThread.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698