| 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 10 matching lines...) Expand all Loading... |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "core/layout/LayoutMultiColumnFlowThread.h" | 27 #include "core/layout/LayoutMultiColumnFlowThread.h" |
| 28 | 28 |
| 29 #include "core/layout/LayoutMultiColumnSet.h" | 29 #include "core/layout/LayoutMultiColumnSet.h" |
| 30 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h" | 30 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h" |
| 31 #include "platform/geometry/TransformState.h" |
| 31 | 32 |
| 32 namespace blink { | 33 namespace blink { |
| 33 | 34 |
| 34 LayoutMultiColumnFlowThread::LayoutMultiColumnFlowThread() | 35 LayoutMultiColumnFlowThread::LayoutMultiColumnFlowThread() |
| 35 : m_lastSetWorkedOn(nullptr) | 36 : m_lastSetWorkedOn(nullptr) |
| 36 , m_columnCount(1) | 37 , m_columnCount(1) |
| 37 , m_columnHeightAvailable(0) | 38 , m_columnHeightAvailable(0) |
| 38 , m_inBalancingPass(false) | 39 , m_inBalancingPass(false) |
| 39 , m_needsColumnHeightsRecalculation(false) | 40 , m_needsColumnHeightsRecalculation(false) |
| 40 , m_progressionIsInline(true) | 41 , m_progressionIsInline(true) |
| (...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 if (LayoutMultiColumnSet* lastSet = lastMultiColumnSet()) { | 845 if (LayoutMultiColumnSet* lastSet = lastMultiColumnSet()) { |
| 845 ASSERT(lastSet == m_lastSetWorkedOn); | 846 ASSERT(lastSet == m_lastSetWorkedOn); |
| 846 if (!lastSet->nextSiblingMultiColumnBox()) { | 847 if (!lastSet->nextSiblingMultiColumnBox()) { |
| 847 lastSet->endFlow(logicalHeight()); | 848 lastSet->endFlow(logicalHeight()); |
| 848 lastSet->expandToEncompassFlowThreadContentsIfNeeded(); | 849 lastSet->expandToEncompassFlowThreadContentsIfNeeded(); |
| 849 } | 850 } |
| 850 } | 851 } |
| 851 m_lastSetWorkedOn = nullptr; | 852 m_lastSetWorkedOn = nullptr; |
| 852 } | 853 } |
| 853 | 854 |
| 855 void LayoutMultiColumnFlowThread::mapAbsoluteToLocalPoint(MapCoordinatesFlags mo
de, TransformState& transformState) const |
| 856 { |
| 857 LayoutFlowThread::mapAbsoluteToLocalPoint(mode, transformState); |
| 858 |
| 859 // Descending into a multicol flow thread. Convert to the local coordinate s
pace, i.e. flow thread coordinates. |
| 860 LayoutPoint visualPoint = LayoutPoint(transformState.mappedPoint()); |
| 861 transformState.move(visualPoint - visualPointToFlowThreadPoint(visualPoint))
; |
| 862 } |
| 863 |
| 854 void LayoutMultiColumnFlowThread::setPageBreak(LayoutUnit offset, LayoutUnit spa
ceShortage) | 864 void LayoutMultiColumnFlowThread::setPageBreak(LayoutUnit offset, LayoutUnit spa
ceShortage) |
| 855 { | 865 { |
| 856 // Only positive values are interesting (and allowed) here. Zero space short
age may be reported | 866 // Only positive values are interesting (and allowed) here. Zero space short
age may be reported |
| 857 // when we're at the top of a column and the element has zero height. Ignore
this, and also | 867 // when we're at the top of a column and the element has zero height. Ignore
this, and also |
| 858 // ignore any negative values, which may occur when we set an early break in
order to honor | 868 // ignore any negative values, which may occur when we set an early break in
order to honor |
| 859 // widows in the next column. | 869 // widows in the next column. |
| 860 if (spaceShortage <= 0) | 870 if (spaceShortage <= 0) |
| 861 return; | 871 return; |
| 862 | 872 |
| 863 if (LayoutMultiColumnSet* multicolSet = columnSetAtBlockOffset(offset)) | 873 if (LayoutMultiColumnSet* multicolSet = columnSetAtBlockOffset(offset)) |
| (...skipping 18 matching lines...) Expand all Loading... |
| 882 } | 892 } |
| 883 | 893 |
| 884 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const | 894 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const |
| 885 { | 895 { |
| 886 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet()) | 896 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet()) |
| 887 return columnSet->pageLogicalHeight(); | 897 return columnSet->pageLogicalHeight(); |
| 888 return false; | 898 return false; |
| 889 } | 899 } |
| 890 | 900 |
| 891 } | 901 } |
| OLD | NEW |