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

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

Issue 1459943002: Clip abspos descendants correctly in all columns (not just the first). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review - possible alternative Created 5 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/LayoutBoxModelObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
index 0c7af6cbd0553824d52db1650f1c05ee4ec47012..bec27d1daef4dee160b2662a19ddab36e1465c99 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
@@ -941,18 +941,25 @@ void LayoutBoxModelObject::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, Tra
o->mapAbsoluteToLocalPoint(mode, transformState);
- LayoutSize containerOffset = offsetFromContainer(o, LayoutPoint());
+ LayoutSize containerOffset;
- if (o->isLayoutFlowThread()) {
+ if (isLayoutFlowThread()) {
// Descending into a flow thread. Convert to the local coordinate space, i.e. flow thread coordinates.
- const LayoutFlowThread* flowThread = toLayoutFlowThread(o);
+ const LayoutFlowThread* flowThread = toLayoutFlowThread(this);
LayoutPoint visualPoint = LayoutPoint(transformState.mappedPoint());
transformState.move(visualPoint - flowThread->visualPointToFlowThreadPoint(visualPoint));
- // |containerOffset| is also in visual coordinates. Convert to flow thread coordinates.
- // TODO(mstensho): Wouldn't it be better add a parameter to instruct offsetFromContainer()
- // to return flowthread coordinates in the first place? We're effectively performing two
- // conversions here, when in fact none is needed.
- containerOffset = toLayoutSize(flowThread->visualPointToFlowThreadPoint(toLayoutPoint(containerOffset)));
+ // TODO(mstensho): Get rid of this special calculation of |containerOffset|. We cannot use
+ // offsetFromContainer() at the moment, because it converts from flow thread coordinates to
+ // visual coordinates. That's a reasonable thing to do when walking *upwards* in the tree,
+ // when leaving the flow thread coordinate space and the multicol container on our way
+ // up. But when walking downwards (like here), we don't want that. So this isn't really a
chrishtr 2015/12/14 21:39:51 Why is it generally not desired to adjust when wal
mstensho (USE GERRIT) 2016/01/05 08:55:25 When walking downwards into a multicol container,
+ // conversion job best done in offsetFromContainer() (it's there just to avoid massive code
+ // duplication). It's possible to get rid of it cleanly, but it requires some refactoring
+ // of mapLocalToContainer() and its neighborhood, which is really the only place where we
+ // want the flowthread-to-visual conversion.
+ containerOffset = flowThread->topLeftLocationOffset();
+ } else {
+ containerOffset = offsetFromContainer(o, LayoutPoint());
}
bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || style()->preserves3D());

Powered by Google App Engine
This is Rietveld 408576698