| 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/LocalFrameView.h" | 7 #include "core/frame/LocalFrameView.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/api/LayoutViewItem.h" | 10 #include "core/layout/api/LayoutViewItem.h" |
| (...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 mapping = paint_layer->GetCompositedLayerMapping(); | 914 mapping = paint_layer->GetCompositedLayerMapping(); |
| 915 EXPECT_FALSE(mapping->DecorationOutlineLayer()); | 915 EXPECT_FALSE(mapping->DecorationOutlineLayer()); |
| 916 } | 916 } |
| 917 | 917 |
| 918 TEST_P(CompositedLayerMappingTest, | 918 TEST_P(CompositedLayerMappingTest, |
| 919 BackgroundPaintedIntoGraphicsLayerIfNotCompositedScrolling) { | 919 BackgroundPaintedIntoGraphicsLayerIfNotCompositedScrolling) { |
| 920 GetDocument().GetFrame()->GetSettings()->SetPreferCompositingToLCDTextEnabled( | 920 GetDocument().GetFrame()->GetSettings()->SetPreferCompositingToLCDTextEnabled( |
| 921 true); | 921 true); |
| 922 SetBodyInnerHTML( | 922 SetBodyInnerHTML( |
| 923 "<div id='container' style='overflow: scroll; width: 300px; height: " | 923 "<div id='container' style='overflow: scroll; width: 300px; height: " |
| 924 "300px; border-radius: 5px; background: white; will-change: transform;'>" | 924 "300px; background: white; will-change: transform;'>" |
| 925 " <div style='background-color: blue; width: 2000px; height: " | 925 " <div style='background-color: blue; clip-path: circle(600px at " |
| 926 "1000px 1000px); width: 2000px; height: " |
| 926 "2000px;'></div>" | 927 "2000px;'></div>" |
| 927 "</div>"); | 928 "</div>"); |
| 928 | 929 |
| 929 PaintLayer* layer = | 930 PaintLayer* layer = |
| 930 ToLayoutBlock(GetLayoutObjectByElementId("container"))->Layer(); | 931 ToLayoutBlock(GetLayoutObjectByElementId("container"))->Layer(); |
| 931 EXPECT_EQ(kBackgroundPaintInScrollingContents, | 932 EXPECT_EQ(kBackgroundPaintInScrollingContents, |
| 932 layer->GetBackgroundPaintLocation()); | 933 layer->GetBackgroundPaintLocation()); |
| 933 | 934 |
| 934 // We currently don't use composited scrolling when the container has a | 935 // We currently don't use composited scrolling when the container has a |
| 935 // border-radius so even though we can paint the background onto the scrolling | 936 // border-radius so even though we can paint the background onto the scrolling |
| (...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1805 ASSERT_TRUE(scrollable_area); | 1806 ASSERT_TRUE(scrollable_area); |
| 1806 scrollable_area->ScrollToAbsolutePosition( | 1807 scrollable_area->ScrollToAbsolutePosition( |
| 1807 FloatPoint(scrollable_area->ScrollPosition().Y(), 100)); | 1808 FloatPoint(scrollable_area->ScrollPosition().Y(), 100)); |
| 1808 GetDocument().View()->UpdateAllLifecyclePhases(); | 1809 GetDocument().View()->UpdateAllLifecyclePhases(); |
| 1809 | 1810 |
| 1810 EXPECT_FLOAT_EQ(0, main_graphics_layer->GetPosition().X()); | 1811 EXPECT_FLOAT_EQ(0, main_graphics_layer->GetPosition().X()); |
| 1811 EXPECT_FLOAT_EQ(100, main_graphics_layer->GetPosition().Y()); | 1812 EXPECT_FLOAT_EQ(100, main_graphics_layer->GetPosition().Y()); |
| 1812 } | 1813 } |
| 1813 | 1814 |
| 1814 } // namespace blink | 1815 } // namespace blink |
| OLD | NEW |