-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
WPT testing non-standard behavior for popover focusing steps #8994
Comments
So I looked a bit into this, I think this was trying to match the updated dialog focusing steps, notably this step:
I don't think we should follow the same pattern as dialog here. This is a step specific to modal dialogs, because they render the rest of the page inert, so it isn't relevant to popovers. cc @scottaohara @domenic as well for opinions. |
Ah, seems like Chromium doesn't use the focus delegate, but rather the autofocus delegate, in which case the ternary makes slightly more sense? Still though, the spec says to use the focus delegate, not the autofocus delegate. |
Ah ok, I see the "given other and true", the "and true" part refers to the autofocusOnly argument. Not sure why we can't refer to the autofocus delegate directly though. |
#8998 cleans this up a bit. It refers to the autofocus delegate directly (and adapts the definition a bit to match), and adds the extra step that Chromium does to matches to target the popover itself it has the autofocus attribute. |
I tried using autofocus delegate instead of focus delegate in chromium and it didn't make any tests fail, so I'm generally supportive. I am working on additional tests for shadowdom. I think that using autofocus delegate may also make it easier to account for nested autofocus popovers/dialogs which I implemented but haven't specced yet. |
I wrote some WPTs for this behavior: web-platform-tests/wpt#38994 |
Refer to the autofocus delegate directly and add an extra step which focuses the popover itself if it has the autofocus attribute. Fixes #8994.
Refer to the autofocus delegate directly and add an extra step which focuses the popover itself if it has the autofocus attribute. Fixes whatwg#8994.
Refer to the autofocus delegate directly and add an extra step which focuses the popover itself if it has the autofocus attribute. Fixes whatwg#8994.
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_element.cc;drc=74c5b3d45c81fcc9c5cd86213c8c265335e6e1a6;l=1799
The ternary checking if the popover is autofocusable is not specified in the spec.
Is this intentional behavior? If so, should it be specified or should the implementation+WPT be adapted to match?
The relevant WPT is: html/semantics/popovers/popover-focus.html
cc @mfreed7 @josepharhar @annevk
The text was updated successfully, but these errors were encountered: