Index: third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp b/third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp |
index 913047561c4eb51a5f1f050d837115a10e4b89db..14764611710119273d427dfd6c76959c9aaba8fc 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp |
@@ -64,10 +64,16 @@ unsigned LayoutMultiColumnSet::fragmentainerGroupIndexAtFlowThreadOffset(LayoutU |
return m_fragmentainerGroups.size() - 1; |
} |
-const MultiColumnFragmentainerGroup& LayoutMultiColumnSet::fragmentainerGroupAtVisualPoint(const LayoutPoint&) const |
+const MultiColumnFragmentainerGroup& LayoutMultiColumnSet::fragmentainerGroupAtVisualPoint(const LayoutPoint& visualPoint) const |
{ |
- // FIXME: implement this, once we have support for multiple rows. |
- return m_fragmentainerGroups.first(); |
+ ASSERT(m_fragmentainerGroups.size() > 0); |
+ LayoutUnit blockOffset = isHorizontalWritingMode() ? visualPoint.y() : visualPoint.x(); |
+ for (unsigned index = 0; index < m_fragmentainerGroups.size(); index++) { |
+ const auto& row = m_fragmentainerGroups[index]; |
+ if (row.logicalTop() + row.logicalHeight() > blockOffset) |
+ return row; |
+ } |
+ return m_fragmentainerGroups.last(); |
} |
LayoutUnit LayoutMultiColumnSet::pageLogicalHeightForOffset(LayoutUnit offsetInFlowThread) const |