OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/paint/PaintLayer.h" | 5 #include "core/paint/PaintLayer.h" |
6 | 6 |
7 #include "core/html/HTMLIFrameElement.h" | 7 #include "core/html/HTMLIFrameElement.h" |
8 #include "core/layout/LayoutBoxModelObject.h" | 8 #include "core/layout/LayoutBoxModelObject.h" |
9 #include "core/layout/LayoutTestHelper.h" | 9 #include "core/layout/LayoutTestHelper.h" |
10 #include "core/layout/LayoutView.h" | 10 #include "core/layout/LayoutView.h" |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 toLayoutBoxModelObject(getLayoutObjectByElementId("floating"))->layer(); | 616 toLayoutBoxModelObject(getLayoutObjectByElementId("floating"))->layer(); |
617 PaintLayer* span = | 617 PaintLayer* span = |
618 toLayoutBoxModelObject(getLayoutObjectByElementId("span"))->layer(); | 618 toLayoutBoxModelObject(getLayoutObjectByElementId("span"))->layer(); |
619 | 619 |
620 EXPECT_EQ(span, floating->parent()); | 620 EXPECT_EQ(span, floating->parent()); |
621 EXPECT_EQ(span, floating->containingLayer()); | 621 EXPECT_EQ(span, floating->containingLayer()); |
622 | 622 |
623 EXPECT_EQ(LayoutPoint(83, 83), floating->location()); | 623 EXPECT_EQ(LayoutPoint(83, 83), floating->location()); |
624 EXPECT_EQ(LayoutPoint(100, 100), span->location()); | 624 EXPECT_EQ(LayoutPoint(100, 100), span->location()); |
625 EXPECT_EQ(LayoutPoint(83, 83), floating->visualOffsetFromAncestor(span)); | 625 EXPECT_EQ(LayoutPoint(83, 83), floating->visualOffsetFromAncestor(span)); |
626 EXPECT_EQ(LayoutPoint(183, 183), floating->visualOffsetFromAncestor( | 626 EXPECT_EQ( |
627 document().layoutView()->layer())); | 627 LayoutPoint(183, 183), |
| 628 floating->visualOffsetFromAncestor(document().layoutView()->layer())); |
628 } | 629 } |
629 | 630 |
630 TEST_P(PaintLayerTest, CompositingContainerFloatingIframe) { | 631 TEST_P(PaintLayerTest, CompositingContainerFloatingIframe) { |
631 enableCompositing(); | 632 enableCompositing(); |
632 setBodyInnerHTML( | 633 setBodyInnerHTML( |
633 "<div id='compositedContainer' style='position: relative;" | 634 "<div id='compositedContainer' style='position: relative;" |
634 " will-change: transform'>" | 635 " will-change: transform'>" |
635 " <div id='containingBlock' style='position: relative; z-index: 0'>" | 636 " <div id='containingBlock' style='position: relative; z-index: 0'>" |
636 " <div style='backface-visibility: hidden'></div>" | 637 " <div style='backface-visibility: hidden'></div>" |
637 " <span id='span'" | 638 " <span id='span'" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 EXPECT_EQ(LayoutPoint(-150, 50), spanner->location()); | 716 EXPECT_EQ(LayoutPoint(-150, 50), spanner->location()); |
716 EXPECT_EQ(LayoutPoint(100, 100), extraLayer->location()); | 717 EXPECT_EQ(LayoutPoint(100, 100), extraLayer->location()); |
717 // -60 = 2nd-column-x(40) - scroll-offset-x(200) + x-location(100) | 718 // -60 = 2nd-column-x(40) - scroll-offset-x(200) + x-location(100) |
718 // 20 = y-location(100) - column-height(80) | 719 // 20 = y-location(100) - column-height(80) |
719 EXPECT_EQ(LayoutPoint(-60, 20), | 720 EXPECT_EQ(LayoutPoint(-60, 20), |
720 extraLayer->visualOffsetFromAncestor(columns)); | 721 extraLayer->visualOffsetFromAncestor(columns)); |
721 EXPECT_EQ(LayoutPoint(-150, 50), spanner->visualOffsetFromAncestor(columns)); | 722 EXPECT_EQ(LayoutPoint(-150, 50), spanner->visualOffsetFromAncestor(columns)); |
722 } | 723 } |
723 | 724 |
724 } // namespace blink | 725 } // namespace blink |
OLD | NEW |