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 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 void LayoutMultiColumnFlowThread::layout() | 864 void LayoutMultiColumnFlowThread::layout() |
865 { | 865 { |
866 ASSERT(!m_lastSetWorkedOn); | 866 ASSERT(!m_lastSetWorkedOn); |
867 m_lastSetWorkedOn = firstMultiColumnSet(); | 867 m_lastSetWorkedOn = firstMultiColumnSet(); |
868 if (m_lastSetWorkedOn) | 868 if (m_lastSetWorkedOn) |
869 m_lastSetWorkedOn->beginFlow(LayoutUnit()); | 869 m_lastSetWorkedOn->beginFlow(LayoutUnit()); |
870 LayoutFlowThread::layout(); | 870 LayoutFlowThread::layout(); |
871 if (LayoutMultiColumnSet* lastSet = lastMultiColumnSet()) { | 871 if (LayoutMultiColumnSet* lastSet = lastMultiColumnSet()) { |
872 ASSERT(lastSet == m_lastSetWorkedOn); | 872 ASSERT(lastSet == m_lastSetWorkedOn); |
873 if (!lastSet->nextSiblingMultiColumnBox()) { | 873 if (!lastSet->nextSiblingMultiColumnBox()) { |
874 lastSet->endFlow(logicalHeight()); | 874 // Include trailing overflow in the last column set. The idea is tha
t we will generate |
875 lastSet->expandToEncompassFlowThreadContentsIfNeeded(); | 875 // additional columns and pages to hold that overflow, since people
do write bad content |
| 876 // like <body style="height:0px"> in multi-column layouts. |
| 877 // TODO(mstensho): Once we support nested multicol, adding in overfl
ow here may result |
| 878 // in the need for creating additional rows, since there may not be
enough space |
| 879 // remaining in the currently last row. |
| 880 LayoutRect layoutRect = layoutOverflowRect(); |
| 881 LayoutUnit logicalBottomInFlowThread = isHorizontalWritingMode() ? l
ayoutRect.maxY() : layoutRect.maxX(); |
| 882 ASSERT(logicalBottomInFlowThread >= logicalHeight()); |
| 883 lastSet->endFlow(logicalBottomInFlowThread); |
876 } | 884 } |
877 } | 885 } |
878 m_lastSetWorkedOn = nullptr; | 886 m_lastSetWorkedOn = nullptr; |
879 } | 887 } |
880 | 888 |
881 void LayoutMultiColumnFlowThread::setPageBreak(LayoutUnit offset, LayoutUnit spa
ceShortage) | 889 void LayoutMultiColumnFlowThread::setPageBreak(LayoutUnit offset, LayoutUnit spa
ceShortage) |
882 { | 890 { |
883 // Only positive values are interesting (and allowed) here. Zero space short
age may be reported | 891 // Only positive values are interesting (and allowed) here. Zero space short
age may be reported |
884 // when we're at the top of a column and the element has zero height. Ignore
this, and also | 892 // when we're at the top of a column and the element has zero height. Ignore
this, and also |
885 // ignore any negative values, which may occur when we set an early break in
order to honor | 893 // ignore any negative values, which may occur when we set an early break in
order to honor |
(...skipping 23 matching lines...) Expand all Loading... |
909 } | 917 } |
910 | 918 |
911 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const | 919 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const |
912 { | 920 { |
913 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet()) | 921 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet()) |
914 return columnSet->pageLogicalHeight(); | 922 return columnSet->pageLogicalHeight(); |
915 return false; | 923 return false; |
916 } | 924 } |
917 | 925 |
918 } | 926 } |
OLD | NEW |