OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 ASSERT_TRUE(layoutObject->isBox()); | 219 ASSERT_TRUE(layoutObject->isBox()); |
220 LayoutBox* box = toLayoutBox(layoutObject); | 220 LayoutBox* box = toLayoutBox(layoutObject); |
221 ASSERT_TRUE(box->usesCompositedScrolling()); | 221 ASSERT_TRUE(box->usesCompositedScrolling()); |
222 CompositedLayerMapping* compositedLayerMapping = | 222 CompositedLayerMapping* compositedLayerMapping = |
223 box->layer()->compositedLayerMapping(); | 223 box->layer()->compositedLayerMapping(); |
224 ASSERT_TRUE(compositedLayerMapping->hasScrollingLayer()); | 224 ASSERT_TRUE(compositedLayerMapping->hasScrollingLayer()); |
225 DCHECK(compositedLayerMapping->scrollingContentsLayer()); | 225 DCHECK(compositedLayerMapping->scrollingContentsLayer()); |
226 WebLayer* webScrollLayer = | 226 WebLayer* webScrollLayer = |
227 compositedLayerMapping->scrollingContentsLayer()->platformLayer(); | 227 compositedLayerMapping->scrollingContentsLayer()->platformLayer(); |
228 ASSERT_TRUE(webScrollLayer); | 228 ASSERT_TRUE(webScrollLayer); |
229 ASSERT_NEAR(1.2f, webScrollLayer->scrollPositionDouble().x, 0.01f); | 229 ASSERT_NEAR(1.2f, webScrollLayer->scrollPosition().x, 0.01f); |
230 ASSERT_NEAR(1.2f, webScrollLayer->scrollPositionDouble().y, 0.01f); | 230 ASSERT_NEAR(1.2f, webScrollLayer->scrollPosition().y, 0.01f); |
231 | 231 |
232 RuntimeEnabledFeatures::setFractionalScrollOffsetsEnabled( | 232 RuntimeEnabledFeatures::setFractionalScrollOffsetsEnabled( |
233 origFractionalOffsetsEnabled); | 233 origFractionalOffsetsEnabled); |
234 } | 234 } |
235 | 235 |
236 static WebLayer* webLayerFromElement(Element* element) { | 236 static WebLayer* webLayerFromElement(Element* element) { |
237 if (!element) | 237 if (!element) |
238 return 0; | 238 return 0; |
239 LayoutObject* layoutObject = element->layoutObject(); | 239 LayoutObject* layoutObject = element->layoutObject(); |
240 if (!layoutObject || !layoutObject->isBoxModelObject()) | 240 if (!layoutObject || !layoutObject->isBoxModelObject()) |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 | 733 |
734 WebLayer* webScrollLayer = scrollLayer->platformLayer(); | 734 WebLayer* webScrollLayer = scrollLayer->platformLayer(); |
735 ASSERT_TRUE(webScrollLayer->scrollable()); | 735 ASSERT_TRUE(webScrollLayer->scrollable()); |
736 | 736 |
737 int expectedScrollPosition = | 737 int expectedScrollPosition = |
738 958 + (innerFrameView->layoutViewportScrollableArea() | 738 958 + (innerFrameView->layoutViewportScrollableArea() |
739 ->verticalScrollbar() | 739 ->verticalScrollbar() |
740 ->isOverlayScrollbar() | 740 ->isOverlayScrollbar() |
741 ? 0 | 741 ? 0 |
742 : 15); | 742 : 15); |
743 ASSERT_EQ(expectedScrollPosition, webScrollLayer->scrollPositionDouble().x); | 743 ASSERT_EQ(expectedScrollPosition, webScrollLayer->scrollPosition().x); |
744 } | 744 } |
745 | 745 |
746 TEST_P(ScrollingCoordinatorTest, setupScrollbarLayerShouldNotCrash) { | 746 TEST_P(ScrollingCoordinatorTest, setupScrollbarLayerShouldNotCrash) { |
747 registerMockedHttpURLLoad("setup_scrollbar_layer_crash.html"); | 747 registerMockedHttpURLLoad("setup_scrollbar_layer_crash.html"); |
748 navigateTo(m_baseURL + "setup_scrollbar_layer_crash.html"); | 748 navigateTo(m_baseURL + "setup_scrollbar_layer_crash.html"); |
749 forceFullCompositingUpdate(); | 749 forceFullCompositingUpdate(); |
750 // This test document setup an iframe with scrollbars, then switch to | 750 // This test document setup an iframe with scrollbars, then switch to |
751 // an empty document by javascript. | 751 // an empty document by javascript. |
752 } | 752 } |
753 | 753 |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 ASSERT_FALSE(frameView->mainThreadScrollingReasons() & reason); | 1159 ASSERT_FALSE(frameView->mainThreadScrollingReasons() & reason); |
1160 } | 1160 } |
1161 | 1161 |
1162 TEST_P(StyleRelatedMainThreadScrollingReasonTest, LCDTextEnabledTest) { | 1162 TEST_P(StyleRelatedMainThreadScrollingReasonTest, LCDTextEnabledTest) { |
1163 testStyle("transparent border-radius", | 1163 testStyle("transparent border-radius", |
1164 MainThreadScrollingReason::kHasOpacityAndLCDText | | 1164 MainThreadScrollingReason::kHasOpacityAndLCDText | |
1165 MainThreadScrollingReason::kHasBorderRadius); | 1165 MainThreadScrollingReason::kHasBorderRadius); |
1166 } | 1166 } |
1167 | 1167 |
1168 } // namespace blink | 1168 } // namespace blink |
OLD | NEW |