Chromium Code Reviews| 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 |