-
Notifications
You must be signed in to change notification settings - Fork 37
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
Link to the HTML spec's "has focus steps". #143
Conversation
This clarifies what "currently focused" means.
@domenic @garykac can you review this? More context at WICG/nav-speculation#55 |
@@ -1171,7 +1171,7 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn; | |||
handlers) and data can be accessed in the absence of a user provided gesture. | |||
|
|||
To help prevent abuse, this API <em>must not</em> be available unless the script | |||
is executing in the context of the currently focused document. | |||
is executing in the context of a document that [=has focus steps|has focus=]. |
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.
Documents don't have focus. Specific elements inside them, or focusable areas, have focus.
Is this supposed to be about the browsing context having system focus?
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.
LGTM, although ideally this would be in the actual algorithms instead of a magic patch at a distance from the privacy section of the spec. (That's a preexisting problem though, and not really in scope for you to fix...)
Thanks. I believe the original intent of the text is about system focus. I'm not sure about one thing. Document.hasFocus() exists and uses https://html.spec.whatwg.org/multipage/interaction.html#has-focus-steps which looked convenient as it checks for system focus in the first step. I'm not sure if the other steps are needed. I just changed it to use system focus directly. Do you know what is going on here? |
The other steps handle iframe nesting cases. If you call
In non-iframe cases, target's BC = target's BC's TLBC, so candidate = target so the loop quits immediately. |
I see. I wonder if the Clipboard spec also wants to disallow the API in iframes that don't have focus. In that case, would returning to "has focus steps" be better? |
Yes, that's a good point. Although you could make an argument for either behavior, probably the clipboard API spec authors intended the I apologize for not reading your original PR closer. I think I assumed "has focus steps" was a link to https://html.spec.whatwg.org/#focused, but it's document-specific. So we should probably revert to your original. |
No worries, I returned to "has focus steps" then. @garykac does this look good to you? |
Oh weird, I have write access, strange... I'd love it if we could get an editor to sign off before I touch anything though :). |
Adding links like this is great because it will make the (eventual) conversion to a more algorithmic spec easier. Thanks! |
The Clipboard API requires system focus as clarified in w3c/clipboard-apis#143.
The Clipboard API requires system focus as clarified in w3c/clipboard-apis#143.
This clarifies what "currently focused" means.
Preview | Diff