• David Bokan's avatar
    Fix for layer coordinates in root layer scrolls · de6781ce
    David Bokan authored
    This patch fixes MouseEvent.layerX and layerY when root-layer-scrolls is
    enabled. The layer coordinates are calculated by subtracting from the
    document location the layer offsets of each parent layer starting from
    the current layer's parent. This yields the offset within the layer.
    
    The repeated subtraction gets us back to the absolute coordinate space.
    Pre-RLS, this was the same as document/content coordinates. With RLS
    turned on, the LayoutView is the same size as the frame and clips and
    scrolls its content. Thus, transforming through it yields frame
    coordinates. Therefore, the change is to start from the event's absolute
    location. With RLS off, the conversion yields a no-op so there's no
    change. When RLS is on this accounts for the LayoutView's scroll offset.
    
    Bug: 781431
    Change-Id: Ib25859effbfb71516e5edb5173154c807ea98314
    Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_root_layer_scrolls
    Reviewed-on: https://chromium-review.googlesource.com/798832
    Commit-Queue: David Bokan <bokan@chromium.org>
    Reviewed-by: default avatarStefan Zager <szager@chromium.org>
    Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#521279}
    de6781ce
root-layer-scrolls 7.82 KB