-
Notifications
You must be signed in to change notification settings - Fork 65
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
Do 'triggered by user activation' check earlier #118
Conversation
Would prefer to do this check earlier in Gecko if possible. |
Safari does the check later, so Gecko will follow Chrome and Safari. |
IIRC the reason why this check comes after all the TypeErrors is a little dubious but deliberate: it makes it possible to write automated error tests that check for TypeErrors in the WPT suite. All tests that expect us to go past the user activation check have to be manual tests, because they will all fail if automated. If the user activation check is moved up ahead, all the automated tests will fail with NotAllowedError. |
This was solved on WTP via Web Driver and |
This came up again during review on the Gecko side... given that we can deal with this correctly on WTP, @mgiuca would you be willing to change the Blink implementation? |
Are you also proposing that I don't mind changing the order in the Blink implementation if that is the consensus. Any feedback from Safari? |
No. But in the related issue (I think #5), I discussed how to separate the concerns between sharing from canShare.
It's just convention in Gecko code and other APIs to do the "triggered by user activation" checks first - before doing all the data checks. So the benefit would be consistency with other APIs (and less Gecko reviewers telling me "move this up" 😂). |
It doesn't make sense for I think the reason Eric raises this is that
That definition wouldn't work if we moved the user activation check up. But I think Marcos also objected to that definition (somewhere else) and that we should define it properly by abstracting out the type checking. Which I can get behind. That aside, it also seems logical to me that the method would do input validation (i.e., checks that are pure mathematical function of the input) before doing extrinsic checks that rely on the state-of-the-world (i.e., checks about user activation).
If that's the case, is it also a convention in other web APIs (specs)? Can you point to other web specs that do user activation testing before input validation? If so, I'd be happy to change it. |
Indeed. I think it was #108.
That would be great. It means doing less gymnastics in our implementation.
I don't disagree... we kinda do this already:
But then we diverge on:
Some examples:
Somewhat in the middle:
|
Discussed offline; we are OK to keep it for now (those examples aren't particularly strong since they don't go TypeErrors after the activation check). |
For normative changes, the following tasks have been completed:
Implementation commitment: