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 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1301 } | 1301 } |
1302 | 1302 |
1303 void LayoutMultiColumnFlowThread::layout() { | 1303 void LayoutMultiColumnFlowThread::layout() { |
1304 ASSERT(!m_lastSetWorkedOn); | 1304 ASSERT(!m_lastSetWorkedOn); |
1305 m_lastSetWorkedOn = firstMultiColumnSet(); | 1305 m_lastSetWorkedOn = firstMultiColumnSet(); |
1306 if (m_lastSetWorkedOn) | 1306 if (m_lastSetWorkedOn) |
1307 m_lastSetWorkedOn->beginFlow(LayoutUnit()); | 1307 m_lastSetWorkedOn->beginFlow(LayoutUnit()); |
1308 LayoutFlowThread::layout(); | 1308 LayoutFlowThread::layout(); |
1309 if (LayoutMultiColumnSet* lastSet = lastMultiColumnSet()) { | 1309 if (LayoutMultiColumnSet* lastSet = lastMultiColumnSet()) { |
1310 ASSERT(lastSet == m_lastSetWorkedOn); | 1310 ASSERT(lastSet == m_lastSetWorkedOn); |
1311 if (!lastSet->nextSiblingMultiColumnBox()) { | 1311 if (!lastSet->nextSiblingMultiColumnSet()) { |
1312 // Include trailing overflow in the last column set. The idea is that we | 1312 // Include trailing overflow in the last column set (also if the last set |
1313 // will generate additional columns and pages to hold that overflow, since | 1313 // is followed by one or more spanner placeholders). The idea is that we |
1314 // people do write bad content like <body style="height:0px"> in | 1314 // will generate additional columns and pages to hold that overflow, |
| 1315 // since people do write bad content like <body style="height:0px"> in |
1315 // multi-column layouts. | 1316 // multi-column layouts. |
1316 // TODO(mstensho): Once we support nested multicol, adding in overflow | 1317 // TODO(mstensho): Once we support nested multicol, adding in overflow |
1317 // here may result in the need for creating additional rows, since there | 1318 // here may result in the need for creating additional rows, since there |
1318 // may not be enough space remaining in the currently last row. | 1319 // may not be enough space remaining in the currently last row. |
1319 LayoutRect layoutRect = layoutOverflowRect(); | 1320 LayoutRect layoutRect = layoutOverflowRect(); |
1320 LayoutUnit logicalBottomInFlowThread = | 1321 LayoutUnit logicalBottomInFlowThread = |
1321 isHorizontalWritingMode() ? layoutRect.maxY() : layoutRect.maxX(); | 1322 isHorizontalWritingMode() ? layoutRect.maxY() : layoutRect.maxX(); |
1322 ASSERT(logicalBottomInFlowThread >= logicalHeight()); | 1323 ASSERT(logicalBottomInFlowThread >= logicalHeight()); |
1323 lastSet->endFlow(logicalBottomInFlowThread); | 1324 lastSet->endFlow(logicalBottomInFlowThread); |
1324 } | 1325 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1376 const { | 1377 const { |
1377 return MultiColumnLayoutState(m_lastSetWorkedOn); | 1378 return MultiColumnLayoutState(m_lastSetWorkedOn); |
1378 } | 1379 } |
1379 | 1380 |
1380 void LayoutMultiColumnFlowThread::restoreMultiColumnLayoutState( | 1381 void LayoutMultiColumnFlowThread::restoreMultiColumnLayoutState( |
1381 const MultiColumnLayoutState& state) { | 1382 const MultiColumnLayoutState& state) { |
1382 m_lastSetWorkedOn = state.columnSet(); | 1383 m_lastSetWorkedOn = state.columnSet(); |
1383 } | 1384 } |
1384 | 1385 |
1385 } // namespace blink | 1386 } // namespace blink |
OLD | NEW |