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

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

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 | « no previous file | Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutBlock.h
diff --git a/Source/core/layout/LayoutBlock.h b/Source/core/layout/LayoutBlock.h
index 45e579472ccc3d53467a8bdc3d47fd36ac7686e6..f719e3f5ec8f8c0e1e063f278fbbd95c0605aef6 100644
--- a/Source/core/layout/LayoutBlock.h
+++ b/Source/core/layout/LayoutBlock.h
@@ -368,24 +368,30 @@ private:
void removeFromGlobalMaps();
bool widthAvailableToChildrenHasChanged();
+public:
+ // Specify which page or column to associate with an offset, if said offset is exactly at a page
+ // or column boundary.
+ enum PageBoundaryRule { AssociateWithFormerPage, AssociateWithLatterPage };
+
+ LayoutUnit pageLogicalHeightForOffset(LayoutUnit) const;
+ LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit, PageBoundaryRule) const;
+
protected:
bool isPageLogicalHeightKnown(LayoutUnit logicalOffset) const { return pageLogicalHeightForOffset(logicalOffset); }
- // Returns the logicalOffset at the top of the next page. If the offset passed in is already at the top of the current page,
- // then nextPageLogicalTop with ExcludePageBoundary will still move to the top of the next page. nextPageLogicalTop with
- // IncludePageBoundary set will not.
+ // Returns the logical offset at the top of the next page, for a given offset.
+ //
+ // If the given offset is at a page boundary, using AssociateWithLatterPage as PageBoundaryRule
+ // will move us one page ahead (since the offset is at the top of the "current" page). Using
+ // AssociateWithFormerPage instead will keep us where we are (since the offset is at the bottom
+ // of the "current" page, which is exactly the same offset as the top offset on the next page).
//
- // For a page height of 800px, the first rule will return 800 if the value passed in is 0. The second rule will simply return 0.
- enum PageBoundaryRule { ExcludePageBoundary, IncludePageBoundary };
- LayoutUnit nextPageLogicalTop(LayoutUnit logicalOffset, PageBoundaryRule = ExcludePageBoundary) const;
+ // For a page height of 800px, AssociateWithLatterPage will return 1600 if the value passed in
+ // is 800. AssociateWithFormerPage will simply return 800.
+ LayoutUnit nextPageLogicalTop(LayoutUnit logicalOffset, PageBoundaryRule) const;
bool createsNewFormattingContext() const;
-public:
- LayoutUnit pageLogicalHeightForOffset(LayoutUnit offset) const;
- LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit offset, PageBoundaryRule = IncludePageBoundary) const;
-
-protected:
// A page break is required at some offset due to space shortage in the current fragmentainer.
void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage);
« no previous file with comments | « no previous file | Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698