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

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

Issue 1472053002: Jump to the next outer column when an inner column is too short. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reduce diff - early return so that we can revert some indentation changes Created 5 years, 1 month 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 | « third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp b/third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp
index 0b9ed3a64619e1c88b37719433a8a27b8f55e6d1..ef5e7ef73500ec4e87ad29e855e5e06d38a1f46f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp
@@ -97,6 +97,35 @@ bool LayoutMultiColumnSet::isPageLogicalHeightKnown() const
return firstFragmentainerGroup().logicalHeight();
}
+LayoutUnit LayoutMultiColumnSet::nextLogicalTopForUnbreakableContent(LayoutUnit flowThreadOffset, LayoutUnit contentLogicalHeight) const
+{
+ ASSERT(pageLogicalTopForOffset(flowThreadOffset) == flowThreadOffset); // That's all we bother to handle.
leviw_travelin_and_unemployed 2015/11/25 19:26:34 Nit: This comment doesn't help me.
mstensho (USE GERRIT) 2015/11/25 20:08:17 Removed. "|flowThreadOffset| is expected to be at
+ LayoutMultiColumnFlowThread* enclosingFlowThread = multiColumnFlowThread()->enclosingFlowThread();
+ if (!enclosingFlowThread) {
+ // If there's no enclosing fragmentation context, there'll ever be only one row, and all
+ // columns there will have the same height.
+ return flowThreadOffset;
+ }
+
+ if (pageLogicalHeightForOffset(flowThreadOffset) >= contentLogicalHeight)
leviw_travelin_and_unemployed 2015/11/25 19:26:34 This makes sense, but it appears in the current co
mstensho (USE GERRIT) 2015/11/25 20:08:17 Right. No need to be that robust. Let's add an ass
leviw_travelin_and_unemployed 2015/11/25 22:00:49 I was hoping you'd say that ;)
+ return flowThreadOffset;
+
+ // There's a likelihood for subsequent rows to be taller than the first one.
+ // TODO(mstensho): if we're doubly nested (e.g. multicol in multicol in multicol), we need to
+ // look beyond the first row here.
leviw_travelin_and_unemployed 2015/11/25 19:26:34 http://i.imgur.com/EqQOTR9.jpg
mstensho (USE GERRIT) 2015/11/25 20:08:17 http://renholdsnytt.no/var/askmedia/storage/images
leviw_travelin_and_unemployed 2015/11/25 22:00:49 HA!
+ const MultiColumnFragmentainerGroup& firstRow = firstFragmentainerGroup();
+ LayoutUnit firstRowLogicalBottomInFlowThread = firstRow.logicalTopInFlowThread() + firstRow.logicalHeight() * usedColumnCount();
+ if (flowThreadOffset >= firstRowLogicalBottomInFlowThread)
+ return flowThreadOffset; // We're not in the first row. Give up.
+ LayoutUnit newLogicalHeight = enclosingFlowThread->pageLogicalHeightForOffset(firstRowLogicalBottomInFlowThread);
+ if (contentLogicalHeight > newLogicalHeight) {
+ // The next outer column or page doesn't have enough space either. Give up and stay where
+ // we are.
+ return flowThreadOffset;
+ }
+ return firstRowLogicalBottomInFlowThread;
+}
+
LayoutMultiColumnSet* LayoutMultiColumnSet::nextSiblingMultiColumnSet() const
{
for (LayoutObject* sibling = nextSibling(); sibling; sibling = sibling->nextSibling()) {
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698