Skip to content

Introduce FocusOptions.focusVisible. - #8087

Merged
domenic merged 2 commits into
whatwg:mainfrom
emilio:focus-visible
Jul 13, 2022
Merged

domenic merged 2 commits into
whatwg:mainfrom
emilio:focus-visible

Conversation

@emilio

@emilio emilio commented Jul 7, 2022 •

Copy link
Copy Markdown
Contributor

@emilio
emilio requested a review from domenic July 7, 2022 17:23
Comment thread source Resolved
Comment thread source Resolved
Comment thread source Resolved
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 11, 2022
As per:

 * whatwg/html#7830
 * whatwg/html#8087

Replace the internal preventFocusRing with the new flag.

Differential Revision: https://phabricator.services.mozilla.com/D151326

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1765083
gecko-commit: 570b38756541697f8b5c3b8084b5a2fb438eeca9
gecko-reviewers: smaug, pip-reviewers
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jul 12, 2022
Comment thread source Resolved
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 12, 2022
As per:

 * whatwg/html#7830
 * whatwg/html#8087

Replace the internal preventFocusRing with the new flag.

Differential Revision: https://phabricator.services.mozilla.com/D151326

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1765083
gecko-commit: 570b38756541697f8b5c3b8084b5a2fb438eeca9
gecko-reviewers: smaug, pip-reviewers
@domenic domenic added addition/proposal New features or enhancements topic: focus Focus, sequential focus navigation, tabindex, autofocus and inert labels Jul 13, 2022
@benface

benface commented Jan 4, 2023

Copy link
Copy Markdown

@emilio and @domenic – Is focusVisible: false the same as not setting it? I was hoping this option would allow preventing the focus ring from appearing, in cases where the browser heuristics would normally show it.

@emilio

emilio commented Jan 4, 2023

Copy link
Copy Markdown
Contributor Author

It is not the same, it does allow preventing it.

@benface

benface commented Jan 4, 2023

Copy link
Copy Markdown

Thanks for the fast response @emilio, I'm glad. Maybe the wording is a bit ambiguous? It only mentions what should happen when it's true.

@emilio

emilio commented Jan 4, 2023

Copy link
Copy Markdown
Contributor Author

The wording is rather clear IMO: "If it's true or not present but matches heuristic, indicate focus.". Thus, if it's explicitly false, you wouldn't indicate focus. But if you or @domenic have suggestions for clarification then those would be welcome :)

@benface

benface commented Jan 4, 2023

Copy link
Copy Markdown

Totally right @emilio, my brain is not working too well today. :)

jwidar pushed a commit to jwidar/LatencyZeroGithub that referenced this pull request Sep 16, 2025
aarongable pushed a commit to chromium/chromium that referenced this pull request Dec 2, 2025
This CL implements the FocusOptions dictionary's `focusVisible` member
which was standardized in whatwg/html#8087.
Supplying `focusVisible: true` forces the focus ring to be painted
around the newly-focused element and match the `:focus-visible`
pseudo-class, and supplying `focusVisible: false` ensures the ring is
never painted and that the pseudo-class never matches

See https://chromestatus.com/feature/5612989944299520 and the
Intent to Ship:
https://groups.google.com/a/chromium.org/g/blink-dev/c/OptbQ7cGx4A.

R=masonf

Bug: 462191849
Change-Id: I5f560db9f20a84d51ffd192790f2605cba8ec45c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7178200
Commit-Queue: Dominic Farolino <[email protected]>
Reviewed-by: Mason Freed <[email protected]>
Reviewed-by: Luke <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1552936}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addition/proposal New features or enhancements topic: focus Focus, sequential focus navigation, tabindex, autofocus and inert

Development

Successfully merging this pull request may close these issues.

Proposal: extend FocusOptions to allow specifying :focus-visible behavior.

3 participants