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

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

Issue 2590463002: Make column snapping optional when translating to flow thread coordinates. (Closed)
Patch Set: Created 4 years 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/MapCoordinatesTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp b/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp
index 7da58039aeb383ae9c5625d15a8b798037b3916a..4ceb94b28a441d9e61fe626f2dd6b0c26dc6c305 100644
--- a/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp
+++ b/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp
@@ -855,6 +855,36 @@ TEST_P(MapCoordinatesTest, MulticolWithBlock) {
EXPECT_EQ(FloatPoint(10, 120), mappedPoint);
}
+TEST_P(MapCoordinatesTest, MulticolWithBlockAbove) {
+ setBodyInnerHTML(
+ "<div id='container' style='columns:3; column-gap:0; "
+ "column-fill:auto; width:300px; height:200px;'>"
+ " <div id='target' style='margin-top:-50px; height:100px;'></div>"
+ "</div>");
+
+ LayoutBox* target = toLayoutBox(getLayoutObjectByElementId("target"));
+ LayoutBox* container = toLayoutBox(getLayoutObjectByElementId("container"));
+
+ FloatPoint mappedPoint = mapLocalToAncestor(target, container, FloatPoint());
+ EXPECT_EQ(FloatPoint(0, -50), mappedPoint);
+ mappedPoint = mapAncestorToLocal(target, container, mappedPoint);
+ EXPECT_EQ(FloatPoint(), mappedPoint);
+
+ // Walk each ancestor in the chain separately, to verify each step on the way.
+ LayoutBox* flowThread = target->parentBox();
+ ASSERT_TRUE(flowThread->isLayoutFlowThread());
+
+ mappedPoint = mapLocalToAncestor(target, flowThread, FloatPoint());
+ EXPECT_EQ(FloatPoint(0, -50), mappedPoint);
+ mappedPoint = mapAncestorToLocal(target, flowThread, mappedPoint);
+ EXPECT_EQ(FloatPoint(), mappedPoint);
+
+ mappedPoint = mapLocalToAncestor(flowThread, container, FloatPoint(0, -50));
+ EXPECT_EQ(FloatPoint(0, -50), mappedPoint);
+ mappedPoint = mapAncestorToLocal(flowThread, container, mappedPoint);
+ EXPECT_EQ(FloatPoint(0, -50), mappedPoint);
+}
+
TEST_P(MapCoordinatesTest, NestedMulticolWithBlock) {
setBodyInnerHTML(
"<div id='outerMulticol' style='columns:2; column-gap:0; "

Powered by Google App Engine
This is Rietveld 408576698