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

Side by Side 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, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutBlockFlow.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 for (const LayoutMultiColumnSet* candidate = firstMultiColumnSet(); candidat e; candidate = candidate->nextSiblingMultiColumnSet()) { 209 for (const LayoutMultiColumnSet* candidate = firstMultiColumnSet(); candidat e; candidate = candidate->nextSiblingMultiColumnSet()) {
210 columnSet = candidate; 210 columnSet = candidate;
211 if (candidate->logicalBottom() > blockOffset) 211 if (candidate->logicalBottom() > blockOffset)
212 break; 212 break;
213 } 213 }
214 return columnSet ? columnSet->visualPointToFlowThreadPoint(toLayoutPoint(vis ualPoint + location() - columnSet->location())) : visualPoint; 214 return columnSet ? columnSet->visualPointToFlowThreadPoint(toLayoutPoint(vis ualPoint + location() - columnSet->location())) : visualPoint;
215 } 215 }
216 216
217 LayoutMultiColumnSet* LayoutMultiColumnFlowThread::columnSetAtBlockOffset(Layout Unit offset) const 217 LayoutMultiColumnSet* LayoutMultiColumnFlowThread::columnSetAtBlockOffset(Layout Unit offset) const
218 { 218 {
219 if (m_lastSetWorkedOn) { 219 if (LayoutMultiColumnSet* columnSet = m_lastSetWorkedOn) {
220 // Layout in progress. We are calculating the set heights as we speak, s o the column set range 220 // Layout in progress. We are calculating the set heights as we speak, s o the column set range
221 // information is not up-to-date. 221 // information is not up-to-date.
222 return m_lastSetWorkedOn; 222 while (columnSet->logicalTopInFlowThread() > offset) {
223 // Sometimes we have to use a previous set. This happens when we're working with a block
224 // that contains a spanner (so that there's a column set both before and after the
225 // spanner, and both sets contain said block).
226 LayoutMultiColumnSet* previousSet = columnSet->previousSiblingMultiC olumnSet();
227 if (!previousSet)
228 break;
229 columnSet = previousSet;
230 }
231 return columnSet;
223 } 232 }
224 233
225 ASSERT(!m_columnSetsInvalidated); 234 ASSERT(!m_columnSetsInvalidated);
226 if (m_multiColumnSetList.isEmpty()) 235 if (m_multiColumnSetList.isEmpty())
227 return 0; 236 return 0;
228 if (offset <= 0) 237 if (offset <= 0)
229 return m_multiColumnSetList.first(); 238 return m_multiColumnSetList.first();
230 239
231 MultiColumnSetSearchAdapter adapter(offset); 240 MultiColumnSetSearchAdapter adapter(offset);
232 m_multiColumnSetIntervalTree.allOverlapsWithAdapter<MultiColumnSetSearchAdap ter>(adapter); 241 m_multiColumnSetIntervalTree.allOverlapsWithAdapter<MultiColumnSetSearchAdap ter>(adapter);
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 } 753 }
745 754
746 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const 755 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const
747 { 756 {
748 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet()) 757 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet())
749 return columnSet->pageLogicalHeight(); 758 return columnSet->pageLogicalHeight();
750 return false; 759 return false;
751 } 760 }
752 761
753 } 762 }
OLDNEW
« 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