Chromium Code Reviews| 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..bdd1b420752905914632dc80a1250697276b2af8 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp |
| @@ -64,10 +64,15 @@ 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(); |
| + 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(); |
|
eae
2016/04/22 19:35:39
Do we need to assert that there is at least one en
mstensho (USE GERRIT)
2016/04/22 19:46:00
I was thinking that it really shouldn't be necessa
|
| } |
| LayoutUnit LayoutMultiColumnSet::pageLogicalHeightForOffset(LayoutUnit offsetInFlowThread) const |