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

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

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.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.h b/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.h
index a2403ee083d38f0fb21ccff0ae7fb2cbbd6b47e0..fa794bcb1027b6f451919958ce82ea0efd693570 100644
--- a/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.h
+++ b/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.h
@@ -36,6 +36,16 @@ namespace blink {
class LayoutMultiColumnSet;
class LayoutMultiColumnSpannerPlaceholder;
+// What to translate *to* when translating from a flow thread coordinate space.
+enum class CoordinateSpaceConversion {
+ // Just translate to the nearest containing coordinate space (i.e. where our multicol container
+ // lives) of this flow thread, i.e. don't walk ancestral flow threads, if any.
+ Containing,
+
+ // Translate to visual coordinates, by walking all ancestral flow threads.
+ Visual
+};
+
// Flow thread implementation for CSS multicol. This will be inserted as an anonymous child block of
// the actual multicol container (i.e. the LayoutBlockFlow whose style computes to non-auto
// column-count and/or column-width). LayoutMultiColumnFlowThread is the heart of the multicol
@@ -181,8 +191,10 @@ public:
bool isPageLogicalHeightKnown() const final;
- LayoutSize flowThreadTranslationAtOffset(LayoutUnit) const;
+ LayoutSize flowThreadTranslationAtOffset(LayoutUnit, CoordinateSpaceConversion) const;
+ LayoutSize flowThreadTranslationAtPoint(const LayoutPoint& flowThreadPoint, CoordinateSpaceConversion) const;
+ LayoutPoint flowThreadPointToVisualPoint(const LayoutPoint& flowThreadPoint) const override;
LayoutPoint visualPointToFlowThreadPoint(const LayoutPoint& visualPoint) const override;
int inlineBlockBaseline(LineDirectionMode) const override;

Powered by Google App Engine
This is Rietveld 408576698