Index: Source/core/layout/MultiColumnFragmentainerGroup.cpp |
diff --git a/Source/core/layout/MultiColumnFragmentainerGroup.cpp b/Source/core/layout/MultiColumnFragmentainerGroup.cpp |
index 12e4cb0f45a5f463fceb12c834dd0cce5e81a944..668ca251716199381f8c1a5f403b4e417ea6aacf 100644 |
--- a/Source/core/layout/MultiColumnFragmentainerGroup.cpp |
+++ b/Source/core/layout/MultiColumnFragmentainerGroup.cpp |
@@ -175,6 +175,37 @@ LayoutPoint MultiColumnFragmentainerGroup::visualPointToFlowThreadPoint(const La |
return LayoutPoint(localPoint.x(), localPoint.y() + logicalTopInFlowThreadAt(columnIndex)); |
} |
+LayoutRect MultiColumnFragmentainerGroup::fragmentsBoundingBox(const LayoutRect& boundingBoxInFlowThread) const |
+{ |
+ // Find the start and end column intersected by the bounding box. |
+ LayoutRect flippedBoundingBoxInFlowThread(boundingBoxInFlowThread); |
+ LayoutFlowThread* flowThread = m_columnSet.flowThread(); |
+ flowThread->flipForWritingMode(flippedBoundingBoxInFlowThread); |
+ bool isHorizontalWritingMode = m_columnSet.isHorizontalWritingMode(); |
+ LayoutUnit boundingBoxLogicalTop = isHorizontalWritingMode ? flippedBoundingBoxInFlowThread.y() : flippedBoundingBoxInFlowThread.x(); |
+ LayoutUnit boundingBoxLogicalBottom = isHorizontalWritingMode ? flippedBoundingBoxInFlowThread.maxY() : flippedBoundingBoxInFlowThread.maxX(); |
+ if (boundingBoxLogicalBottom <= logicalTopInFlowThread() || boundingBoxLogicalTop >= logicalBottomInFlowThread()) |
+ return LayoutRect(); // The bounding box doesn't intersect this fragmentainer group. |
+ unsigned startColumn; |
+ unsigned endColumn; |
+ columnIntervalForBlockRangeInFlowThread(boundingBoxLogicalTop, boundingBoxLogicalBottom, startColumn, endColumn); |
+ |
+ LayoutRect startColumnFlowThreadOverflowPortion = flowThreadPortionOverflowRectAt(startColumn); |
+ flowThread->flipForWritingMode(startColumnFlowThreadOverflowPortion); |
+ LayoutRect startColumnRect(boundingBoxInFlowThread); |
+ startColumnRect.intersect(startColumnFlowThreadOverflowPortion); |
+ startColumnRect.move(flowThreadTranslationAtOffset(logicalTopInFlowThreadAt(startColumn))); |
+ if (startColumn == endColumn) |
+ return startColumnRect; // It all takes place in one column. We're done. |
+ |
+ LayoutRect endColumnFlowThreadOverflowPortion = flowThreadPortionOverflowRectAt(endColumn); |
+ flowThread->flipForWritingMode(endColumnFlowThreadOverflowPortion); |
+ LayoutRect endColumnRect(boundingBoxInFlowThread); |
+ endColumnRect.intersect(endColumnFlowThreadOverflowPortion); |
+ endColumnRect.move(flowThreadTranslationAtOffset(logicalTopInFlowThreadAt(endColumn))); |
+ return unionRect(startColumnRect, endColumnRect); |
+} |
+ |
void MultiColumnFragmentainerGroup::collectLayerFragments(DeprecatedPaintLayerFragments& fragments, const LayoutRect& layerBoundingBox, const LayoutRect& dirtyRect) const |
{ |
// |layerBoundingBox| is in the flow thread coordinate space, relative to the top/left edge of |