-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Feature Policy: focus-without-user-activation
#10672
base: main
Are you sure you want to change the base?
Conversation
Cherry-picked from whatwg#4585
… policy is disabled.
There are more APIs that call the focusing steps. For example |
…d `popover focusing steps`
This is a good catch. I added extra steps in |
There seem to be more APIs than just the above ones that reference "focusing steps".
Were you able to go through all of them and confirm that the ones you are updating herewith are the only ones that need updates? |
Could you mark the entries in the checklist that have been completed via |
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.
This looks reasonable, but it looks like you got in a race with the bot when updating OP. Each time you make an edit (including checking a checkbox) the bot will run. So it's best to click edit and change it all in one go and then wait for the bot to update before making another change.
Though also, if you filed bugs against Gecko/WebKit those need to be linked.
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.
I found some more substantial issues. Please also create an MDN issue.
source
Outdated
activation</span> and is not triggered by script execution from <var>current</var>'s | ||
<span>ancestor navigables</span>, and <var>current</var>'s <span>active document</span> is not |
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.
"triggered by script execution" is not a concept that exists or is defined. It's rather unclear to me what this is trying to accomplish.
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.
I revised the wording to reflect more details. What I was trying to accomplish is to say that the focus algorithm is triggered by another call of focus() method on it's parent.
focus-without-user-activation
is a new feature policy that can be used to block programmatic focus changes that are not triggered through user activation (explainer).The motivation behind this feature policy is to provide better security for websites that embed third party contexts.
This change makes modifications to the following focus API:
autofocus
element.focus(options)
window.focus()
The WHATWG resolved to add a new feature policy,
focus-without-user-activation
, to control whether third-party iframes can take focus programmatically. (w3c/webappsec-permissions-policy#273 (comment))The original PR contains all prior discussions regarding the feature policy. However, since I don't have editor access to it, I've created this new PR.
focus-without-user-activation
feature policy mozilla/standards-positions#1080focus-without-user-activation
feature policy WebKit/standards-positions#406(See WHATWG Working Mode: Changes for more details.)
/acknowledgements.html ( diff )
/infrastructure.html ( diff )
/interaction.html ( diff )
/interactive-elements.html ( diff )
/popover.html ( diff )