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

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

Issue 978603003: [New Multicolumn] Make positionForPoint() work. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: More tests Created 5 years, 9 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
« no previous file with comments | « Source/core/layout/LayoutMultiColumnSet.h ('k') | Source/core/layout/MultiColumnFragmentainerGroup.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutMultiColumnSet.cpp
diff --git a/Source/core/layout/LayoutMultiColumnSet.cpp b/Source/core/layout/LayoutMultiColumnSet.cpp
index 54f8af4520021e936bdacd86e8d0b160f55c23ce..d8c8f0fe9092b401a37856ee530d11e3bbbcf4aa 100644
--- a/Source/core/layout/LayoutMultiColumnSet.cpp
+++ b/Source/core/layout/LayoutMultiColumnSet.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "core/layout/LayoutMultiColumnSet.h"
+#include "core/editing/PositionWithAffinity.h"
#include "core/layout/LayoutMultiColumnFlowThread.h"
#include "core/layout/MultiColumnFragmentainerGroup.h"
#include "core/paint/MultiColumnSetPainter.h"
@@ -59,6 +60,12 @@ const MultiColumnFragmentainerGroup& LayoutMultiColumnSet::fragmentainerGroupAtF
return m_fragmentainerGroups.first();
}
+const MultiColumnFragmentainerGroup& LayoutMultiColumnSet::fragmentainerGroupAtVisualPoint(const LayoutPoint&) const
+{
+ // FIXME: implement this, once we have support for multiple rows.
+ return m_fragmentainerGroups.first();
+}
+
LayoutUnit LayoutMultiColumnSet::pageLogicalHeight() const
{
// FIXME: pageLogicalHeight() needs to take a flow thread offset parameter, so that we can
@@ -185,6 +192,15 @@ void LayoutMultiColumnSet::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTo
computedValues.m_position = logicalTop;
}
+PositionWithAffinity LayoutMultiColumnSet::positionForPoint(const LayoutPoint& point)
+{
+ // Convert the visual point to a flow thread point.
+ const MultiColumnFragmentainerGroup& row = fragmentainerGroupAtVisualPoint(point);
+ LayoutPoint flowThreadPoint = row.visualPointToFlowThreadPoint(point + row.offsetFromColumnSet());
+ // Then drill into the flow thread, where we'll find the actual content.
+ return flowThread()->positionForPoint(flowThreadPoint);
+}
+
LayoutUnit LayoutMultiColumnSet::columnGap() const
{
LayoutBlockFlow* parentBlock = multiColumnBlockFlow();
« no previous file with comments | « Source/core/layout/LayoutMultiColumnSet.h ('k') | Source/core/layout/MultiColumnFragmentainerGroup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698