Reland [SpatNav] Fix IsOffscreen computation
Reland Note: Original CL actually fixed the test on Mac which caused it to mis-match the failing expectation. The test remained broken on other platforms because it didn't account for scroll animations. This CL fixes the test and updates the expectation to passing, original CL in PS#1. The IsOffscreen computation was comparing the FrameView's GetScrollableArea()->VisibleContentRect, which is be the content rect in the _root scroller_, with the object's VisibleRectInDocument, which is in document coordinates. This breaks when a non-default root scroller is active. I've rewritten this method to be cleaner. I've kept the separate mapping up to the local frame first using VisualRectInDocument rather than mapping directly from local to root frame since VisualRectInDocument has some specific logic in subclasses that uses a different local rect depending on the LayoutObject type; I couldn't find an equivalent way of getting an equivalent rect but in local coordinates and several tests depend on this (e.g. how line boxes are collected in a LayoutInline). TBR=eae@chromium.org Bug: 949406 Change-Id: Iec0f5a27bd242c537db231cfb44b39d535fc579f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1565724 Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by:David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/master@{#650477}
Showing
Please register or sign in to comment