New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 823227 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 7
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Spatnav picks the wrong element when in pinch-zoomed frames

Reported by hu...@vewd.com, Mar 19 2018

Issue description

What steps will reproduce the problem?
1. $ chrome --enable-spatial-navigation
2. Go to chrome://chrome-urls
3. Scroll the page to its vertical middle.
4. Open devtools and "Toggle device toolbar".
5. Use pinch-zoom to zoom the page.
6. Hit the UP-key.

What is the expected result?
Spatnav focuses the visual viewport's bottommost link.

What happens instead?
Spatnav focuses the layout viewport's (?) bottommost link (a link that is off screen).
 
Project Member

Comment 1 by bugdroid1@chromium.org, Sep 5

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/25bd39409db5b29888cf644991e61c09f6272aee

commit 25bd39409db5b29888cf644991e61c09f6272aee
Author: Hugo Holgersson <hugoh@vewd.com>
Date: Wed Sep 05 08:03:56 2018

Snav: Respect a pinch-zoomed viewport

Previously we used the *layout* viewport's rectangle to determine
if a certain node was visible or not. Let's use the *visual*
viewport instead. Now:

 A visible node is a node that intersects the visual viewport.

This logic is used by spatnav to rule out offscreen focus candidates
and an offscreen activeElement. When activeElement is offscreen,
spatnav doesn't use it as its search origin; the search will start
at an edge of the visual viewport instead.

For consistency, I replaced all other uses of LayoutViewport()
with GetScrollableArea() - even though fixing HasOffscreenRect()
was enough to fix  Issue 823227 .

Bug:  823227 
Change-Id: I8a89cfc98d896998b899a5246f2c38e23fe0171b
Reviewed-on: https://chromium-review.googlesource.com/1204094
Commit-Queue: Hugo Holgersson <hugoh@vewd.com>
Reviewed-by: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#588792}
[add] https://crrev.com/25bd39409db5b29888cf644991e61c09f6272aee/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-start-at-document-bottom.html
[modify] https://crrev.com/25bd39409db5b29888cf644991e61c09f6272aee/third_party/blink/renderer/core/page/spatial_navigation.cc
[modify] https://crrev.com/25bd39409db5b29888cf644991e61c09f6272aee/third_party/blink/renderer/core/page/spatial_navigation.h
[modify] https://crrev.com/25bd39409db5b29888cf644991e61c09f6272aee/third_party/blink/renderer/core/page/spatial_navigation_test.cc

Owner: hu...@vewd.com
Status: Fixed (was: Available)

Sign in to add a comment