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

Side by Side Diff: third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.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) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple 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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 if (scrollLayer) { 443 if (scrollLayer) {
444 bool isForVisualViewport = 444 bool isForVisualViewport =
445 scrollableArea == &m_page->frameHost().visualViewport(); 445 scrollableArea == &m_page->frameHost().visualViewport();
446 scrollLayer->setScrollableArea(scrollableArea, isForVisualViewport); 446 scrollLayer->setScrollableArea(scrollableArea, isForVisualViewport);
447 } 447 }
448 448
449 WebLayer* webLayer = toWebLayer(scrollableArea->layerForScrolling()); 449 WebLayer* webLayer = toWebLayer(scrollableArea->layerForScrolling());
450 WebLayer* containerLayer = toWebLayer(scrollableArea->layerForContainer()); 450 WebLayer* containerLayer = toWebLayer(scrollableArea->layerForContainer());
451 if (webLayer) { 451 if (webLayer) {
452 webLayer->setScrollClipLayer(containerLayer); 452 webLayer->setScrollClipLayer(containerLayer);
453 DoublePoint scrollPosition(scrollableArea->scrollPositionDouble() + 453 DoublePoint scrollPosition(FloatPoint(scrollableArea->scrollOrigin()) +
454 toDoubleSize(scrollableArea->scrollOrigin())); 454 scrollableArea->scrollOffset());
455 webLayer->setScrollPositionDouble(scrollPosition); 455 webLayer->setScrollPositionDouble(scrollPosition);
456 456
457 webLayer->setBounds(scrollableArea->contentsSize()); 457 webLayer->setBounds(scrollableArea->contentsSize());
458 bool canScrollX = scrollableArea->userInputScrollable(HorizontalScrollbar); 458 bool canScrollX = scrollableArea->userInputScrollable(HorizontalScrollbar);
459 bool canScrollY = scrollableArea->userInputScrollable(VerticalScrollbar); 459 bool canScrollY = scrollableArea->userInputScrollable(VerticalScrollbar);
460 webLayer->setUserScrollable(canScrollX, canScrollY); 460 webLayer->setUserScrollable(canScrollX, canScrollY);
461 } 461 }
462 if (WebScrollbarLayer* scrollbarLayer = 462 if (WebScrollbarLayer* scrollbarLayer =
463 getWebScrollbarLayer(scrollableArea, HorizontalScrollbar)) { 463 getWebScrollbarLayer(scrollableArea, HorizontalScrollbar)) {
464 GraphicsLayer* horizontalScrollbarLayer = 464 GraphicsLayer* horizontalScrollbarLayer =
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 if (frameIsScrollable != m_wasFrameScrollable) 1229 if (frameIsScrollable != m_wasFrameScrollable)
1230 return true; 1230 return true;
1231 1231
1232 if (WebLayer* scrollLayer = 1232 if (WebLayer* scrollLayer =
1233 frameView ? toWebLayer(frameView->layerForScrolling()) : nullptr) 1233 frameView ? toWebLayer(frameView->layerForScrolling()) : nullptr)
1234 return WebSize(frameView->contentsSize()) != scrollLayer->bounds(); 1234 return WebSize(frameView->contentsSize()) != scrollLayer->bounds();
1235 return false; 1235 return false;
1236 } 1236 }
1237 1237
1238 } // namespace blink 1238 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698