OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
10 * disclaimer. | 10 * disclaimer. |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 { | 109 { |
110 if (hitTestAction == HitTestBlockBackground) | 110 if (hitTestAction == HitTestBlockBackground) |
111 return false; | 111 return false; |
112 return LayoutBlockFlow::nodeAtPoint(result, locationInContainer, accumulated
Offset, hitTestAction); | 112 return LayoutBlockFlow::nodeAtPoint(result, locationInContainer, accumulated
Offset, hitTestAction); |
113 } | 113 } |
114 | 114 |
115 LayoutUnit LayoutFlowThread::pageLogicalHeightForOffset(LayoutUnit offset) | 115 LayoutUnit LayoutFlowThread::pageLogicalHeightForOffset(LayoutUnit offset) |
116 { | 116 { |
117 LayoutMultiColumnSet* columnSet = columnSetAtBlockOffset(offset); | 117 LayoutMultiColumnSet* columnSet = columnSetAtBlockOffset(offset); |
118 if (!columnSet) | 118 if (!columnSet) |
119 return 0; | 119 return LayoutUnit(); |
120 | 120 |
121 return columnSet->pageLogicalHeight(); | 121 return columnSet->pageLogicalHeightForOffset(offset); |
122 } | 122 } |
123 | 123 |
124 LayoutUnit LayoutFlowThread::pageRemainingLogicalHeightForOffset(LayoutUnit offs
et, PageBoundaryRule pageBoundaryRule) | 124 LayoutUnit LayoutFlowThread::pageRemainingLogicalHeightForOffset(LayoutUnit offs
et, PageBoundaryRule pageBoundaryRule) |
125 { | 125 { |
126 LayoutMultiColumnSet* columnSet = columnSetAtBlockOffset(offset); | 126 LayoutMultiColumnSet* columnSet = columnSetAtBlockOffset(offset); |
127 if (!columnSet) | 127 if (!columnSet) |
128 return 0; | 128 return LayoutUnit(); |
129 | 129 |
130 LayoutUnit pageLogicalTop = columnSet->pageLogicalTopForOffset(offset); | 130 return columnSet->pageRemainingLogicalHeightForOffset(offset, pageBoundaryRu
le); |
131 LayoutUnit pageLogicalHeight = columnSet->pageLogicalHeight(); | |
132 LayoutUnit pageLogicalBottom = pageLogicalTop + pageLogicalHeight; | |
133 LayoutUnit remainingHeight = pageLogicalBottom - offset; | |
134 if (pageBoundaryRule == IncludePageBoundary) { | |
135 // If IncludePageBoundary is set, the line exactly on the top edge of a | |
136 // columnSet will act as being part of the previous columnSet. | |
137 remainingHeight = intMod(remainingHeight, pageLogicalHeight); | |
138 } | |
139 return remainingHeight; | |
140 } | 131 } |
141 | 132 |
142 void LayoutFlowThread::generateColumnSetIntervalTree() | 133 void LayoutFlowThread::generateColumnSetIntervalTree() |
143 { | 134 { |
144 // FIXME: Optimize not to clear the interval all the time. This implies manu
ally managing the tree nodes lifecycle. | 135 // FIXME: Optimize not to clear the interval all the time. This implies manu
ally managing the tree nodes lifecycle. |
145 m_multiColumnSetIntervalTree.clear(); | 136 m_multiColumnSetIntervalTree.clear(); |
146 m_multiColumnSetIntervalTree.initIfNeeded(); | 137 m_multiColumnSetIntervalTree.initIfNeeded(); |
147 for (auto columnSet : m_multiColumnSetList) | 138 for (auto columnSet : m_multiColumnSetList) |
148 m_multiColumnSetIntervalTree.add(MultiColumnSetIntervalTree::createInter
val(columnSet->logicalTopInFlowThread(), columnSet->logicalBottomInFlowThread(),
columnSet)); | 139 m_multiColumnSetIntervalTree.add(MultiColumnSetIntervalTree::createInter
val(columnSet->logicalTopInFlowThread(), columnSet->logicalBottomInFlowThread(),
columnSet)); |
149 } | 140 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 173 |
183 void LayoutFlowThread::MultiColumnSetSearchAdapter::collectIfNeeded(const MultiC
olumnSetInterval& interval) | 174 void LayoutFlowThread::MultiColumnSetSearchAdapter::collectIfNeeded(const MultiC
olumnSetInterval& interval) |
184 { | 175 { |
185 if (m_result) | 176 if (m_result) |
186 return; | 177 return; |
187 if (interval.low() <= m_offset && interval.high() > m_offset) | 178 if (interval.low() <= m_offset && interval.high() > m_offset) |
188 m_result = interval.data(); | 179 m_result = interval.data(); |
189 } | 180 } |
190 | 181 |
191 } // namespace blink | 182 } // namespace blink |
OLD | NEW |