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

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

Issue 1163583006: Don't eat margins when column height isn't yet known. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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/LayoutBlockFlow.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutMultiColumnFlowThread.cpp
diff --git a/Source/core/layout/LayoutMultiColumnFlowThread.cpp b/Source/core/layout/LayoutMultiColumnFlowThread.cpp
index 51c0a42890106bbebbbca8f4a0e21e259904a6d8..a62106fdb41e4d2fbb5fcd9773fb60a7b94d6b18 100644
--- a/Source/core/layout/LayoutMultiColumnFlowThread.cpp
+++ b/Source/core/layout/LayoutMultiColumnFlowThread.cpp
@@ -216,10 +216,19 @@ LayoutPoint LayoutMultiColumnFlowThread::visualPointToFlowThreadPoint(const Layo
LayoutMultiColumnSet* LayoutMultiColumnFlowThread::columnSetAtBlockOffset(LayoutUnit offset) const
{
- if (m_lastSetWorkedOn) {
+ if (LayoutMultiColumnSet* columnSet = m_lastSetWorkedOn) {
// Layout in progress. We are calculating the set heights as we speak, so the column set range
// information is not up-to-date.
- return m_lastSetWorkedOn;
+ while (columnSet->logicalTopInFlowThread() > offset) {
+ // Sometimes we have to use a previous set. This happens when we're working with a block
+ // that contains a spanner (so that there's a column set both before and after the
+ // spanner, and both sets contain said block).
+ LayoutMultiColumnSet* previousSet = columnSet->previousSiblingMultiColumnSet();
+ if (!previousSet)
+ break;
+ columnSet = previousSet;
+ }
+ return columnSet;
}
ASSERT(!m_columnSetsInvalidated);
« no previous file with comments | « Source/core/layout/LayoutBlockFlow.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698