| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/FragmentainerIterator.h" | 5 #include "core/layout/FragmentainerIterator.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutMultiColumnSet.h" | 7 #include "core/layout/LayoutMultiColumnSet.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 if (AtEnd()) | 64 if (AtEnd()) |
| 65 return; | 65 return; |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 | 68 |
| 69 LayoutSize FragmentainerIterator::PaginationOffset() const { | 69 LayoutSize FragmentainerIterator::PaginationOffset() const { |
| 70 DCHECK(!AtEnd()); | 70 DCHECK(!AtEnd()); |
| 71 const MultiColumnFragmentainerGroup& group = CurrentGroup(); | 71 const MultiColumnFragmentainerGroup& group = CurrentGroup(); |
| 72 LayoutUnit fragmentainer_logical_top_in_flow_thread = | 72 LayoutUnit fragmentainer_logical_top_in_flow_thread = |
| 73 group.LogicalTopInFlowThread() + | 73 group.LogicalTopInFlowThread() + |
| 74 current_fragmentainer_index_ * group.LogicalHeight(); | 74 current_fragmentainer_index_ * group.ColumnLogicalHeight(); |
| 75 return group.FlowThreadTranslationAtOffset( | 75 return group.FlowThreadTranslationAtOffset( |
| 76 fragmentainer_logical_top_in_flow_thread, | 76 fragmentainer_logical_top_in_flow_thread, |
| 77 LayoutBox::kAssociateWithLatterPage, CoordinateSpaceConversion::kVisual); | 77 LayoutBox::kAssociateWithLatterPage, CoordinateSpaceConversion::kVisual); |
| 78 } | 78 } |
| 79 | 79 |
| 80 LayoutRect FragmentainerIterator::ClipRectInFlowThread( | 80 LayoutRect FragmentainerIterator::ClipRectInFlowThread( |
| 81 MultiColumnFragmentainerGroup::ClipRectAxesSelector axes_selector) const { | 81 MultiColumnFragmentainerGroup::ClipRectAxesSelector axes_selector) const { |
| 82 DCHECK(!AtEnd()); | 82 DCHECK(!AtEnd()); |
| 83 LayoutRect clip_rect = CurrentGroup().FlowThreadPortionOverflowRectAt( | 83 LayoutRect clip_rect = CurrentGroup().FlowThreadPortionOverflowRectAt( |
| 84 current_fragmentainer_index_, axes_selector); | 84 current_fragmentainer_index_, axes_selector); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 if (current_fragmentainer_index_ < first_fragmentainer_in_clip_rect) | 148 if (current_fragmentainer_index_ < first_fragmentainer_in_clip_rect) |
| 149 current_fragmentainer_index_ = first_fragmentainer_in_clip_rect; | 149 current_fragmentainer_index_ = first_fragmentainer_in_clip_rect; |
| 150 if (end_fragmentainer_index_ > last_fragmentainer_in_clip_rect) | 150 if (end_fragmentainer_index_ > last_fragmentainer_in_clip_rect) |
| 151 end_fragmentainer_index_ = last_fragmentainer_in_clip_rect; | 151 end_fragmentainer_index_ = last_fragmentainer_in_clip_rect; |
| 152 } | 152 } |
| 153 DCHECK_GE(end_fragmentainer_index_, current_fragmentainer_index_); | 153 DCHECK_GE(end_fragmentainer_index_, current_fragmentainer_index_); |
| 154 return true; | 154 return true; |
| 155 } | 155 } |
| 156 | 156 |
| 157 } // namespace blink | 157 } // namespace blink |
| OLD | NEW |