| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/layout/compositing/CompositedLayerMapping.h" | 5 #include "core/layout/compositing/CompositedLayerMapping.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 Element* negativeCompositedChild = document().getElementById("negative-compo
sited-child"); | 619 Element* negativeCompositedChild = document().getElementById("negative-compo
sited-child"); |
| 620 negativeCompositedChild->parentNode()->removeChild(negativeCompositedChild); | 620 negativeCompositedChild->parentNode()->removeChild(negativeCompositedChild); |
| 621 document().view()->updateAllLifecyclePhases(); | 621 document().view()->updateAllLifecyclePhases(); |
| 622 | 622 |
| 623 mapping = toLayoutBlock(getLayoutObjectByElementId("container"))->layer()->c
ompositedLayerMapping(); | 623 mapping = toLayoutBlock(getLayoutObjectByElementId("container"))->layer()->c
ompositedLayerMapping(); |
| 624 ASSERT_TRUE(mapping->scrollingContentsLayer()); | 624 ASSERT_TRUE(mapping->scrollingContentsLayer()); |
| 625 EXPECT_EQ(static_cast<GraphicsLayerPaintingPhase>(GraphicsLayerPaintOverflow
Contents | GraphicsLayerPaintCompositedScroll | GraphicsLayerPaintForeground), m
apping->scrollingContentsLayer()->paintingPhase()); | 625 EXPECT_EQ(static_cast<GraphicsLayerPaintingPhase>(GraphicsLayerPaintOverflow
Contents | GraphicsLayerPaintCompositedScroll | GraphicsLayerPaintForeground), m
apping->scrollingContentsLayer()->paintingPhase()); |
| 626 EXPECT_FALSE(mapping->foregroundLayer()); | 626 EXPECT_FALSE(mapping->foregroundLayer()); |
| 627 } | 627 } |
| 628 | 628 |
| 629 TEST_F(CompositedLayerMappingTest, OverflowAndClippingWithACL) | |
| 630 { | |
| 631 document().frame()->settings()->setPreferCompositingToLCDTextEnabled(true); | |
| 632 setBodyInnerHTML( | |
| 633 "<div style='height:700px; overflow-y:scroll; background-color:red;'>" | |
| 634 " <div style='overflow:hidden; width: 700px; height:2000px;'>" | |
| 635 " <div id='hidden' style='background-color:blue; width: 700px; height
:2000px; position:relative;'></div>" | |
| 636 " </div>" | |
| 637 "</div>"); | |
| 638 CompositedLayerMapping* mapping = toLayoutBlock(getLayoutObjectByElementId("
hidden"))->layer()->compositedLayerMapping(); | |
| 639 ASSERT_TRUE(mapping->ancestorClippingLayer()); | |
| 640 EXPECT_EQ(2000.f, mapping->ancestorClippingLayer()->size().height()); | |
| 641 } | |
| 642 | |
| 643 } // namespace blink | 629 } // namespace blink |
| OLD | NEW |