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

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

Issue 2575423003: Fix geometry mapping issues for float under inline (Closed)
Patch Set: SVG floating Created 3 years, 11 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/VisualRectMappingTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp b/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp
index d30549437c9a5e32e1bcc6f8804dc14375c299b2..0ff805205e4e663ff8374cd3d58dcc11c6488345 100644
--- a/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp
+++ b/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp
@@ -674,4 +674,30 @@ TEST_F(VisualRectMappingTest, ContainPaint) {
EXPECT_EQ(rect, target->visualRect());
}
+TEST_F(VisualRectMappingTest, FloatUnderInline) {
+ setBodyInnerHTML(
+ "<div style='position: absolute; top: 55px; left: 66px'>"
+ " <span id='span' style='position: relative; top: 100px; left: 200px'>"
+ " <div id='target' style='float: left; width: 33px; height: 44px'>"
+ " </div>"
+ " </span>"
+ "</div>");
+
+ LayoutBoxModelObject* span =
+ toLayoutBoxModelObject(getLayoutObjectByElementId("span"));
+ LayoutBox* target = toLayoutBox(getLayoutObjectByElementId("target"));
+
+ LayoutRect targetVisualRect = target->localVisualRect();
+ EXPECT_EQ(LayoutRect(0, 0, 33, 44), targetVisualRect);
+
+ LayoutRect rect = targetVisualRect;
+ EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect));
+ EXPECT_EQ(LayoutRect(66, 55, 33, 44), rect);
+ EXPECT_EQ(rect, target->visualRect());
+
+ rect = targetVisualRect;
+ EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(span, rect));
+ EXPECT_EQ(LayoutRect(-200, -100, 33, 44), rect);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698