-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spec for focusReset and scrollRestoration #201
Conversation
e3d8a35
to
da140c0
Compare
Based on the draft at WICG/navigation-api#201. This includes handling multiple conflicting focusReset options, with a console warning if necessary. Limitations, to be addressed in future commits: * This does not take into account autofocus="" elements. * This will reset focus even if the user has moved focus in the meantime. Bug: 1183545 Change-Id: I1eae4fc58af653fa7e463a1346a9bebc9536a59f
Based on the draft at WICG/navigation-api#201. This includes handling multiple conflicting focusReset options, with a console warning if necessary. Limitations, to be addressed in future commits: * This does not take into account autofocus="" elements. * This will reset focus even if the user has moved focus in the meantime. Bug: 1183545 Change-Id: I1eae4fc58af653fa7e463a1346a9bebc9536a59f
Based on the draft at WICG/navigation-api#201. This includes handling multiple conflicting focusReset options, with a console warning if necessary. Limitations, to be addressed in future commits: * This does not take into account autofocus="" elements. * This will reset focus even if the user has moved focus in the meantime. Bug: 1183545 Change-Id: I1eae4fc58af653fa7e463a1346a9bebc9536a59f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3441109 Reviewed-by: Nate Chapin <japhet@chromium.org> Commit-Queue: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/main@{#970838}
Based on the draft at WICG/navigation-api#201. This includes handling multiple conflicting focusReset options, with a console warning if necessary. Limitations, to be addressed in future commits: * This does not take into account autofocus="" elements. * This will reset focus even if the user has moved focus in the meantime. Bug: 1183545 Change-Id: I1eae4fc58af653fa7e463a1346a9bebc9536a59f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3441109 Reviewed-by: Nate Chapin <japhet@chromium.org> Commit-Queue: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/main@{#970838}
Based on the draft at WICG/navigation-api#201. This includes handling multiple conflicting focusReset options, with a console warning if necessary. Limitations, to be addressed in future commits: * This does not take into account autofocus="" elements. * This will reset focus even if the user has moved focus in the meantime. Bug: 1183545 Change-Id: I1eae4fc58af653fa7e463a1346a9bebc9536a59f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3441109 Reviewed-by: Nate Chapin <japhet@chromium.org> Commit-Queue: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/main@{#970838}
Based on the draft at WICG/navigation-api#201. This includes handling multiple conflicting focusReset options, with a console warning if necessary. Limitations, to be addressed in future commits: * This does not take into account autofocus="" elements. * This will reset focus even if the user has moved focus in the meantime. Bug: 1183545 Change-Id: I1eae4fc58af653fa7e463a1346a9bebc9536a59f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3441109 Reviewed-by: Nate Chapin <japhet@chromium.org> Commit-Queue: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/main@{#970838}
Based on the draft at WICG/navigation-api#201. This includes handling multiple conflicting focusReset options, with a console warning if necessary. Limitations, to be addressed in future commits: * This does not take into account autofocus="" elements. * This will reset focus even if the user has moved focus in the meantime. Bug: 1183545 Change-Id: I1eae4fc58af653fa7e463a1346a9bebc9536a59f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3441109 Reviewed-by: Nate Chapin <japhet@chromium.org> Commit-Queue: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/main@{#970838}
…=testonly Automatic update from web-platform-tests App history: basic focusReset support Based on the draft at WICG/navigation-api#201. This includes handling multiple conflicting focusReset options, with a console warning if necessary. Limitations, to be addressed in future commits: * This does not take into account autofocus="" elements. * This will reset focus even if the user has moved focus in the meantime. Bug: 1183545 Change-Id: I1eae4fc58af653fa7e463a1346a9bebc9536a59f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3441109 Reviewed-by: Nate Chapin <japhet@chromium.org> Commit-Queue: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/main@{#970838} -- wpt-commits: e6bbf057e52677c2f90fc22925673e3ca72bcd69 wpt-pr: 32750
…=testonly Automatic update from web-platform-tests App history: basic focusReset support Based on the draft at WICG/navigation-api#201. This includes handling multiple conflicting focusReset options, with a console warning if necessary. Limitations, to be addressed in future commits: * This does not take into account autofocus="" elements. * This will reset focus even if the user has moved focus in the meantime. Bug: 1183545 Change-Id: I1eae4fc58af653fa7e463a1346a9bebc9536a59f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3441109 Reviewed-by: Nate Chapin <japhet@chromium.org> Commit-Queue: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/main@{#970838} -- wpt-commits: e6bbf057e52677c2f90fc22925673e3ca72bcd69 wpt-pr: 32750
}; | ||
|
||
enum AppHistoryFocusReset { | ||
"after-transition", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify, with this value, what would happen if the user-land code would display:none
a previously focused element? Would the document.activeElement
and focus
, focusin
, etc events all be delayed until after the transition is complete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that would immediately reset the focus (since the focus changed). Then, after the transition completes, if focus hasn't been moved manually, focus would get reset again to the first autofocus="" element or to the body.
spec.bs
Outdated
|
||
<p>The given |newNavigationAction| promise is used to signal the duration, and success or failure, of the navigation. After it settles, the browser signals to the user (e.g. via a loading spinner UI, or assistive technology) that the navigation is finished. Additionally, it fires {{AppHistory/navigatesuccess}} or {{AppHistory/navigateerror}} events as appropriate, which other parts of the web application can respond to. | ||
|
||
<p>By default, using this method will cause focus to reset when the |newNavigationAction| promise (and any other promises passed in other calls to {{AppHistoryNavigateEvent/transitionWhile()}}) settle. Focus will be reset to the first element with the <{html-global/autofocus}> attribute set, or the <{body}> element if the attribute isn't present. The {{AppHistoryTransitionWhileOptions/focusReset}} option can be set to "{{AppHistoryFocusReset/manual}}" to avoid this behavior. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Elsewhere we discussed that maybe if the currently focused element didn't end up display:none
or content-visibility:hidden
or removed from DOM entirely - perhaps it should stay focused? Or would we leave it to the "manual" mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is the exact meaning of the "manual" mode :).
da140c0
to
3935bb1
Compare
SFNSP = sequential focus navigation starting point. This was noticed while writing the spec at WICG/navigation-api#201. Bug: 1183545 Change-Id: If13f3c12e9c6ef2dbed628a65b823754ae04cd3d
SFNSP = sequential focus navigation starting point. This was noticed while writing the spec at WICG/navigation-api#201. Bug: 1183545 Change-Id: If13f3c12e9c6ef2dbed628a65b823754ae04cd3d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3550462 Reviewed-by: Nate Chapin <japhet@chromium.org> Commit-Queue: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/main@{#986705}
SFNSP = sequential focus navigation starting point. This was noticed while writing the spec at WICG/navigation-api#201. Bug: 1183545 Change-Id: If13f3c12e9c6ef2dbed628a65b823754ae04cd3d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3550462 Reviewed-by: Nate Chapin <japhet@chromium.org> Commit-Queue: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/main@{#986705}
SFNSP = sequential focus navigation starting point. This was noticed while writing the spec at WICG/navigation-api#201. Bug: 1183545 Change-Id: If13f3c12e9c6ef2dbed628a65b823754ae04cd3d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3550462 Reviewed-by: Nate Chapin <japhet@chromium.org> Commit-Queue: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/main@{#986705}
9229a15
to
e2843c9
Compare
…SFNSP, a=testonly Automatic update from web-platform-tests Navigation API: focusReset should reset SFNSP SFNSP = sequential focus navigation starting point. This was noticed while writing the spec at WICG/navigation-api#201. Bug: 1183545 Change-Id: If13f3c12e9c6ef2dbed628a65b823754ae04cd3d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3550462 Reviewed-by: Nate Chapin <japhet@chromium.org> Commit-Queue: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/main@{#986705} -- wpt-commits: 9ab820e5ba017bac6d8729281c983618b79b7637 wpt-pr: 33408
…SFNSP, a=testonly Automatic update from web-platform-tests Navigation API: focusReset should reset SFNSP SFNSP = sequential focus navigation starting point. This was noticed while writing the spec at WICG/navigation-api#201. Bug: 1183545 Change-Id: If13f3c12e9c6ef2dbed628a65b823754ae04cd3d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3550462 Reviewed-by: Nate Chapin <japhet@chromium.org> Commit-Queue: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/main@{#986705} -- wpt-commits: 9ab820e5ba017bac6d8729281c983618b79b7637 wpt-pr: 33408
Based on the draft at WICG/navigation-api#201. This includes handling multiple conflicting focusReset options, with a console warning if necessary. Limitations, to be addressed in future commits: * This does not take into account autofocus="" elements. * This will reset focus even if the user has moved focus in the meantime. Bug: 1183545 Change-Id: I1eae4fc58af653fa7e463a1346a9bebc9536a59f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3441109 Reviewed-by: Nate Chapin <japhet@chromium.org> Commit-Queue: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/main@{#970838} NOKEYCHECK=True GitOrigin-RevId: d9ba2f92e64c9c06554722bf4c767b3004bbbe3c
SFNSP = sequential focus navigation starting point. This was noticed while writing the spec at WICG/navigation-api#201. Bug: 1183545 Change-Id: If13f3c12e9c6ef2dbed628a65b823754ae04cd3d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3550462 Reviewed-by: Nate Chapin <japhet@chromium.org> Commit-Queue: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/main@{#986705} NOKEYCHECK=True GitOrigin-RevId: 2bd9bbfa97719851dd07498308d8b06c3321d7f4
Preview | Diff