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

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

Issue 157553002: Remove the Pagination struct, clean up viewport scroll policy propagation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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: Source/core/rendering/RenderBlock.cpp
diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp
index 214547c748476c0822eee7db37752ae2794aaab8..63581e45ad2ae30dfdf22b03cb335f4f89611776 100644
--- a/Source/core/rendering/RenderBlock.cpp
+++ b/Source/core/rendering/RenderBlock.cpp
@@ -3391,9 +3391,9 @@ void RenderBlock::calcColumnWidth()
bool RenderBlock::requiresColumns(int desiredColumnCount) const
{
- // If overflow-y is set to paged-x or paged-y on the body or html element, we'll handle the paginating
- // in the RenderView instead.
- bool isPaginated = (style()->overflowY() == OPAGEDX || style()->overflowY() == OPAGEDY) && !(isRoot() || isBody());
+ // Paged overflow is treated as multicol here, unless this element was the one that got its
+ // overflow propagated to the viewport.
+ bool isPaginated = style()->isOverflowPaged() && node() != document().viewportDefiningElement();
return firstChild()
&& (desiredColumnCount != 1 || !style()->hasAutoColumnWidth() || !style()->hasInlineColumnAxis() || isPaginated)
@@ -3420,10 +3420,14 @@ void RenderBlock::setDesiredColumnCountAndWidth(int count, LayoutUnit width)
gColumnInfoMap->add(this, adoptPtr(info));
setHasColumns(true);
}
- info->setDesiredColumnCount(count);
info->setDesiredColumnWidth(width);
- info->setProgressionAxis(style()->hasInlineColumnAxis() ? ColumnInfo::InlineAxis : ColumnInfo::BlockAxis);
- info->setProgressionIsReversed(style()->columnProgression() == ReverseColumnProgression);
+ if (style()->isOverflowPaged()) {
+ info->setProgressionAxis((style()->overflowY() == OPAGEDX) == style()->isHorizontalWritingMode() ? ColumnInfo::InlineAxis : ColumnInfo::BlockAxis);
rune 2014/02/07 16:44:27 I find this hard to read. Would it be better with
mstensho (USE GERRIT) 2014/02/11 10:44:14 Done.
+ } else {
+ info->setDesiredColumnCount(count);
+ info->setProgressionAxis(style()->hasInlineColumnAxis() ? ColumnInfo::InlineAxis : ColumnInfo::BlockAxis);
+ info->setProgressionIsReversed(style()->columnProgression() == ReverseColumnProgression);
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698