Index: Source/core/layout/LayoutBoxModelObject.cpp |
diff --git a/Source/core/layout/LayoutBoxModelObject.cpp b/Source/core/layout/LayoutBoxModelObject.cpp |
index ee6b932bd7a3fddbe5e5b35f97bf8f4f80d70ee9..0448c8790af1dad4cc8fda83f54747bf43d1b4e9 100644 |
--- a/Source/core/layout/LayoutBoxModelObject.cpp |
+++ b/Source/core/layout/LayoutBoxModelObject.cpp |
@@ -788,14 +788,21 @@ void LayoutBoxModelObject::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, Tra |
if (!o) |
return; |
- if (o->isLayoutFlowThread()) |
- transformState.move(o->columnOffset(LayoutPoint(transformState.mappedPoint()))); |
- |
o->mapAbsoluteToLocalPoint(mode, transformState); |
LayoutSize containerOffset = offsetFromContainer(o, LayoutPoint()); |
- if (!style()->hasOutOfFlowPosition() && o->hasColumns()) { |
+ if (o->isLayoutFlowThread()) { |
+ // Descending into a flow thread. Convert to the local coordinate space, i.e. flow thread coordinates. |
+ const LayoutFlowThread* flowThread = toLayoutFlowThread(o); |
+ 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() |
Julien - ping for review
2015/03/25 21:41:32
What's preventing this change now? I was wondering
mstensho (USE GERRIT)
2015/03/25 22:35:05
offsetFromContainer() currently needs to perform t
Julien - ping for review
2015/03/26 15:38:56
It seems reasonable to let the callers do it. I se
|
+ // 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))); |
+ } else if (!style()->hasOutOfFlowPosition() && o->hasColumns()) { |
LayoutBlock* block = toLayoutBlock(o); |
LayoutPoint point(roundedLayoutPoint(transformState.mappedPoint())); |
point -= containerOffset; |