Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(578)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp

Issue 1919453002: Support for mapping from outer/visual to flowthread coord space in nested multicol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add assert. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698