[Reland] Make touch handles relative to scrolling contents
Selection bounds are sent from Blink to CC as part of a commit cycle so that we can draw touch handles for it. Currently, the selection bounds are relative to the main graphics layer of a CompositedLayerMapping. In the case of a scroller, this will be its clip rect - rather than its scrolling contents layer. Unfortunately, this means that scrolling on the compositor isn't applied as part of the ToScreen transformation on the selection bounds so scrolling wont update the selection bounds location until another Blink commit. This went unnoticed until now because the root layer was not considered a scroller. The page would paint into a document-sized layer and the compositor would provide extra scrolling layers to handle frame scrolling. In this configuration, the ToScreen transformation from the root layer does include the scroll offset. Now that root layer scrolling has been turned on, frame scrolling works much the same as other scrollers. Thus, this shortcoming is seen on frame scrolling also. The solution in this CL is to move the selection bounds rect to be relative to the scrolling contents layer - if one exists. The ToScreen transformation done in CC will correctly compensate for any scroll offset applied in the compositor and touch selection handles stick to the selection as its scrolled. For the CC side, see ComputeViewportSelectionBound in layer_tree_impl.cc Reland Note: This patch makes the RenderedPositionTests run with mock scrollbars. TBR=chrishtr@chromium.org Bug: 812048 Change-Id: Ib9eacd14b75b71b4e0d4f0a9b57416800f9dfb91 Reviewed-on: https://chromium-review.googlesource.com/967001Reviewed-by:David Bokan <bokan@chromium.org> Commit-Queue: David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/master@{#543803}
Showing
Please register or sign in to comment