• Ella Ge's avatar
    make scroll_offset not stored in dip scale in BrowserViewRenderer · 76a886bb
    Ella Ge authored
    The scroll amount passed into BrowserViewRenderer::ScrollTo is
    physical pixel with page_scale_factor applied.
    Before --use-zoom-for-dsf enabled, the scroll amount was divided by
    both dip_scale_ and page_scale_factor_ to convert to scroll amount
    in dip. With the flag enabled, it still need to divide by the
    page_scale_factor, but it incorrectly passed the original offset
    without take page_scale_factor into account, causes scroll amount
    larger than the max_scroll_offset.
    
    When --use-zoom-for-dsf is enabled, scroll_offset_dip_ and
    max_scroll_offset_dip_ are convert from/to physical pixel in
    every it get used. We shouldn't stored them in dip.
    
    So, this cl changes scroll_offset_dip_ to scroll_offset_unscaled_
    and max_scroll_offset_dip_ to max_scroll_offset_unscaled_,
    as they were in physical pixel when zoom-for-dsf enabled, and
    dip otherwise. Instead of having dip_scale applied every time it
    was set.
    
    TEST: webview_ui_test.test.DropDownListTest#testDropDownScaledViewPortUseWideViewPort
    Bug: 869995, 873617
    Change-Id: I694ca54438620e7afdf8db210704f40fb2c1ba54
    Reviewed-on: https://chromium-review.googlesource.com/1162519Reviewed-by: default avatarBo <boliu@chromium.org>
    Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
    Commit-Queue: Ella Ge <eirage@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#582692}
    76a886bb
synchronous_compositor_host.h 5.97 KB