Index: third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp b/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp |
index 1e843382ff795cb3e5bb68a17f3df988c1596894..ea48c2380e124d0da0c44b8e16061b2ed5f886ba 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp |
@@ -302,12 +302,7 @@ LayoutUnit LayoutMultiColumnFlowThread::tallestUnbreakableLogicalHeight(LayoutUn |
LayoutSize LayoutMultiColumnFlowThread::columnOffset(const LayoutPoint& point) const |
{ |
- if (!hasValidColumnSetInfo()) |
- return LayoutSize(0, 0); |
- |
- LayoutPoint flowThreadPoint = flipForWritingMode(point); |
- LayoutUnit blockOffset = isHorizontalWritingMode() ? flowThreadPoint.y() : flowThreadPoint.x(); |
- return flowThreadTranslationAtOffset(blockOffset); |
+ return flowThreadTranslationAtPoint(point, CoordinateSpaceConversion::Containing); |
} |
bool LayoutMultiColumnFlowThread::needsNewWidth() const |
@@ -325,12 +320,26 @@ bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const |
return false; |
} |
-LayoutSize LayoutMultiColumnFlowThread::flowThreadTranslationAtOffset(LayoutUnit offsetInFlowThread) const |
+LayoutSize LayoutMultiColumnFlowThread::flowThreadTranslationAtOffset(LayoutUnit offsetInFlowThread, CoordinateSpaceConversion mode) const |
{ |
+ if (!hasValidColumnSetInfo()) |
+ return LayoutSize(0, 0); |
LayoutMultiColumnSet* columnSet = columnSetAtBlockOffset(offsetInFlowThread); |
if (!columnSet) |
return LayoutSize(0, 0); |
- return columnSet->flowThreadTranslationAtOffset(offsetInFlowThread); |
+ return columnSet->flowThreadTranslationAtOffset(offsetInFlowThread, mode); |
+} |
+ |
+LayoutSize LayoutMultiColumnFlowThread::flowThreadTranslationAtPoint(const LayoutPoint& flowThreadPoint, CoordinateSpaceConversion mode) const |
+{ |
+ LayoutPoint flippedPoint = flipForWritingMode(flowThreadPoint); |
+ LayoutUnit blockOffset = isHorizontalWritingMode() ? flippedPoint.y() : flippedPoint.x(); |
Xianzhu
2016/04/20 20:50:12
This CL also changes how we handle writing-mode in
mstensho (USE GERRIT)
2016/04/20 21:02:24
Yes, we have tests for multicol + writing modes, b
|
+ return flowThreadTranslationAtOffset(blockOffset, mode); |
+} |
+ |
+LayoutPoint LayoutMultiColumnFlowThread::flowThreadPointToVisualPoint(const LayoutPoint& flowThreadPoint) const |
+{ |
+ return flowThreadPoint + flowThreadTranslationAtPoint(flowThreadPoint, CoordinateSpaceConversion::Visual); |
} |
LayoutPoint LayoutMultiColumnFlowThread::visualPointToFlowThreadPoint(const LayoutPoint& visualPoint) const |