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

Unified Diff: third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h

Issue 2590463002: Make column snapping optional when translating to flow thread coordinates. (Closed)
Patch Set: Created 4 years 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/MultiColumnFragmentainerGroup.h
diff --git a/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h b/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h
index bb625deba6b8a4cb6937f3cabc59d3e5c4f364ee..5fdf64021d83428f969a5639e69a8bd2e3138ecf 100644
--- a/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h
+++ b/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h
@@ -79,8 +79,21 @@ class MultiColumnFragmentainerGroup {
LayoutBox::PageBoundaryRule,
CoordinateSpaceConversion) const;
LayoutUnit columnLogicalTopForOffset(LayoutUnit offsetInFlowThread) const;
+
+ // If SnapToColumnPolicy is SnapToColumn, visualPointToFlowThreadPoint() won't
+ // return points that lie outside the bounds of the columns: Before converting
+ // to a flow thread position, if the block direction coordinate is outside the
+ // column, snap to the bounds of the column, and reset the inline direction
+ // coordinate to the start position in the column. The effect of this is that
+ // if the block position is before the column rectangle, we'll get to the
+ // beginning of this column, while if the block position is after the column
+ // rectangle, we'll get to the beginning of the next column. This is behavior
+ // that positionForPoint() depends on.
+ enum SnapToColumnPolicy { DontSnapToColumn, SnapToColumn };
szager1 2016/12/19 23:36:44 nit: I prefer not to define an enum for what is ef
mstensho (USE GERRIT) 2016/12/20 08:55:02 A long time ago I learned that this was how to do
LayoutPoint visualPointToFlowThreadPoint(
- const LayoutPoint& visualPoint) const;
+ const LayoutPoint& visualPoint,
+ SnapToColumnPolicy = DontSnapToColumn) const;
szager1 2016/12/19 23:36:44 It's a bit strange that the default value doesn't
mstensho (USE GERRIT) 2016/12/20 08:55:02 This is exactly what I wanted. The previous behavi
+
LayoutRect fragmentsBoundingBox(
const LayoutRect& boundingBoxInFlowThread) const;

Powered by Google App Engine
This is Rietveld 408576698