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 unsigned columnIndex = columnIndexAtOffset(offsetInFlowThread); | 104 unsigned columnIndex = columnIndexAtOffset(offsetInFlowThread); |
105 LayoutRect portionRect(flowThreadPortionRectAt(columnIndex)); | 105 LayoutRect portionRect(flowThreadPortionRectAt(columnIndex)); |
106 flowThread->flipForWritingMode(portionRect); | 106 flowThread->flipForWritingMode(portionRect); |
107 LayoutRect columnRect(columnRectAt(columnIndex)); | 107 LayoutRect columnRect(columnRectAt(columnIndex)); |
108 m_columnSet.flipForWritingMode(columnRect); | 108 m_columnSet.flipForWritingMode(columnRect); |
109 LayoutSize translationRelativeToGroup = columnRect.location() - portionRect.
location(); | 109 LayoutSize translationRelativeToGroup = columnRect.location() - portionRect.
location(); |
110 | 110 |
111 LayoutSize enclosingTranslation; | 111 LayoutSize enclosingTranslation; |
112 if (LayoutMultiColumnFlowThread* enclosingFlowThread = flowThread->enclosing
FlowThread()) { | 112 if (LayoutMultiColumnFlowThread* enclosingFlowThread = flowThread->enclosing
FlowThread()) { |
| 113 const MultiColumnFragmentainerGroup& firstRow = flowThread->firstMultiCo
lumnSet()->firstFragmentainerGroup(); |
113 // Translation that would map points in the coordinate space of the oute
rmost flow thread to | 114 // Translation that would map points in the coordinate space of the oute
rmost flow thread to |
114 // visual points in the first column in the first fragmentainer group (r
ow) in our multicol | 115 // visual points in the first column in the first fragmentainer group (r
ow) in our multicol |
115 // container. | 116 // container. |
116 LayoutSize enclosingTranslationOrigin = enclosingFlowThread->flowThreadT
ranslationAtOffset(flowThread->blockOffsetInEnclosingFragmentationContext()); | 117 LayoutSize enclosingTranslationOrigin = enclosingFlowThread->flowThreadT
ranslationAtOffset(firstRow.blockOffsetInEnclosingFragmentationContext()); |
117 | 118 |
118 // Translation that would map points in the coordinate space of the oute
rmost flow thread to | 119 // Translation that would map points in the coordinate space of the oute
rmost flow thread to |
119 // visual points in the first column in this fragmentainer group. | 120 // visual points in the first column in this fragmentainer group. |
120 enclosingTranslation = enclosingFlowThread->flowThreadTranslationAtOffse
t(blockOffsetInEnclosingFragmentationContext()); | 121 enclosingTranslation = enclosingFlowThread->flowThreadTranslationAtOffse
t(blockOffsetInEnclosingFragmentationContext()); |
121 | 122 |
122 // What we ultimately return from this method is a translation that maps
points in the | 123 // What we ultimately return from this method is a translation that maps
points in the |
123 // coordinate space of our flow thread to a visual point in a certain co
lumn in this | 124 // coordinate space of our flow thread to a visual point in a certain co
lumn in this |
124 // fragmentainer group. We had to go all the way up to the outermost flo
w thread, since this | 125 // fragmentainer group. We had to go all the way up to the outermost flo
w thread, since this |
125 // fragmentainer group may be in a different outer column than the first
outer column that | 126 // fragmentainer group may be in a different outer column than the first
outer column that |
126 // this multicol container lives in. It's the visual distance between th
e first | 127 // this multicol container lives in. It's the visual distance between th
e first |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 append(MultiColumnFragmentainerGroup(m_columnSet)); | 532 append(MultiColumnFragmentainerGroup(m_columnSet)); |
532 return last(); | 533 return last(); |
533 } | 534 } |
534 | 535 |
535 void MultiColumnFragmentainerGroupList::deleteExtraGroups() | 536 void MultiColumnFragmentainerGroupList::deleteExtraGroups() |
536 { | 537 { |
537 shrink(1); | 538 shrink(1); |
538 } | 539 } |
539 | 540 |
540 } // namespace blink | 541 } // namespace blink |
OLD | NEW |