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

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

Issue 1907443003: Translate flow thread coords to the nearest enclosing coord space when appropriate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a unit test too. Created 4 years, 8 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
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

Powered by Google App Engine
This is Rietveld 408576698