Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: Fix README.md Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 ASSERT_TRUE(layoutObject->isBox()); 203 ASSERT_TRUE(layoutObject->isBox());
204 LayoutBox* box = toLayoutBox(layoutObject); 204 LayoutBox* box = toLayoutBox(layoutObject);
205 ASSERT_TRUE(box->usesCompositedScrolling()); 205 ASSERT_TRUE(box->usesCompositedScrolling());
206 CompositedLayerMapping* compositedLayerMapping = 206 CompositedLayerMapping* compositedLayerMapping =
207 box->layer()->compositedLayerMapping(); 207 box->layer()->compositedLayerMapping();
208 ASSERT_TRUE(compositedLayerMapping->hasScrollingLayer()); 208 ASSERT_TRUE(compositedLayerMapping->hasScrollingLayer());
209 DCHECK(compositedLayerMapping->scrollingContentsLayer()); 209 DCHECK(compositedLayerMapping->scrollingContentsLayer());
210 WebLayer* webScrollLayer = 210 WebLayer* webScrollLayer =
211 compositedLayerMapping->scrollingContentsLayer()->platformLayer(); 211 compositedLayerMapping->scrollingContentsLayer()->platformLayer();
212 ASSERT_TRUE(webScrollLayer); 212 ASSERT_TRUE(webScrollLayer);
213 ASSERT_NEAR(1.2, webScrollLayer->scrollPositionDouble().x, 0.01); 213 ASSERT_NEAR(1.2f, webScrollLayer->scrollPositionDouble().x, 0.01f);
214 ASSERT_NEAR(1.2, webScrollLayer->scrollPositionDouble().y, 0.01); 214 ASSERT_NEAR(1.2f, webScrollLayer->scrollPositionDouble().y, 0.01f);
215 215
216 RuntimeEnabledFeatures::setFractionalScrollOffsetsEnabled( 216 RuntimeEnabledFeatures::setFractionalScrollOffsetsEnabled(
217 origFractionalOffsetsEnabled); 217 origFractionalOffsetsEnabled);
218 } 218 }
219 219
220 static WebLayer* webLayerFromElement(Element* element) { 220 static WebLayer* webLayerFromElement(Element* element) {
221 if (!element) 221 if (!element)
222 return 0; 222 return 0;
223 LayoutObject* layoutObject = element->layoutObject(); 223 LayoutObject* layoutObject = element->layoutObject();
224 if (!layoutObject || !layoutObject->isBoxModelObject()) 224 if (!layoutObject || !layoutObject->isBoxModelObject())
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 forceFullCompositingUpdate(); 735 forceFullCompositingUpdate();
736 scrollbarGraphicsLayer = compositedLayerMapping->layerForVerticalScrollbar(); 736 scrollbarGraphicsLayer = compositedLayerMapping->layerForVerticalScrollbar();
737 ASSERT_FALSE( 737 ASSERT_FALSE(
738 scrollbarGraphicsLayer->platformLayer()->shouldScrollOnMainThread()); 738 scrollbarGraphicsLayer->platformLayer()->shouldScrollOnMainThread());
739 ASSERT_FALSE( 739 ASSERT_FALSE(
740 scrollbarGraphicsLayer->platformLayer()->mainThreadScrollingReasons() & 740 scrollbarGraphicsLayer->platformLayer()->mainThreadScrollingReasons() &
741 MainThreadScrollingReason::kCustomScrollbarScrolling); 741 MainThreadScrollingReason::kCustomScrollbarScrolling);
742 } 742 }
743 743
744 } // namespace blink 744 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/RootScrollerTest.cpp ('k') | third_party/WebKit/Source/web/tests/TopControlsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698