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

Issue 804242 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Offscreen image-maps gets priority

Reported by hu...@vewd.com, Jan 22 2018

Issue description

Chrome Version: All with spatnav?

What steps will reproduce the problem?
(1) Focus an image-map's <area>.
(2) Scroll the image-map off screen.
(3) Use an arrow-key (trigger spatnav).

What is the expected result?
A focusable in the visual viewport gets focus. No scrolling.

What happens instead?
Spatnav gives the image-map focus and scrolls to it.


 

Comment 1 by hu...@vewd.com, Jan 22 2018

Labels: spatial-navigation
Project Member

Comment 2 by bugdroid1@chromium.org, Jan 23 2018

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

commit 511906d0604cdd92df8aa077b82c51aa1a298525
Author: Hugo Holgersson <hugoh@vewd.com>
Date: Tue Jan 23 15:54:32 2018

Snav: Always search for focusables in visual viewport first

By initializing starting_rect to one of the visual viewport's
edges we don't need to recalculate this value every time
AdvanceFocusDirectionallyInContainer iterates.

Q: So now we always use the frame's visual viewport when the
   focused element is off screen?

A: Yes. The visual viewport is the default starting point for
   snav's search. This was already the implicit behavior users
   relied on (see bug).
   When the focused element F is off screen (say JS scrolled
   <body> downwards) we want spatnav to first look for already
   visible focusables, i.e not go to focusables nearby F because
   that will cause the window to scroll (bad UX).

This lets users reach things that they can _see_ first.

       snav-ignore-offscreen-focused-imagemap.html (NEW)

Bug: 770147,  796493 ,  804242 
Tests: snav-use-visual-viewport.html,
Change-Id: Iaa861d3f75effe14eac558e2214dbc3af2df365b
Reviewed-on: https://chromium-review.googlesource.com/873645
Commit-Queue: Hugo Holgersson <hugoh@vewd.com>
Reviewed-by: Stefan Zager <szager@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531249}
[add] https://crrev.com/511906d0604cdd92df8aa077b82c51aa1a298525/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-ignore-offscreen-focused-imagemap.html
[modify] https://crrev.com/511906d0604cdd92df8aa077b82c51aa1a298525/third_party/WebKit/Source/core/page/FocusController.cpp
[modify] https://crrev.com/511906d0604cdd92df8aa077b82c51aa1a298525/third_party/WebKit/Source/core/page/SpatialNavigation.cpp
[modify] https://crrev.com/511906d0604cdd92df8aa077b82c51aa1a298525/third_party/WebKit/Source/core/page/SpatialNavigation.h

Comment 3 by hu...@vewd.com, Jan 23 2018

Status: Fixed (was: Started)

Sign in to add a comment