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

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

Issue 1287113002: Clean up PageBoundaryRule enum. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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/LayoutBlock.h ('k') | Source/core/layout/LayoutBlockFlow.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutBlock.cpp
diff --git a/Source/core/layout/LayoutBlock.cpp b/Source/core/layout/LayoutBlock.cpp
index 652b3174e6ab36212c53cce33965e20b9622c058..0ea8cd60317f27c8c4da3d80ebd6e0f719c9c636 100644
--- a/Source/core/layout/LayoutBlock.cpp
+++ b/Source/core/layout/LayoutBlock.cpp
@@ -2628,11 +2628,7 @@ LayoutUnit LayoutBlock::nextPageLogicalTop(LayoutUnit logicalOffset, PageBoundar
if (!pageLogicalHeight)
return logicalOffset;
- // The logicalOffset is in our coordinate space. We can add in our pushed offset.
- LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset);
- if (pageBoundaryRule == ExcludePageBoundary)
- return logicalOffset + (remainingLogicalHeight ? remainingLogicalHeight : pageLogicalHeight);
- return logicalOffset + remainingLogicalHeight;
+ return logicalOffset + pageRemainingLogicalHeightForOffset(logicalOffset, pageBoundaryRule);
}
LayoutUnit LayoutBlock::pageLogicalHeightForOffset(LayoutUnit offset) const
@@ -2653,9 +2649,10 @@ LayoutUnit LayoutBlock::pageRemainingLogicalHeightForOffset(LayoutUnit offset, P
if (!flowThread) {
LayoutUnit pageLogicalHeight = layoutView->layoutState()->pageLogicalHeight();
LayoutUnit remainingHeight = pageLogicalHeight - intMod(offset, pageLogicalHeight);
- if (pageBoundaryRule == IncludePageBoundary) {
- // If includeBoundaryPoint is true the line exactly on the top edge of a
- // column will act as being part of the previous column.
+ if (pageBoundaryRule == AssociateWithFormerPage) {
+ // An offset exactly at a page boundary will act as being part of the former page in
+ // question (i.e. no remaining space), rather than being part of the latter (i.e. one
+ // whole page length of remaining space).
remainingHeight = intMod(remainingHeight, pageLogicalHeight);
}
return remainingHeight;
« no previous file with comments | « Source/core/layout/LayoutBlock.h ('k') | Source/core/layout/LayoutBlockFlow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698