Index: Source/core/layout/LayoutBoxModelObject.cpp |
diff --git a/Source/core/layout/LayoutBoxModelObject.cpp b/Source/core/layout/LayoutBoxModelObject.cpp |
index 0ede20bb48886f0899303a9591bdc06d1a5b0dd6..6beec09b373f5b2846152a59bf4fedb5b843eb08 100644 |
--- a/Source/core/layout/LayoutBoxModelObject.cpp |
+++ b/Source/core/layout/LayoutBoxModelObject.cpp |
@@ -849,6 +849,14 @@ LayoutRect LayoutBoxModelObject::localCaretRectForEmptyElement(LayoutUnit width, |
return currentStyle.isHorizontalWritingMode() ? LayoutRect(x, y, caretWidth(), height) : LayoutRect(y, x, height, caretWidth()); |
} |
+LayoutSize LayoutBoxModelObject::offsetFromContainer(const LayoutObject* o) const |
+{ |
+ LayoutSize offset; |
+ if (isRelPositioned()) |
+ offset += offsetForInFlowPosition(); |
+ return offset + LayoutObject::offsetFromContainer(o); |
+} |
+ |
void LayoutBoxModelObject::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformState& transformState) const |
{ |
LayoutObject* o = container(); |
@@ -857,20 +865,7 @@ void LayoutBoxModelObject::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, Tra |
o->mapAbsoluteToLocalPoint(mode, transformState); |
- LayoutSize containerOffset = offsetFromContainer(o, LayoutPoint()); |
- |
- 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() |
- // 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))); |
- } |
- |
+ LayoutSize containerOffset = offsetFromContainer(o); |
bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || style()->preserves3D()); |
if (mode & UseTransforms && shouldUseTransformFromContainer(o)) { |
TransformationMatrix t; |
@@ -901,8 +896,9 @@ const LayoutObject* LayoutBoxModelObject::pushMappingToContainer(const LayoutBox |
adjustmentForSkippedAncestor = -ancestorToStopAt->offsetFromAncestorContainer(container); |
} |
- bool offsetDependsOnPoint = false; |
- LayoutSize containerOffset = offsetFromContainer(container, LayoutPoint(), &offsetDependsOnPoint); |
+ bool offsetDependsOnPoint = container->isBox() && (container->style()->isFlippedBlocksWritingMode() || container->isLayoutFlowThread()); |
+ LayoutSize containerOffset = offsetFromContainer(container); |
+ containerOffset += container->columnOffset(toLayoutPoint(containerOffset)); |
bool preserve3D = container->style()->preserves3D() || style()->preserves3D(); |
if (shouldUseTransformFromContainer(container)) { |