| 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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 PaintLayer* floating = | 543 PaintLayer* floating = |
| 544 toLayoutBoxModelObject(getLayoutObjectByElementId("floating"))->layer(); | 544 toLayoutBoxModelObject(getLayoutObjectByElementId("floating"))->layer(); |
| 545 PaintLayer* absolute = | 545 PaintLayer* absolute = |
| 546 toLayoutBoxModelObject(getLayoutObjectByElementId("absolute"))->layer(); | 546 toLayoutBoxModelObject(getLayoutObjectByElementId("absolute"))->layer(); |
| 547 PaintLayer* span = | 547 PaintLayer* span = |
| 548 toLayoutBoxModelObject(getLayoutObjectByElementId("span"))->layer(); | 548 toLayoutBoxModelObject(getLayoutObjectByElementId("span"))->layer(); |
| 549 PaintLayer* container = | 549 PaintLayer* container = |
| 550 toLayoutBoxModelObject(getLayoutObjectByElementId("container"))->layer(); | 550 toLayoutBoxModelObject(getLayoutObjectByElementId("container"))->layer(); |
| 551 | 551 |
| 552 EXPECT_EQ(span, floating->parent()); | 552 EXPECT_EQ(span, floating->parent()); |
| 553 EXPECT_EQ(container, floating->containingLayer()); |
| 553 EXPECT_EQ(span, absolute->parent()); | 554 EXPECT_EQ(span, absolute->parent()); |
| 555 EXPECT_EQ(span, absolute->containingLayer()); |
| 554 EXPECT_EQ(container, span->parent()); | 556 EXPECT_EQ(container, span->parent()); |
| 557 EXPECT_EQ(container, span->containingLayer()); |
| 555 | 558 |
| 556 EXPECT_EQ(LayoutPoint(83, 83), floating->location()); | 559 EXPECT_EQ(LayoutPoint(83, 83), floating->location()); |
| 557 EXPECT_EQ(LayoutPoint(50, 50), absolute->location()); | 560 EXPECT_EQ(LayoutPoint(50, 50), absolute->location()); |
| 558 EXPECT_EQ(LayoutPoint(133, 133), span->location()); | 561 EXPECT_EQ(LayoutPoint(133, 133), span->location()); |
| 559 EXPECT_EQ(LayoutPoint(20, 20), container->location()); | 562 EXPECT_EQ(LayoutPoint(20, 20), container->location()); |
| 560 | 563 |
| 561 EXPECT_EQ(LayoutPoint(-50, -50), floating->visualOffsetFromAncestor(span)); | 564 EXPECT_EQ(LayoutPoint(-50, -50), floating->visualOffsetFromAncestor(span)); |
| 562 EXPECT_EQ(LayoutPoint(50, 50), absolute->visualOffsetFromAncestor(span)); | 565 EXPECT_EQ(LayoutPoint(50, 50), absolute->visualOffsetFromAncestor(span)); |
| 563 EXPECT_EQ(LayoutPoint(83, 83), floating->visualOffsetFromAncestor(container)); | 566 EXPECT_EQ(LayoutPoint(83, 83), floating->visualOffsetFromAncestor(container)); |
| 564 EXPECT_EQ(LayoutPoint(183, 183), | 567 EXPECT_EQ(LayoutPoint(183, 183), |
| (...skipping 10 matching lines...) Expand all Loading... |
| 575 " </div>" | 578 " </div>" |
| 576 " </div>" | 579 " </div>" |
| 577 "</span>"); | 580 "</span>"); |
| 578 | 581 |
| 579 PaintLayer* floating = | 582 PaintLayer* floating = |
| 580 toLayoutBoxModelObject(getLayoutObjectByElementId("floating"))->layer(); | 583 toLayoutBoxModelObject(getLayoutObjectByElementId("floating"))->layer(); |
| 581 PaintLayer* span = | 584 PaintLayer* span = |
| 582 toLayoutBoxModelObject(getLayoutObjectByElementId("span"))->layer(); | 585 toLayoutBoxModelObject(getLayoutObjectByElementId("span"))->layer(); |
| 583 | 586 |
| 584 EXPECT_EQ(span, floating->parent()); | 587 EXPECT_EQ(span, floating->parent()); |
| 588 EXPECT_EQ(span, floating->containingLayer()); |
| 585 | 589 |
| 586 EXPECT_EQ(LayoutPoint(83, 83), floating->location()); | 590 EXPECT_EQ(LayoutPoint(83, 83), floating->location()); |
| 587 EXPECT_EQ(LayoutPoint(100, 100), span->location()); | 591 EXPECT_EQ(LayoutPoint(100, 100), span->location()); |
| 588 EXPECT_EQ(LayoutPoint(83, 83), floating->visualOffsetFromAncestor(span)); | 592 EXPECT_EQ(LayoutPoint(83, 83), floating->visualOffsetFromAncestor(span)); |
| 589 EXPECT_EQ(LayoutPoint(183, 183), floating->visualOffsetFromAncestor( | 593 EXPECT_EQ(LayoutPoint(183, 183), floating->visualOffsetFromAncestor( |
| 590 document().layoutView()->layer())); | 594 document().layoutView()->layer())); |
| 591 } | 595 } |
| 592 | 596 |
| 593 TEST_P(PaintLayerTest, CompositingContainerFloatingIframe) { | 597 TEST_P(PaintLayerTest, CompositingContainerFloatingIframe) { |
| 594 enableCompositing(); | 598 enableCompositing(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 620 | 624 |
| 621 // enclosingLayerWithCompositedLayerMapping is not needed or applicable to | 625 // enclosingLayerWithCompositedLayerMapping is not needed or applicable to |
| 622 // SPv2. | 626 // SPv2. |
| 623 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 627 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 624 EXPECT_EQ(compositedContainer, | 628 EXPECT_EQ(compositedContainer, |
| 625 target->enclosingLayerWithCompositedLayerMapping(ExcludeSelf)); | 629 target->enclosingLayerWithCompositedLayerMapping(ExcludeSelf)); |
| 626 } | 630 } |
| 627 } | 631 } |
| 628 | 632 |
| 629 } // namespace blink | 633 } // namespace blink |
| OLD | NEW |