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

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

Issue 1024023002: [New Multicolumn] mapAbsoluteToLocalPoint() needs to convert to flow thread coordinates. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: code review - remove more cruft. 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 | « LayoutTests/fast/multicol/event-offset-expected.txt ('k') | Source/core/layout/LayoutFlowThread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
+ // 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;
« no previous file with comments | « LayoutTests/fast/multicol/event-offset-expected.txt ('k') | Source/core/layout/LayoutFlowThread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698