| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 ASSERT_TRUE(rootScrollLayer->scrollable()); | 155 ASSERT_TRUE(rootScrollLayer->scrollable()); |
| 156 ASSERT_FALSE(rootScrollLayer->shouldScrollOnMainThread()); | 156 ASSERT_FALSE(rootScrollLayer->shouldScrollOnMainThread()); |
| 157 ASSERT_EQ(WebEventListenerProperties::Nothing, | 157 ASSERT_EQ(WebEventListenerProperties::Nothing, |
| 158 webLayerTreeView()->eventListenerProperties( | 158 webLayerTreeView()->eventListenerProperties( |
| 159 WebEventListenerClass::TouchStartOrMove)); | 159 WebEventListenerClass::TouchStartOrMove)); |
| 160 ASSERT_EQ(WebEventListenerProperties::Nothing, | 160 ASSERT_EQ(WebEventListenerProperties::Nothing, |
| 161 webLayerTreeView()->eventListenerProperties( | 161 webLayerTreeView()->eventListenerProperties( |
| 162 WebEventListenerClass::MouseWheel)); | 162 WebEventListenerClass::MouseWheel)); |
| 163 | 163 |
| 164 WebLayer* innerViewportScrollLayer = | 164 WebLayer* innerViewportScrollLayer = |
| 165 page->frameHost().visualViewport().scrollLayer()->platformLayer(); | 165 page->visualViewport().scrollLayer()->platformLayer(); |
| 166 ASSERT_TRUE(innerViewportScrollLayer->scrollable()); | 166 ASSERT_TRUE(innerViewportScrollLayer->scrollable()); |
| 167 ASSERT_FALSE(innerViewportScrollLayer->shouldScrollOnMainThread()); | 167 ASSERT_FALSE(innerViewportScrollLayer->shouldScrollOnMainThread()); |
| 168 } | 168 } |
| 169 | 169 |
| 170 TEST_P(ScrollingCoordinatorTest, fastScrollingCanBeDisabledWithSetting) { | 170 TEST_P(ScrollingCoordinatorTest, fastScrollingCanBeDisabledWithSetting) { |
| 171 webViewImpl()->resize(WebSize(800, 600)); | 171 webViewImpl()->resize(WebSize(800, 600)); |
| 172 loadHTML("<div id='spacer' style='height: 1000px'></div>"); | 172 loadHTML("<div id='spacer' style='height: 1000px'></div>"); |
| 173 webViewImpl()->settings()->setThreadedScrollingEnabled(false); | 173 webViewImpl()->settings()->setThreadedScrollingEnabled(false); |
| 174 forceFullCompositingUpdate(); | 174 forceFullCompositingUpdate(); |
| 175 | 175 |
| 176 // Make sure the scrolling coordinator is active. | 176 // Make sure the scrolling coordinator is active. |
| 177 FrameView* frameView = frame()->view(); | 177 FrameView* frameView = frame()->view(); |
| 178 Page* page = frame()->page(); | 178 Page* page = frame()->page(); |
| 179 ASSERT_TRUE(page->scrollingCoordinator()); | 179 ASSERT_TRUE(page->scrollingCoordinator()); |
| 180 ASSERT_TRUE(page->scrollingCoordinator()->coordinatesScrollingForFrameView( | 180 ASSERT_TRUE(page->scrollingCoordinator()->coordinatesScrollingForFrameView( |
| 181 frameView)); | 181 frameView)); |
| 182 | 182 |
| 183 // Main scrolling should be enabled with the setting override. | 183 // Main scrolling should be enabled with the setting override. |
| 184 WebLayer* rootScrollLayer = getRootScrollLayer(); | 184 WebLayer* rootScrollLayer = getRootScrollLayer(); |
| 185 ASSERT_TRUE(rootScrollLayer); | 185 ASSERT_TRUE(rootScrollLayer); |
| 186 ASSERT_TRUE(rootScrollLayer->scrollable()); | 186 ASSERT_TRUE(rootScrollLayer->scrollable()); |
| 187 ASSERT_TRUE(rootScrollLayer->shouldScrollOnMainThread()); | 187 ASSERT_TRUE(rootScrollLayer->shouldScrollOnMainThread()); |
| 188 | 188 |
| 189 // Main scrolling should also propagate to inner viewport layer. | 189 // Main scrolling should also propagate to inner viewport layer. |
| 190 WebLayer* innerViewportScrollLayer = | 190 WebLayer* innerViewportScrollLayer = |
| 191 page->frameHost().visualViewport().scrollLayer()->platformLayer(); | 191 page->visualViewport().scrollLayer()->platformLayer(); |
| 192 ASSERT_TRUE(innerViewportScrollLayer->scrollable()); | 192 ASSERT_TRUE(innerViewportScrollLayer->scrollable()); |
| 193 ASSERT_TRUE(innerViewportScrollLayer->shouldScrollOnMainThread()); | 193 ASSERT_TRUE(innerViewportScrollLayer->shouldScrollOnMainThread()); |
| 194 } | 194 } |
| 195 | 195 |
| 196 TEST_P(ScrollingCoordinatorTest, fastFractionalScrollingDiv) { | 196 TEST_P(ScrollingCoordinatorTest, fastFractionalScrollingDiv) { |
| 197 bool origFractionalOffsetsEnabled = | 197 bool origFractionalOffsetsEnabled = |
| 198 RuntimeEnabledFeatures::fractionalScrollOffsetsEnabled(); | 198 RuntimeEnabledFeatures::fractionalScrollOffsetsEnabled(); |
| 199 RuntimeEnabledFeatures::setFractionalScrollOffsetsEnabled(true); | 199 RuntimeEnabledFeatures::setFractionalScrollOffsetsEnabled(true); |
| 200 | 200 |
| 201 registerMockedHttpURLLoad("fractional-scroll-div.html"); | 201 registerMockedHttpURLLoad("fractional-scroll-div.html"); |
| (...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1165 MainThreadScrollingReason::kHasOpacityAndLCDText | | 1165 MainThreadScrollingReason::kHasOpacityAndLCDText | |
| 1166 MainThreadScrollingReason::kHasBorderRadius); | 1166 MainThreadScrollingReason::kHasBorderRadius); |
| 1167 } | 1167 } |
| 1168 | 1168 |
| 1169 TEST_P(StyleRelatedMainThreadScrollingReasonTest, BoxShadowTest) { | 1169 TEST_P(StyleRelatedMainThreadScrollingReasonTest, BoxShadowTest) { |
| 1170 testStyle("box-shadow", | 1170 testStyle("box-shadow", |
| 1171 MainThreadScrollingReason::kHasBoxShadowFromNonRootLayer); | 1171 MainThreadScrollingReason::kHasBoxShadowFromNonRootLayer); |
| 1172 } | 1172 } |
| 1173 | 1173 |
| 1174 } // namespace blink | 1174 } // namespace blink |
| OLD | NEW |