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

Issue 804669 link

Starred by 2 users

Issue metadata

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



Sign in to add a comment

Focus goes to incorrect element when activeElement is clipped in a scrolled div

Project Member Reported by junho092...@lge.com, Jan 23 2018

Issue description

1)
Testing step:
1. Load container_offscreen2.html
2. Hit down key until 'asdf' string is shown in overflow area.
3. Hit down key once again.

Expected result:
Focus should move to bottom most element.

Actual result:
Focus move to top most element.


2)
Another test case

Testing step:
1. Load container_offscreen3.html
2. Hit down key until 'asdf' string is shown in overflow area.
3. Hit down key once again.

Expected result
Focus should move to right button.

Actual result:
Focus moved to left button.
 
container_offscreen2.html
1010 bytes View Download
container_offscreen3.html
1.0 KB View Download

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

Cc: hu...@vewd.com
Components: Blink>HTML>Focus
Status: Available (was: Untriaged)

Comment 2 by hu...@vewd.com, Jan 24 2018

Status: Started (was: Available)
Work-in-progress at https://chromium-review.googlesource.com/c/chromium/src/+/883533.

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

Owner: junho092...@lge.com
Status: Assigned (was: Started)

Comment 4 by hu...@vewd.com, Mar 17 2018

Cc: -hu...@vewd.com junho092...@lge.com
Owner: hu...@vewd.com
Status: Started (was: Assigned)
Summary: Focus goes to incorrect element when activeElement is offscreen (was: Snav: Focus is moved to incorrect element after focused element be offscreen.)
Summary: Focus goes to incorrect element when activeElement is clipped in a scrolled div (was: Focus goes to incorrect element when activeElement is offscreen)
Project Member

Comment 7 by bugdroid1@chromium.org, Sep 7

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

commit d6a58cc148802a2f3895d8a5a1cd2e6270f176cc
Author: Hugo Holgersson <hugoh@vewd.com>
Date: Fri Sep 07 13:40:42 2018

Snav: Define search origin as the first visible focus-container

 Scenario for bug:
  1. The focused element F is inside a scrollable area A.
  2. F is offscreen (=clipped) but A is (partly) visible.

 Problem:
  Spatnav started to search from the document's edge, not
  from A's edge.

 Solution:
  Set the "search origin" to one of A's outer edges.

To solve this problem we redefine the "search origin" of
spatial navigation. The search origin is either activeElement
itself, if it's being at least partially visible, or its
first [partially] visible scroller.

If both F and its enclosing scroller A are completely
offscreen, we recurse to the scroller’s scroller up until
the root frame's document. The root document is a good base
case because it's, per definition, a visible scrollable area.

This builds onto the idea of:
https://chromium-review.googlesource.com/c/chromium/src/+/873645

Bug:  804669 

Change-Id: I15b0f41426d7632fe9ec62d77a414d592e3631c0
Reviewed-on: https://chromium-review.googlesource.com/883533
Commit-Queue: Hugo Holgersson <hugoh@vewd.com>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#589502}
[add] https://crrev.com/d6a58cc148802a2f3895d8a5a1cd2e6270f176cc/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-search-beneath-exited-scroller.html
[modify] https://crrev.com/d6a58cc148802a2f3895d8a5a1cd2e6270f176cc/third_party/blink/renderer/core/page/focus_controller.cc
[modify] https://crrev.com/d6a58cc148802a2f3895d8a5a1cd2e6270f176cc/third_party/blink/renderer/core/page/spatial_navigation.cc
[modify] https://crrev.com/d6a58cc148802a2f3895d8a5a1cd2e6270f176cc/third_party/blink/renderer/core/page/spatial_navigation.h
[modify] https://crrev.com/d6a58cc148802a2f3895d8a5a1cd2e6270f176cc/third_party/blink/renderer/core/page/spatial_navigation_test.cc

Status: Fixed (was: Started)
Project Member

Comment 9 by bugdroid1@chromium.org, Sep 25

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

commit 641f53f758bd2220e5749570c78e794f1daa24ed
Author: Hugo Holgersson <hugoh@vewd.com>
Date: Tue Sep 25 14:52:12 2018

Snav: Use a shorthand to find the user's visual viewport

This is a post-landing simplification of:
https://chromium-review.googlesource.com/c/chromium/src/+/883533

The root frame's visual rect (in root frame space) == VisualViewport's VisibleRect().

Bug:  804669 
Change-Id: I264332bd57d2130cd265155fe0e6884757d5ce2b
Reviewed-on: https://chromium-review.googlesource.com/1240276
Commit-Queue: Hugo Holgersson <hugoh@vewd.com>
Reviewed-by: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593931}
[modify] https://crrev.com/641f53f758bd2220e5749570c78e794f1daa24ed/third_party/blink/renderer/core/page/spatial_navigation.cc
[modify] https://crrev.com/641f53f758bd2220e5749570c78e794f1daa24ed/third_party/blink/renderer/core/page/spatial_navigation_test.cc

Sign in to add a comment