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

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

Issue 1282353002: Prepare height calculation methods in LayoutFlowThread for nested multicol. (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/LayoutMultiColumnSet.h ('k') | Source/core/layout/LayoutPagedFlowThread.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutMultiColumnSet.cpp
diff --git a/Source/core/layout/LayoutMultiColumnSet.cpp b/Source/core/layout/LayoutMultiColumnSet.cpp
index e381257b43555ccde162d1cf4570ea6617d12ccd..fccdd52b5fb53aeb725f7e7dc31351588da808d3 100644
--- a/Source/core/layout/LayoutMultiColumnSet.cpp
+++ b/Source/core/layout/LayoutMultiColumnSet.cpp
@@ -68,10 +68,29 @@ const MultiColumnFragmentainerGroup& LayoutMultiColumnSet::fragmentainerGroupAtV
return m_fragmentainerGroups.first();
}
-LayoutUnit LayoutMultiColumnSet::pageLogicalHeight() const
+LayoutUnit LayoutMultiColumnSet::pageLogicalHeightForOffset(LayoutUnit offsetInFlowThread) const
+{
+ return fragmentainerGroupAtFlowThreadOffset(offsetInFlowThread).logicalHeight();
+}
+
+LayoutUnit LayoutMultiColumnSet::pageRemainingLogicalHeightForOffset(LayoutUnit offsetInFlowThread, PageBoundaryRule pageBoundaryRule) const
+{
+ const MultiColumnFragmentainerGroup& row = fragmentainerGroupAtFlowThreadOffset(offsetInFlowThread);
+ LayoutUnit pageLogicalHeight = row.logicalHeight();
+ ASSERT(pageLogicalHeight); // It's not allowed to call this method if the height is unknown.
+ LayoutUnit pageLogicalBottom = row.columnLogicalTopForOffset(offsetInFlowThread) + pageLogicalHeight;
+ LayoutUnit remainingLogicalHeight = pageLogicalBottom - offsetInFlowThread;
+
+ if (pageBoundaryRule == IncludePageBoundary) {
+ // If IncludePageBoundary is set, the line exactly on the top edge of a
+ // column will act as being part of the previous column.
+ remainingLogicalHeight = intMod(remainingLogicalHeight, pageLogicalHeight);
+ }
+ return remainingLogicalHeight;
+}
+
+bool LayoutMultiColumnSet::isPageLogicalHeightKnown() const
{
- // FIXME: pageLogicalHeight() needs to take a flow thread offset parameter, so that we can
- // locate the right row.
return firstFragmentainerGroup().logicalHeight();
}
« no previous file with comments | « Source/core/layout/LayoutMultiColumnSet.h ('k') | Source/core/layout/LayoutPagedFlowThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698