Index: Source/core/layout/MultiColumnFragmentainerGroup.cpp |
diff --git a/Source/core/layout/MultiColumnFragmentainerGroup.cpp b/Source/core/layout/MultiColumnFragmentainerGroup.cpp |
index abcd82192dd31de49a3ea03573d2613264d86667..12e4cb0f45a5f463fceb12c834dd0cce5e81a944 100644 |
--- a/Source/core/layout/MultiColumnFragmentainerGroup.cpp |
+++ b/Source/core/layout/MultiColumnFragmentainerGroup.cpp |
@@ -207,12 +207,13 @@ void MultiColumnFragmentainerGroup::collectLayerFragments(DeprecatedPaintLayerFr |
// Now we know we intersect at least one column. Let's figure out the logical top and logical |
// bottom of the area we're checking. |
LayoutUnit layerLogicalTop = isHorizontalWritingMode ? layerBoundsInFlowThread.y() : layerBoundsInFlowThread.x(); |
- LayoutUnit layerLogicalBottom = (isHorizontalWritingMode ? layerBoundsInFlowThread.maxY() : layerBoundsInFlowThread.maxX()) - 1; |
+ LayoutUnit layerLogicalBottom = (isHorizontalWritingMode ? layerBoundsInFlowThread.maxY() : layerBoundsInFlowThread.maxX()); |
// Figure out the start and end columns for the layer and only check within that range so that |
// we don't walk the entire column row. |
- unsigned startColumn = columnIndexAtOffset(layerLogicalTop); |
- unsigned endColumn = columnIndexAtOffset(layerLogicalBottom); |
+ unsigned startColumn; |
+ unsigned endColumn; |
+ columnIntervalForBlockRangeInFlowThread(layerLogicalTop, layerLogicalBottom, startColumn, endColumn); |
// Now intersect with the columns actually occupied by the dirty rect, to narrow it down even further. |
unsigned firstColumnInDirtyRect, lastColumnInDirtyRect; |
@@ -513,6 +514,16 @@ unsigned MultiColumnFragmentainerGroup::columnIndexAtVisualPoint(const LayoutPoi |
return std::min(unsigned(index), actualColumnCount() - 1); |
} |
+void MultiColumnFragmentainerGroup::columnIntervalForBlockRangeInFlowThread(LayoutUnit logicalTopInFlowThread, LayoutUnit logicalBottomInFlowThread, unsigned& firstColumn, unsigned& lastColumn) const |
+{ |
+ ASSERT(logicalTopInFlowThread <= logicalBottomInFlowThread); |
+ firstColumn = columnIndexAtOffset(logicalTopInFlowThread); |
+ lastColumn = columnIndexAtOffset(logicalBottomInFlowThread); |
+ // logicalBottomInFlowThread is an exclusive endpoint, so some additional adjustments may be necessary. |
+ if (lastColumn > firstColumn && logicalTopInFlowThreadAt(lastColumn) == logicalBottomInFlowThread) |
+ lastColumn--; |
+} |
+ |
void MultiColumnFragmentainerGroup::columnIntervalForVisualRect(const LayoutRect& rect, unsigned& firstColumn, unsigned& lastColumn) const |
{ |
bool isColumnProgressionInline = m_columnSet.multiColumnFlowThread()->progressionIsInline(); |