Skip to content
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

Merged
merged 1 commit into from
Mar 31, 2022

Conversation

domenic
Copy link
Collaborator

@domenic domenic commented Feb 1, 2022

@domenic domenic force-pushed the focus-scrollrestoration-spec branch from e3d8a35 to da140c0 Compare February 4, 2022 19:48
spec.bs Outdated Show resolved Hide resolved
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 8, 2022
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
spec.bs Show resolved Hide resolved
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 14, 2022
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
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 14, 2022
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}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 14, 2022
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}
aarongable pushed a commit to chromium/chromium that referenced this pull request Feb 14, 2022
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}
mattwoodrow pushed a commit to mattwoodrow/wpt that referenced this pull request Feb 15, 2022
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}
DanielRyanSmith pushed a commit to DanielRyanSmith/wpt that referenced this pull request Feb 28, 2022
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}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Mar 8, 2022
…=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
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Mar 8, 2022
…=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",

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?

Copy link
Collaborator Author

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.

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?

Copy link
Collaborator Author

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 :).

@domenic domenic force-pushed the focus-scrollrestoration-spec branch from da140c0 to 3935bb1 Compare March 24, 2022 16:55
@domenic domenic marked this pull request as ready for review March 24, 2022 21:43
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 29, 2022
SFNSP = sequential focus navigation starting point.

This was noticed while writing the spec at
WICG/navigation-api#201.

Bug: 1183545
Change-Id: If13f3c12e9c6ef2dbed628a65b823754ae04cd3d
aarongable pushed a commit to chromium/chromium that referenced this pull request Mar 29, 2022
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}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 29, 2022
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}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 29, 2022
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}
@domenic domenic force-pushed the focus-scrollrestoration-spec branch from 9229a15 to e2843c9 Compare March 31, 2022 20:39
@domenic domenic merged commit dc20772 into main Mar 31, 2022
@domenic domenic deleted the focus-scrollrestoration-spec branch March 31, 2022 20:40
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Apr 2, 2022
…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
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Apr 5, 2022
…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
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this pull request Oct 14, 2022
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
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this pull request Oct 14, 2022
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants