-
Notifications
You must be signed in to change notification settings - Fork 689
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
[css-nav-1] Clarify the condition of focusable element #3395
Comments
The additional condition needs to be considered:
Also, we need to follow up the discussion whatwg/html#4464 in WHATWG |
IMO, things users can't see should not be navigable. Nodes with a key- or click handler most likely needs to be navigable. Some web apps use one "catch all"-click handler, often put on |
I don't think we need to redefine what it means to be focusable. We should instead restrict spatial navigation such that "focusable" is required but not sufficient. i.e. The element must be focusable as well as visible. I believe Chrome's implementation already does this. |
Background: Some web apps use one "catch all"-click handler, often put on <body> or a container <div>, to react on clicks within certain areas of the page. These web pages expect clicks (or touches) and are not designed with key[board] users in mind (they lack tabindex). These pages' clickables, for example <div>s that look like buttons, are often styled with {cursor: pointer}. Problem: These web pages are inaccessible for keyboard-only users. Solution: Enable SpatNav on these web apps by adding {cursor: pointer} sub trees' tip to the list of navigation candidates. Spec discussion: w3c/csswg-drafts#3395 Note: snav-imagemap-area-not-focusable.html found a bug in Chrome's UA CSS. We used to style *all* <area>s as clickables, with {cursor: pointer}, even those without a href-attribute. I fixed this in crrev.com/c/1653009. Bug: None Change-Id: I7baa2ba6f5f36ebc23b072d677edc66acfb2a70b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1632231 Commit-Queue: Hugo Holgersson <hholgersson@fb.com> Reviewed-by: David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/master@{#669193}
Background: Some web apps use one "catch all"-click handler, often put on <body> or a container <div>, to react on clicks within certain areas of the page. These web pages expect clicks (or touches) and are not designed with key[board] users in mind (they lack tabindex). These pages' clickables, for example <div>s that look like buttons, are often styled with {cursor: pointer}. Problem: These web pages are inaccessible for keyboard-only users. Solution: Enable SpatNav on these web apps by adding {cursor: pointer} sub trees' tip to the list of navigation candidates. Spec discussion: w3c/csswg-drafts#3395 Note: snav-imagemap-area-not-focusable.html found a bug in Chrome's UA CSS. We used to style *all* <area>s as clickables, with {cursor: pointer}, even those without a href-attribute. I fixed this in crrev.com/c/1653009. (cherry picked from commit 308a300) Bug: 961927 Change-Id: I7baa2ba6f5f36ebc23b072d677edc66acfb2a70b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1632231 Commit-Queue: Hugo Holgersson <hholgersson@fb.com> Reviewed-by: David Bokan <bokan@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#669193} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1662868 Cr-Commit-Position: refs/branch-heads/3809@{#375} Cr-Branched-From: d82dec1-refs/heads/master@{#665002}
I agree that in the spatial navigation spec, we don't need to redefine the "focusables".
|
Cool. Yeah, I think that's a good to mention in the spec. In Chrome, this is not only on "keydown" but also on "keyup", "keypress" and on "click". See https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/dom/element.cc?type=cs&q=function:SupportsSpatialNavigationFocus&sq=package:chromium. I think we should mention all of them, in that case. I also think we should mention that |
Background: Some web apps use one "catch all"-click handler, often put on <body> or a container <div>, to react on clicks within certain areas of the page. These web pages expect clicks (or touches) and are not designed with key[board] users in mind (they lack tabindex). These pages' clickables, for example <div>s that look like buttons, are often styled with {cursor: pointer}. Problem: These web pages are inaccessible for keyboard-only users. Solution: Enable SpatNav on these web apps by adding {cursor: pointer} sub trees' tip to the list of navigation candidates. Spec discussion: w3c/csswg-drafts#3395 Note: snav-imagemap-area-not-focusable.html found a bug in Chrome's UA CSS. We used to style *all* <area>s as clickables, with {cursor: pointer}, even those without a href-attribute. I fixed this in crrev.com/c/1653009. (cherry picked from commit 308a300) (cherry picked from commit b2f29c7) Bug: 961927 Change-Id: I7baa2ba6f5f36ebc23b072d677edc66acfb2a70b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1632231 Commit-Queue: Hugo Holgersson <hholgersson@fb.com> Reviewed-by: David Bokan <bokan@chromium.org> Cr-Original-Original-Commit-Position: refs/heads/master@{#669193} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1662868 Cr-Original-Commit-Position: refs/branch-heads/3809@{#375} Cr-Original-Branched-From: d82dec1-refs/heads/master@{#665002} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1662837 Cr-Commit-Position: refs/branch-heads/3770@{#1032} Cr-Branched-From: a9eee1c-refs/heads/master@{#652427}
Currently, the spec defines the focusable elements depending on the HTML Spec.
But there are some missing parts for considering what is focusable for the spatial navigation.
For example, the element specified with "
visibility: hidden
", is it a focusable or not?This matters when we get the result of
focusableAreas({ mode: "all" })
, the result will includethe elements with
visibility: hidden
ordisplay: none
.There is more detailed description about the Focusable Element.
: https://allyjs.io/data-tables/focusable.html#css-property-visibility
We need to refer it and make it clear about the condition of focusable in the spatial navigation.
The text was updated successfully, but these errors were encountered: