| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 DCHECK(!atEnd()); | 70 DCHECK(!atEnd()); |
| 71 const MultiColumnFragmentainerGroup& group = currentGroup(); | 71 const MultiColumnFragmentainerGroup& group = currentGroup(); |
| 72 LayoutUnit fragmentainerLogicalTopInFlowThread = | 72 LayoutUnit fragmentainerLogicalTopInFlowThread = |
| 73 group.logicalTopInFlowThread() + | 73 group.logicalTopInFlowThread() + |
| 74 m_currentFragmentainerIndex * group.logicalHeight(); | 74 m_currentFragmentainerIndex * group.logicalHeight(); |
| 75 return group.flowThreadTranslationAtOffset( | 75 return group.flowThreadTranslationAtOffset( |
| 76 fragmentainerLogicalTopInFlowThread, LayoutBox::AssociateWithLatterPage, | 76 fragmentainerLogicalTopInFlowThread, LayoutBox::AssociateWithLatterPage, |
| 77 CoordinateSpaceConversion::Visual); | 77 CoordinateSpaceConversion::Visual); |
| 78 } | 78 } |
| 79 | 79 |
| 80 LayoutRect FragmentainerIterator::fragmentainerInFlowThread() const { | 80 LayoutRect FragmentainerIterator::clipRectInFlowThread( |
| 81 DCHECK(!atEnd()); | 81 MultiColumnFragmentainerGroup::ClipRectAxesSelector axesSelector) const { |
| 82 LayoutRect fragmentainerInFlowThread = | |
| 83 currentGroup().flowThreadPortionRectAt(m_currentFragmentainerIndex); | |
| 84 m_flowThread.flipForWritingMode(fragmentainerInFlowThread); | |
| 85 return fragmentainerInFlowThread; | |
| 86 } | |
| 87 | |
| 88 LayoutRect FragmentainerIterator::clipRectInFlowThread() const { | |
| 89 DCHECK(!atEnd()); | 82 DCHECK(!atEnd()); |
| 90 LayoutRect clipRect = currentGroup().flowThreadPortionOverflowRectAt( | 83 LayoutRect clipRect = currentGroup().flowThreadPortionOverflowRectAt( |
| 91 m_currentFragmentainerIndex); | 84 m_currentFragmentainerIndex, axesSelector); |
| 92 m_flowThread.flipForWritingMode(clipRect); | 85 m_flowThread.flipForWritingMode(clipRect); |
| 93 return clipRect; | 86 return clipRect; |
| 94 } | 87 } |
| 95 | 88 |
| 96 const MultiColumnFragmentainerGroup& FragmentainerIterator::currentGroup() | 89 const MultiColumnFragmentainerGroup& FragmentainerIterator::currentGroup() |
| 97 const { | 90 const { |
| 98 DCHECK(!atEnd()); | 91 DCHECK(!atEnd()); |
| 99 return m_currentColumnSet | 92 return m_currentColumnSet |
| 100 ->fragmentainerGroups()[m_currentFragmentainerGroupIndex]; | 93 ->fragmentainerGroups()[m_currentFragmentainerGroupIndex]; |
| 101 } | 94 } |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 if (m_currentFragmentainerIndex < firstFragmentainerInClipRect) | 147 if (m_currentFragmentainerIndex < firstFragmentainerInClipRect) |
| 155 m_currentFragmentainerIndex = firstFragmentainerInClipRect; | 148 m_currentFragmentainerIndex = firstFragmentainerInClipRect; |
| 156 if (m_endFragmentainerIndex > lastFragmentainerInClipRect) | 149 if (m_endFragmentainerIndex > lastFragmentainerInClipRect) |
| 157 m_endFragmentainerIndex = lastFragmentainerInClipRect; | 150 m_endFragmentainerIndex = lastFragmentainerInClipRect; |
| 158 } | 151 } |
| 159 DCHECK(m_endFragmentainerIndex >= m_currentFragmentainerIndex); | 152 DCHECK(m_endFragmentainerIndex >= m_currentFragmentainerIndex); |
| 160 return true; | 153 return true; |
| 161 } | 154 } |
| 162 | 155 |
| 163 } // namespace blink | 156 } // namespace blink |
| OLD | NEW |