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

Unified Diff: Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 747903005: Pass integer scroll position to CC if frameView has non-layered viewport constrained objects (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: call updateDescendantDependentFlags() before calling hasVisibleContent() otherwise it crashes Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/page/scrolling/ScrollingCoordinator.cpp
diff --git a/Source/core/page/scrolling/ScrollingCoordinator.cpp b/Source/core/page/scrolling/ScrollingCoordinator.cpp
index 1bfd1b4189819e4f7894d9705a92eafd8dfe18a5..edf1aa01487206103aa285aedebb9291f6c2325f 100644
--- a/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -355,7 +355,7 @@ void ScrollingCoordinator::scrollableAreaScrollbarLayerDidChange(ScrollableArea*
removeWebScrollbarLayer(scrollableArea, orientation);
}
-bool ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* scrollableArea)
+bool ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* scrollableArea, bool hasVisibleViewportConstrainedObjects)
{
GraphicsLayer* scrollLayer = scrollableArea->layerForScrolling();
@@ -368,7 +368,20 @@ bool ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* sc
WebLayer* containerLayer = toWebLayer(scrollableArea->layerForContainer());
if (webLayer) {
webLayer->setScrollClipLayer(containerLayer);
- webLayer->setScrollPositionDouble(DoublePoint(scrollableArea->scrollPositionDouble() - scrollableArea->minimumScrollPosition()));
+ // Viewport constrained objects, e.g. fixed position elements, are
+ // positioned in Blink using integer coordinates. In that case, we
+ // don't want to set the WebLayer's scroll position at fractional
+ // precision otherwise the WebLayer's position after snapping to
+ // device pixel can be off with regard to fixed position elements.
+ // FIXME: fixed position elements which have their own compositing
+ // layer can actually be positioned at device pixel boundary in
+ // chromium compositor, so this should really be conditioned on
+ // non-composited fixed position elements. crbug.com/414283.
+ if (hasVisibleViewportConstrainedObjects) {
Rick Byers 2014/12/05 19:01:41 Rather than taking this bit in from our caller (wh
+ webLayer->setScrollPositionDouble(DoublePoint(scrollableArea->scrollPosition() - scrollableArea->minimumScrollPosition()));
+ } else {
+ webLayer->setScrollPositionDouble(DoublePoint(scrollableArea->scrollPositionDouble() - scrollableArea->minimumScrollPosition()));
+ }
webLayer->setBounds(scrollableArea->contentsSize());
bool canScrollX = scrollableArea->userInputScrollable(HorizontalScrollbar);
bool canScrollY = scrollableArea->userInputScrollable(VerticalScrollbar);
« no previous file with comments | « Source/core/page/scrolling/ScrollingCoordinator.h ('k') | Source/core/rendering/compositing/RenderLayerCompositor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698