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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 scroller->getScrollableArea()->setScrollOffset(ScrollOffset(0, 20), | 494 scroller->getScrollableArea()->setScrollOffset(ScrollOffset(0, 20), |
495 ProgrammaticScroll); | 495 ProgrammaticScroll); |
496 document().view()->updateAllLifecyclePhases(); | 496 document().view()->updateAllLifecyclePhases(); |
497 EXPECT_EQ(LayoutRect(0, 30, 50, 10), contentLayer->visualRect()); | 497 EXPECT_EQ(LayoutRect(0, 30, 50, 10), contentLayer->visualRect()); |
498 EXPECT_EQ(LayoutRect(0, 30, 50, 5), content->visualRect()); | 498 EXPECT_EQ(LayoutRect(0, 30, 50, 5), content->visualRect()); |
499 } | 499 } |
500 | 500 |
501 TEST_P(PaintLayerTest, CompositingContainerFloat) { | 501 TEST_P(PaintLayerTest, CompositingContainerFloat) { |
502 enableCompositing(); | 502 enableCompositing(); |
503 setBodyInnerHTML( | 503 setBodyInnerHTML( |
504 "<div id='containingBlock' style='position: relative; z-index: 0'>" | 504 "<div id='compositedContainer' style='position: relative;" |
505 " <div style='backface-visibility: hidden'></div>" | 505 " will-change: transform'>" |
506 " <span style='clip-path: polygon(0px 15px, 0px 54px, 100px 0px)'>" | 506 " <div id='containingBlock' style='position: relative; z-index: 0'>" |
507 " <div id='target' style='float: right; position: relative'></div>" | 507 " <div style='backface-visibility: hidden'></div>" |
508 " </span>" | 508 " <span style='clip-path: polygon(0px 15px, 0px 54px, 100px 0px)'>" |
| 509 " <div id='target' style='float: right; position: relative'></div>" |
| 510 " </span>" |
| 511 " </div>" |
509 "</div>"); | 512 "</div>"); |
510 | 513 |
511 PaintLayer* target = | 514 PaintLayer* target = |
512 toLayoutBoxModelObject(getLayoutObjectByElementId("target"))->layer(); | 515 toLayoutBoxModelObject(getLayoutObjectByElementId("target"))->layer(); |
513 PaintLayer* containingBlock = | 516 PaintLayer* containingBlock = |
514 toLayoutBoxModelObject(getLayoutObjectByElementId("containingBlock")) | 517 toLayoutBoxModelObject(getLayoutObjectByElementId("containingBlock")) |
515 ->layer(); | 518 ->layer(); |
516 EXPECT_EQ(containingBlock, target->compositingContainer()); | 519 EXPECT_EQ(containingBlock, target->compositingContainer()); |
| 520 PaintLayer* compositedContainer = |
| 521 toLayoutBoxModelObject(getLayoutObjectByElementId("compositedContainer")) |
| 522 ->layer(); |
| 523 |
| 524 // enclosingLayerWithCompositedLayerMapping is not needed or applicable to |
| 525 // SPv2. |
| 526 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 527 EXPECT_EQ(compositedContainer, |
| 528 target->enclosingLayerWithCompositedLayerMapping(ExcludeSelf)); |
| 529 } |
517 } | 530 } |
518 | 531 |
519 } // namespace blink | 532 } // namespace blink |
OLD | NEW |