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 12 matching lines...) Expand all Loading... |
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/LayoutMultiColumnSet.h" | 27 #include "core/layout/LayoutMultiColumnSet.h" |
28 | 28 |
29 #include "core/editing/PositionWithAffinity.h" | 29 #include "core/editing/PositionWithAffinity.h" |
30 #include "core/layout/LayoutMultiColumnFlowThread.h" | 30 #include "core/layout/LayoutMultiColumnFlowThread.h" |
31 #include "core/layout/MultiColumnFragmentainerGroup.h" | 31 #include "core/layout/MultiColumnFragmentainerGroup.h" |
32 #include "core/paint/MultiColumnSetPainter.h" | 32 #include "core/paint/MultiColumnSetPainter.h" |
| 33 #include "platform/RuntimeEnabledFeatures.h" |
33 | 34 |
34 namespace blink { | 35 namespace blink { |
35 | 36 |
36 LayoutMultiColumnSet::LayoutMultiColumnSet(LayoutFlowThread* flowThread) | 37 LayoutMultiColumnSet::LayoutMultiColumnSet(LayoutFlowThread* flowThread) |
37 : LayoutBlockFlow(0) | 38 : LayoutBlockFlow(0) |
38 , m_fragmentainerGroups(*this) | 39 , m_fragmentainerGroups(*this) |
39 , m_flowThread(flowThread) | 40 , m_flowThread(flowThread) |
40 { | 41 { |
41 } | 42 } |
42 | 43 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 clipRect = LayoutRect(minX, minY, maxX - minX, maxY - minY); | 131 clipRect = LayoutRect(minX, minY, maxX - minX, maxY - minY); |
131 } | 132 } |
132 | 133 |
133 return clipRect; | 134 return clipRect; |
134 } | 135 } |
135 | 136 |
136 bool LayoutMultiColumnSet::heightIsAuto() const | 137 bool LayoutMultiColumnSet::heightIsAuto() const |
137 { | 138 { |
138 LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread(); | 139 LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread(); |
139 if (!flowThread->isLayoutPagedFlowThread()) { | 140 if (!flowThread->isLayoutPagedFlowThread()) { |
140 if (multiColumnBlockFlow()->style()->columnFill() == ColumnFillBalance) | 141 // If support for the column-fill property isn't enabled, we want to beh
ave as if |
141 return true; | 142 // column-fill were auto, so that multicol containers with specified hei
ght don't get their |
| 143 // columns balanced (auto-height multicol containers will still get thei
r columns balanced, |
| 144 // even if column-fill isn't 'balance' - in accordance with the spec). P
retending that |
| 145 // column-fill is auto also matches the old multicol implementation, whi
ch has no support |
| 146 // for this property. |
| 147 if (RuntimeEnabledFeatures::columnFillEnabled()) { |
| 148 if (multiColumnBlockFlow()->style()->columnFill() == ColumnFillBalan
ce) |
| 149 return true; |
| 150 } |
142 if (LayoutBox* next = nextSiblingBox()) { | 151 if (LayoutBox* next = nextSiblingBox()) { |
143 if (next->isLayoutMultiColumnSpannerPlaceholder()) { | 152 if (next->isLayoutMultiColumnSpannerPlaceholder()) { |
144 // If we're followed by a spanner, we need to balance. | 153 // If we're followed by a spanner, we need to balance. |
145 return true; | 154 return true; |
146 } | 155 } |
147 } | 156 } |
148 } | 157 } |
149 return !flowThread->columnHeightAvailable(); | 158 return !flowThread->columnHeightAvailable(); |
150 } | 159 } |
151 | 160 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 | 326 |
318 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const | 327 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const |
319 { | 328 { |
320 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi
dth(), logicalHeightInFlowThread()); | 329 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi
dth(), logicalHeightInFlowThread()); |
321 if (!isHorizontalWritingMode()) | 330 if (!isHorizontalWritingMode()) |
322 return portionRect.transposedRect(); | 331 return portionRect.transposedRect(); |
323 return portionRect; | 332 return portionRect; |
324 } | 333 } |
325 | 334 |
326 } | 335 } |
OLD | NEW |