| Index: third_party/WebKit/Source/core/paint/PaintLayerTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp
|
| index 4110eb4a717474368ff429bef64c8cc53787954b..cd0650bf043daab0f64126fb60cf1301255bf2f5 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp
|
| @@ -590,6 +590,83 @@ TEST_P(PaintLayerTest, FloatLayerUnderBlockUnderInlineLayer) {
|
| document().layoutView()->layer()));
|
| }
|
|
|
| +TEST_P(PaintLayerTest, FloatLayerUnderFloatUnderInlineLayer) {
|
| + setBodyInnerHTML(
|
| + "<style>body {margin: 0}</style>"
|
| + "<span id='span' style='position: relative; top: 100px; left: 100px'>"
|
| + " <div style='float: left; margin: 33px'>"
|
| + " <div id='floating'"
|
| + " style='float: left; position: relative; top: 50px; left: 50px'>"
|
| + " </div>"
|
| + " </div>"
|
| + "</span>");
|
| +
|
| + PaintLayer* floating =
|
| + toLayoutBoxModelObject(getLayoutObjectByElementId("floating"))->layer();
|
| + PaintLayer* span =
|
| + toLayoutBoxModelObject(getLayoutObjectByElementId("span"))->layer();
|
| +
|
| + EXPECT_EQ(LayoutPoint(83, 83), floating->location());
|
| + EXPECT_EQ(LayoutPoint(100, 100), span->location());
|
| + EXPECT_EQ(LayoutPoint(-17, -17), floating->visualOffsetFromAncestor(span));
|
| + EXPECT_EQ(LayoutPoint(83, 83), floating->visualOffsetFromAncestor(
|
| + document().layoutView()->layer()));
|
| +}
|
| +
|
| +TEST_P(PaintLayerTest, FloatLayerUnderFloatLayerUnderInlineLayer) {
|
| + setBodyInnerHTML(
|
| + "<style>body {margin: 0}</style>"
|
| + "<span id='span' style='position: relative; top: 100px; left: 100px'>"
|
| + " <div id='floatingParent'"
|
| + " style='float: left; position: relative; margin: 33px'>"
|
| + " <div id='floating'"
|
| + " style='float: left; position: relative; top: 50px; left: 50px'>"
|
| + " </div>"
|
| + " </div>"
|
| + "</span>");
|
| +
|
| + PaintLayer* floating =
|
| + toLayoutBoxModelObject(getLayoutObjectByElementId("floating"))->layer();
|
| + PaintLayer* floatingParent =
|
| + toLayoutBoxModelObject(getLayoutObjectByElementId("floatingParent"))
|
| + ->layer();
|
| + PaintLayer* span =
|
| + toLayoutBoxModelObject(getLayoutObjectByElementId("span"))->layer();
|
| +
|
| + EXPECT_EQ(LayoutPoint(50, 50), floating->location());
|
| + EXPECT_EQ(LayoutPoint(33, 33), floatingParent->location());
|
| + EXPECT_EQ(LayoutPoint(100, 100), span->location());
|
| + EXPECT_EQ(LayoutPoint(-17, -17), floating->visualOffsetFromAncestor(span));
|
| + EXPECT_EQ(LayoutPoint(-67, -67),
|
| + floatingParent->visualOffsetFromAncestor(span));
|
| + EXPECT_EQ(LayoutPoint(83, 83), floating->visualOffsetFromAncestor(
|
| + document().layoutView()->layer()));
|
| +}
|
| +
|
| +TEST_P(PaintLayerTest, LayerUnderFloatUnderInlineLayer) {
|
| + setBodyInnerHTML(
|
| + "<style>body {margin: 0}</style>"
|
| + "<span id='span' style='position: relative; top: 100px; left: 100px'>"
|
| + " <div style='float: left; margin: 33px'>"
|
| + " <div>"
|
| + " <div id='child' style='position: relative; top: 50px; left: 50px'>"
|
| + " </div>"
|
| + " </div>"
|
| + " </div>"
|
| + "</span>");
|
| +
|
| + PaintLayer* child =
|
| + toLayoutBoxModelObject(getLayoutObjectByElementId("child"))->layer();
|
| + PaintLayer* span =
|
| + toLayoutBoxModelObject(getLayoutObjectByElementId("span"))->layer();
|
| +
|
| + EXPECT_EQ(LayoutPoint(83, 83), child->location());
|
| + EXPECT_EQ(LayoutPoint(100, 100), span->location());
|
| + EXPECT_EQ(LayoutPoint(-17, -17), child->visualOffsetFromAncestor(span));
|
| + EXPECT_EQ(LayoutPoint(83, 83),
|
| + child->visualOffsetFromAncestor(document().layoutView()->layer()));
|
| +}
|
| +
|
| TEST_P(PaintLayerTest, CompositingContainerFloatingIframe) {
|
| enableCompositing();
|
| setBodyInnerHTML(
|
|
|