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

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

Issue 2575423003: Fix geometry mapping issues for float under inline (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/VisualRectMappingTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp b/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp
index c3d7eef11ca1e6626ed3c0c89ee9a7d33aaaf96d..b840954de4c484754d2afb9cb278a31ad4341455 100644
--- a/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp
+++ b/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp
@@ -697,4 +697,22 @@ TEST_F(VisualRectMappingTest, ContainPaint) {
layoutView(), layoutView());
}
+TEST_F(VisualRectMappingTest, FloatUnderInline) {
+ setBodyInnerHTML(
+ "<span style='position: relative; top: 100px; left: 200px'>"
+ " <div id='target' style='float: left; width: 33px; height: 44px'>"
+ " </div>"
+ "</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(8, 8, 33, 44), rect);
chrishtr 2016/12/16 22:10:30 add * { margin: 0 } to get rid of the 8px
Xianzhu 2016/12/17 05:43:18 Added an position:absolute container to test we ac
+ checkPaintInvalidationStateRectMapping(rect, targetVisualRect, *target,
+ layoutView(), layoutView());
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698