Fix event hit testing for non-located context menu of large elements
Keyboard shortcut(Shift + F10) triggers event with non-located context menu. In codepath where hit testing is done for the receiving element of event, calculation of center of focused element is not clipped to visual viewport bounds. This calculation of center can be incorrect and fall outside viewport area if element dimensions are much larger than visual viewport. In this case root html element is returned as result of hit testing, hence incorrect context menu shows up. This CL replaces BoundsInViewport() with VisibleBoundsInVisualViewport() to clip rect within viewport bounds. This calculates center of element area in viewport and eventually hit test for correct element to show up its context menu. Bug: 1101653 Change-Id: I6a6ff4bf5ba2d70eb3221449cad609b77370e6fa Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2299663 Commit-Queue: Vikash Sharma <vikash@microsoft.com> Reviewed-by: Ankit Kumar🌪 ️ <ankk@microsoft.com> Reviewed-by:Avi Drissman <avi@chromium.org> Reviewed-by:
Siye Liu <siliu@microsoft.com> Reviewed-by:
David Bokan <bokan@chromium.org> Reviewed-by:
Daniel Libby <dlibby@microsoft.com> Cr-Commit-Position: refs/heads/master@{#792914}
Showing
Please register or sign in to comment