OLD | NEW |
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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 | 332 |
333 MultiColumnSetSearchAdapter adapter(offset); | 333 MultiColumnSetSearchAdapter adapter(offset); |
334 m_multiColumnSetIntervalTree.allOverlapsWithAdapter<MultiColumnSetSearchAdap
ter>(adapter); | 334 m_multiColumnSetIntervalTree.allOverlapsWithAdapter<MultiColumnSetSearchAdap
ter>(adapter); |
335 | 335 |
336 // If no set was found, the offset is in the flow thread overflow. | 336 // If no set was found, the offset is in the flow thread overflow. |
337 if (!adapter.result() && !m_multiColumnSetList.isEmpty()) | 337 if (!adapter.result() && !m_multiColumnSetList.isEmpty()) |
338 return m_multiColumnSetList.last(); | 338 return m_multiColumnSetList.last(); |
339 return adapter.result(); | 339 return adapter.result(); |
340 } | 340 } |
341 | 341 |
342 void LayoutMultiColumnFlowThread::layoutColumns(bool relayoutChildren, SubtreeLa
youtScope& layoutScope) | 342 void LayoutMultiColumnFlowThread::layoutColumns(SubtreeLayoutScope& layoutScope) |
343 { | 343 { |
344 if (relayoutChildren) | 344 // Since we ended up here, it means that the multicol container (our parent)
needed |
345 layoutScope.setChildNeedsLayout(this); | 345 // layout. Since contents of the multicol container are diverted to the flow
thread, the flow |
| 346 // thread needs layout as well. |
| 347 layoutScope.setChildNeedsLayout(this); |
346 | 348 |
347 m_needsColumnHeightsRecalculation = false; | 349 m_needsColumnHeightsRecalculation = false; |
348 if (!needsLayout()) { | |
349 // Just before the multicol container (our parent LayoutBlockFlow) finis
hes laying out, it | |
350 // will call recalculateColumnHeights() on us unconditionally, but we on
ly want that method | |
351 // to do any work if we actually laid out the flow thread. Otherwise, th
e balancing | |
352 // machinery would kick in needlessly, and trigger additional layout pas
ses. Furthermore, we | |
353 // actually depend on a proper flowthread layout pass in order to do bal
ancing, since it's | |
354 // flowthread layout that sets up content runs. | |
355 return; | |
356 } | |
357 | 350 |
358 m_blockOffsetInEnclosingFlowThread = enclosingFlowThread() ? multiColumnBloc
kFlow()->offsetFromLogicalTopOfFirstPage() : LayoutUnit(); | 351 m_blockOffsetInEnclosingFlowThread = enclosingFlowThread() ? multiColumnBloc
kFlow()->offsetFromLogicalTopOfFirstPage() : LayoutUnit(); |
359 | 352 |
360 for (LayoutBox* columnBox = firstMultiColumnBox(); columnBox; columnBox = co
lumnBox->nextSiblingMultiColumnBox()) { | 353 for (LayoutBox* columnBox = firstMultiColumnBox(); columnBox; columnBox = co
lumnBox->nextSiblingMultiColumnBox()) { |
361 if (!columnBox->isLayoutMultiColumnSet()) { | 354 if (!columnBox->isLayoutMultiColumnSet()) { |
362 ASSERT(columnBox->isLayoutMultiColumnSpannerPlaceholder()); // no ot
her type is expected. | 355 ASSERT(columnBox->isLayoutMultiColumnSpannerPlaceholder()); // no ot
her type is expected. |
363 m_needsColumnHeightsRecalculation = true; | 356 m_needsColumnHeightsRecalculation = true; |
364 continue; | 357 continue; |
365 } | 358 } |
366 LayoutMultiColumnSet* columnSet = toLayoutMultiColumnSet(columnBox); | 359 LayoutMultiColumnSet* columnSet = toLayoutMultiColumnSet(columnBox); |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 appendNewFragmentainerGroupIfNeeded(logicalTopInFlowThreadAfterPagination); | 928 appendNewFragmentainerGroupIfNeeded(logicalTopInFlowThreadAfterPagination); |
936 } | 929 } |
937 | 930 |
938 void LayoutMultiColumnFlowThread::updateMinimumPageHeight(LayoutUnit offset, Lay
outUnit minHeight) | 931 void LayoutMultiColumnFlowThread::updateMinimumPageHeight(LayoutUnit offset, Lay
outUnit minHeight) |
939 { | 932 { |
940 if (LayoutMultiColumnSet* multicolSet = columnSetAtBlockOffset(offset)) | 933 if (LayoutMultiColumnSet* multicolSet = columnSetAtBlockOffset(offset)) |
941 multicolSet->updateMinimumColumnHeight(offset, minHeight); | 934 multicolSet->updateMinimumColumnHeight(offset, minHeight); |
942 } | 935 } |
943 | 936 |
944 } | 937 } |
OLD | NEW |