Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: third_party/WebKit/Source/core/layout/FragmentainerIterator.cpp

Issue 2339973002: Handle exclusive end offsets when translating from flow thread coordinates. (Closed)
Patch Set: Documentation Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 const MultiColumnFragmentainerGroup& group = currentGroup(); 96 const MultiColumnFragmentainerGroup& group = currentGroup();
97 97
98 // Figure out the start and end fragmentainers for the block range we're int erested in. We 98 // Figure out the start and end fragmentainers for the block range we're int erested in. We
99 // might not have to walk the entire fragmentainer group. 99 // might not have to walk the entire fragmentainer group.
100 group.columnIntervalForBlockRangeInFlowThread(m_logicalTopInFlowThread, m_lo gicalBottomInFlowThread, m_currentFragmentainerIndex, m_endFragmentainerIndex); 100 group.columnIntervalForBlockRangeInFlowThread(m_logicalTopInFlowThread, m_lo gicalBottomInFlowThread, m_currentFragmentainerIndex, m_endFragmentainerIndex);
101 101
102 // Now intersect with the fragmentainers that actually intersect with the vi sual clip rect, to 102 // Now intersect with the fragmentainers that actually intersect with the vi sual clip rect, to
103 // narrow it down even further. The clip rect needs to be relative to the cu rrent fragmentainer 103 // narrow it down even further. The clip rect needs to be relative to the cu rrent fragmentainer
104 // group. 104 // group.
105 LayoutRect clipRect = m_clipRectInMulticolContainer; 105 LayoutRect clipRect = m_clipRectInMulticolContainer;
106 LayoutSize offset = group.flowThreadTranslationAtOffset(group.logicalTopInFl owThread(), CoordinateSpaceConversion::Visual); 106 LayoutSize offset = group.flowThreadTranslationAtOffset(group.logicalTopInFl owThread(), LayoutBox::AssociateWithFormerPage, CoordinateSpaceConversion::Visua l);
107 clipRect.move(-offset); 107 clipRect.move(-offset);
108 unsigned firstFragmentainerInClipRect, lastFragmentainerInClipRect; 108 unsigned firstFragmentainerInClipRect, lastFragmentainerInClipRect;
109 group.columnIntervalForVisualRect(clipRect, firstFragmentainerInClipRect, la stFragmentainerInClipRect); 109 group.columnIntervalForVisualRect(clipRect, firstFragmentainerInClipRect, la stFragmentainerInClipRect);
110 // If the two fragmentainer intervals are disjoint, there's nothing of inter est in this 110 // If the two fragmentainer intervals are disjoint, there's nothing of inter est in this
111 // fragmentainer group. 111 // fragmentainer group.
112 if (firstFragmentainerInClipRect > m_endFragmentainerIndex || lastFragmentai nerInClipRect < m_currentFragmentainerIndex) 112 if (firstFragmentainerInClipRect > m_endFragmentainerIndex || lastFragmentai nerInClipRect < m_currentFragmentainerIndex)
113 return false; 113 return false;
114 if (m_currentFragmentainerIndex < firstFragmentainerInClipRect) 114 if (m_currentFragmentainerIndex < firstFragmentainerInClipRect)
115 m_currentFragmentainerIndex = firstFragmentainerInClipRect; 115 m_currentFragmentainerIndex = firstFragmentainerInClipRect;
116 if (m_endFragmentainerIndex > lastFragmentainerInClipRect) 116 if (m_endFragmentainerIndex > lastFragmentainerInClipRect)
117 m_endFragmentainerIndex = lastFragmentainerInClipRect; 117 m_endFragmentainerIndex = lastFragmentainerInClipRect;
118 DCHECK(m_endFragmentainerIndex >= m_currentFragmentainerIndex); 118 DCHECK(m_endFragmentainerIndex >= m_currentFragmentainerIndex);
119 return true; 119 return true;
120 } 120 }
121 121
122 void FragmentainerIterator::updateOutput() 122 void FragmentainerIterator::updateOutput()
123 { 123 {
124 const MultiColumnFragmentainerGroup& group = currentGroup(); 124 const MultiColumnFragmentainerGroup& group = currentGroup();
125 125
126 // Set the physical translation offset. 126 // Set the physical translation offset.
127 LayoutUnit fragmentainerLogicalTopInFlowThread = group.logicalTopInFlowThrea d() + m_currentFragmentainerIndex * group.logicalHeight(); 127 LayoutUnit fragmentainerLogicalTopInFlowThread = group.logicalTopInFlowThrea d() + m_currentFragmentainerIndex * group.logicalHeight();
128 m_paginationOffset = group.flowThreadTranslationAtOffset(fragmentainerLogica lTopInFlowThread, CoordinateSpaceConversion::Visual); 128 m_paginationOffset = group.flowThreadTranslationAtOffset(fragmentainerLogica lTopInFlowThread, LayoutBox::AssociateWithLatterPage, CoordinateSpaceConversion: :Visual);
129 129
130 // Set the overflow clip rect that corresponds to the fragmentainer. 130 // Set the overflow clip rect that corresponds to the fragmentainer.
131 m_clipRectInFlowThread = group.flowThreadPortionOverflowRectAt(m_currentFrag mentainerIndex); 131 m_clipRectInFlowThread = group.flowThreadPortionOverflowRectAt(m_currentFrag mentainerIndex);
132 132
133 // Flip it into a physical rectangle. 133 // Flip it into a physical rectangle.
134 m_flowThread.flipForWritingMode(m_clipRectInFlowThread); 134 m_flowThread.flipForWritingMode(m_clipRectInFlowThread);
135 } 135 }
136 136
137 } // namespace blink 137 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698