From 52eb49b87c83d1307e4e6492a8a48427e03c07d8 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Tue, 29 Mar 2022 21:32:23 +0000 Subject: [PATCH] Navigation API: focusReset should reset SFNSP SFNSP = sequential focus navigation starting point. This was noticed while writing the spec at https://github.com/WICG/navigation-api/pull/201. Bug: 1183545 Change-Id: If13f3c12e9c6ef2dbed628a65b823754ae04cd3d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3550462 Reviewed-by: Nate Chapin Commit-Queue: Domenic Denicola Cr-Commit-Position: refs/heads/main@{#986705} NOKEYCHECK=True GitOrigin-RevId: 2bd9bbfa97719851dd07498308d8b06c3321d7f4 --- .../core/navigation_api/navigation_api.cc | 1 + .../wpt/navigation-api/focus-reset/basic.html | 2 ++ .../focus-reset/multiple-transitionWhile.html | 2 ++ .../focus-reset/resources/helpers.mjs | 32 +++++++++++++++++-- 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/blink/renderer/core/navigation_api/navigation_api.cc b/blink/renderer/core/navigation_api/navigation_api.cc index c04234740d2..519c7fb810d 100644 --- a/blink/renderer/core/navigation_api/navigation_api.cc +++ b/blink/renderer/core/navigation_api/navigation_api.cc @@ -102,6 +102,7 @@ class NavigateReaction final : public ScriptFunction::Callable { focus_delegate->focus(); } else { document->ClearFocusedElement(); + document->SetSequentialFocusNavigationStartingPoint(nullptr); } } diff --git a/blink/web_tests/external/wpt/navigation-api/focus-reset/basic.html b/blink/web_tests/external/wpt/navigation-api/focus-reset/basic.html index 8a62d88ba65..1ffaa022ee4 100644 --- a/blink/web_tests/external/wpt/navigation-api/focus-reset/basic.html +++ b/blink/web_tests/external/wpt/navigation-api/focus-reset/basic.html @@ -1,6 +1,8 @@ + + + +