OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/layout/MultiColumnFragmentainerGroup.h" | 5 #include "core/layout/MultiColumnFragmentainerGroup.h" |
6 | 6 |
7 #include "core/layout/ColumnBalancer.h" | 7 #include "core/layout/ColumnBalancer.h" |
8 #include "core/layout/FragmentationContext.h" | 8 #include "core/layout/FragmentationContext.h" |
9 #include "core/layout/LayoutMultiColumnSet.h" | 9 #include "core/layout/LayoutMultiColumnSet.h" |
10 | 10 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 LayoutMultiColumnFlowThread* flowThread = m_columnSet.multiColumnFlowThread(
); | 103 LayoutMultiColumnFlowThread* flowThread = m_columnSet.multiColumnFlowThread(
); |
104 | 104 |
105 // A column out of range doesn't have a flow thread portion, so we need to c
lamp to make sure | 105 // A column out of range doesn't have a flow thread portion, so we need to c
lamp to make sure |
106 // that we stay within the actual columns. This means that content in the ov
erflow area will be | 106 // that we stay within the actual columns. This means that content in the ov
erflow area will be |
107 // mapped to the last actual column, instead of being mapped to an imaginary
column further | 107 // mapped to the last actual column, instead of being mapped to an imaginary
column further |
108 // ahead. | 108 // ahead. |
109 unsigned columnIndex = offsetInFlowThread >= logicalBottomInFlowThread() ? a
ctualColumnCount() - 1 : columnIndexAtOffset(offsetInFlowThread, rule); | 109 unsigned columnIndex = offsetInFlowThread >= logicalBottomInFlowThread() ? a
ctualColumnCount() - 1 : columnIndexAtOffset(offsetInFlowThread, rule); |
110 | 110 |
111 LayoutRect portionRect(flowThreadPortionRectAt(columnIndex)); | 111 LayoutRect portionRect(flowThreadPortionRectAt(columnIndex)); |
112 flowThread->flipForWritingMode(portionRect); | 112 flowThread->flipForWritingMode(portionRect); |
| 113 portionRect.moveBy(flowThread->topLeftLocation()); |
| 114 |
113 LayoutRect columnRect(columnRectAt(columnIndex)); | 115 LayoutRect columnRect(columnRectAt(columnIndex)); |
| 116 columnRect.move(offsetFromColumnSet()); |
114 m_columnSet.flipForWritingMode(columnRect); | 117 m_columnSet.flipForWritingMode(columnRect); |
115 LayoutSize translationRelativeToGroup = columnRect.location() - portionRect.
location(); | 118 columnRect.moveBy(m_columnSet.topLeftLocation()); |
116 LayoutSize translationRelativeToFlowThread = translationRelativeToGroup + of
fsetFromColumnSet() + m_columnSet.topLeftLocationOffset() - flowThread->topLeftL
ocationOffset(); | 119 |
| 120 LayoutSize translationRelativeToFlowThread = columnRect.location() - portion
Rect.location(); |
117 if (mode == CoordinateSpaceConversion::Containing) | 121 if (mode == CoordinateSpaceConversion::Containing) |
118 return translationRelativeToFlowThread; | 122 return translationRelativeToFlowThread; |
119 | 123 |
120 LayoutSize enclosingTranslation; | 124 LayoutSize enclosingTranslation; |
121 if (LayoutMultiColumnFlowThread* enclosingFlowThread = flowThread->enclosing
FlowThread()) { | 125 if (LayoutMultiColumnFlowThread* enclosingFlowThread = flowThread->enclosing
FlowThread()) { |
122 const MultiColumnFragmentainerGroup& firstRow = flowThread->firstMultiCo
lumnSet()->firstFragmentainerGroup(); | 126 const MultiColumnFragmentainerGroup& firstRow = flowThread->firstMultiCo
lumnSet()->firstFragmentainerGroup(); |
123 // Translation that would map points in the coordinate space of the oute
rmost flow thread to | 127 // Translation that would map points in the coordinate space of the oute
rmost flow thread to |
124 // visual points in the first column in the first fragmentainer group (r
ow) in our multicol | 128 // visual points in the first column in the first fragmentainer group (r
ow) in our multicol |
125 // container. | 129 // container. |
126 LayoutSize enclosingTranslationOrigin = enclosingFlowThread->flowThreadT
ranslationAtOffset(firstRow.blockOffsetInEnclosingFragmentationContext(), Layout
Box::AssociateWithLatterPage, mode); | 130 LayoutSize enclosingTranslationOrigin = enclosingFlowThread->flowThreadT
ranslationAtOffset(firstRow.blockOffsetInEnclosingFragmentationContext(), Layout
Box::AssociateWithLatterPage, mode); |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 append(MultiColumnFragmentainerGroup(m_columnSet)); | 484 append(MultiColumnFragmentainerGroup(m_columnSet)); |
481 return last(); | 485 return last(); |
482 } | 486 } |
483 | 487 |
484 void MultiColumnFragmentainerGroupList::deleteExtraGroups() | 488 void MultiColumnFragmentainerGroupList::deleteExtraGroups() |
485 { | 489 { |
486 shrink(1); | 490 shrink(1); |
487 } | 491 } |
488 | 492 |
489 } // namespace blink | 493 } // namespace blink |
OLD | NEW |