• David Bokan's avatar
    Fix viewport scrolling with overflow:hidden · ad69e5d2
    David Bokan authored
    This CL fixes an issue introduced in https://crrev.com/c/1999288.
    Scrollers can set |user_scrollable_horizontal| (or vertical) to false
    to indicate that the user shouldn't be able to scroll them  This
    corresponds to |overflow: hidden| in CSS (which can still be
    programmatically scrolled). In several places, compositor code checks
    these bits and, if false, clears the requested scrolling delta in the
    disabled axis.
    
    The bug in the CL above was that, now that the scrolling paths were
    consolidated,  we moved this "user_scrollable" adjustment from the
    update animation curve to happen as part of the common path in
    ScrollUpdate so that it would happen for all kinds of scroll modalities
    in one place.
    
    However, this adjustment is too simplistic for viewport scrolling.
    Scrolling the outer viewport must use the cc::Viewport class which will
    distribute the scroll between both inner and outer scroll nodes. The
    outer viewport may have user_scrollable=false, corresponding to the
    documentElement having |overflow: hidden| but we should still be able
    to scroll the inner viewport if the user zooms in. The above adjustment
    prevents that since it clears the delta. (I suspect this issue existed
    prior to this in the "update existing animation" case but is hard to hit
    since pinch-zoom and animated wheel scrolling aren't a common
    combination).
    
    The solution here is to move these adjustments to the point of node
    scrolling. This means that we'll adjust the delta right before applying
    a scroll to an individual ScrollNode. This ensures the entire delta is
    sent to the viewport which has special cases for dealing with the double
    nodes.
    
    Bug: 1055790
    Change-Id: I2e9849b15c512003352299fc82e58817a98ef778
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2072407
    Commit-Queue: David Bokan <bokan@chromium.org>
    Reviewed-by: default avatarMajid Valipour <majidvp@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#745229}
    ad69e5d2
viewport.cc 11 KB