Skip to content
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

[Meta issue] Fix external references to HTML user activation behavior #5129

Open
13 of 14 tasks
mustaqahmed opened this issue Dec 5, 2019 · 18 comments
Open
13 of 14 tasks

Comments

@mustaqahmed
Copy link
Contributor

mustaqahmed commented Dec 5, 2019

We have just landed the revamped user activation model in the HTML spec, closing #1903 and #3859. It's time to fix other specs that refer to the old activation model. (Note that the PR above fixes the references within the HTML spec.)

We will track the overall progress of the work (in other specs) through this meta-issue. Each of those other specs will still need its own tracking issue; this meta-issue will simply link to the external issues.


[Last update: 2021-Apr-15] Here is a task list for external APIs mentioned in this thread below. We will try to keep the list updated (manually) to ease progress tracking:

  • Permissions.
  • Vibration.
  • WebBluetooth.
  • WebUSB.
  • Clipboard API.
  • Payment Request.
  • Fullscreen.
  • Web NFC.
  • WebAudio.
  • Web Share.
  • Picture-in-picture.
  • Media session.
  • PointerLock.
  • Wake Lock.
@mustaqahmed
Copy link
Contributor Author

FYI for other spec owners: we will need to rewrite the dependency on user activation using the new classification as a guide.

Here is a quick rule of thumb, but each spec still needs a careful look for corner cases: most other specs we checked refer to the old model using something like "allow the API when triggered by user activation/user gesture"; we will need to replace the phrase with "allow the API when (a specific) Window has transient or sticky user activation". (In a few cases we may also need to add "...then consume the user activation").

Please reach out to us (@domenic or me) for API specific guidance.

@mustaqahmed
Copy link
Contributor Author

User activation in Permissions API: w3c/permissions#194

@mustaqahmed
Copy link
Contributor Author

Vibration API: WICG/interventions#47

@mustaqahmed
Copy link
Contributor Author

WebBluetooth: WebBluetoothCG/web-bluetooth#463

@mustaqahmed
Copy link
Contributor Author

WebUSB: WICG/webusb#178

@mustaqahmed
Copy link
Contributor Author

Clipboard API: w3c/clipboard-apis#107

@mustaqahmed
Copy link
Contributor Author

Payment Request API: w3c/payment-request#883

@marcoscaceres
Copy link
Member

Payment Request and Wake Lock API also need guidance 🙏 (sorry for lack of links, on phone). Once I understand a bit more I’ll also be able to help with the updates.

@mustaqahmed
Copy link
Contributor Author

mustaqahmed commented Dec 5, 2019

Fullscreen: whatwg/fullscreen#160

(Edited the issue reference, the old one was about changing a current fullscreen behavior.)

@marcoscaceres

This comment has been minimized.

@marcoscaceres
Copy link
Member

marcoscaceres commented Dec 6, 2019

Just notes as I'm working on updating specs:

  • we should probably export "Transient activation-gated APIs"

That would allow other specs to say in the Privacy/Sec sections, "The X API is a [=Transient activation-gated API=]."

Moar thinking out loud, what would have been cool is a WebIDL extended attribute:

interface PaymentRequest {
   [Activation="transient"] Promise show();
};

then the WebIDL can find the Window, do the check, and throw the SecurityError DOMException.

@marcoscaceres
Copy link
Member

I think "expired" need to be exported also, no?

I feel like I want to write:

   If the method was not triggered by [=window/transient activation=], 
   or the window [=window/has an expired transient activation=], 
   return [=a promise rejected with=] with a {{"SecurityError"}} {{DOMException}}.

Also, the spec text seems to imply that "transient activation" is always bound to a Window? (i.e., data-for=Window?) Or am I misreading?

@marcoscaceres
Copy link
Member

Guidance that should also be provided is the best way to pull the window from the context object.

@marcoscaceres
Copy link
Member

marcoscaceres commented Dec 6, 2019

Ok, so, might be good to add a note that Editor's don't need to check for "expired"... I definitely think we should provide guidance on getting the Window object from inside a method.

I reached for:

Let |window| be the [=relevant global object=] of the [=environment settings object/responsible document=].

But I'm unsure if that's "best practice"™️.

@beaufortfrancois
Copy link

Web NFC: w3c/web-nfc#449

@padenot
Copy link

padenot commented Dec 9, 2019

Web Audio API: WebAudio/web-audio-api#2107

padenot referenced this issue in padenot/web-audio-api Dec 19, 2019
This is intentionaly vague to not restrict implementors: it's plausible
that an implementation chooses to be transient or sticky here.

This fixes WebAudio#2107.

Address comments from Marcos

Don't use explicit link, and follow the guideline in https://github.com/whatwg/html/issues/5129\#issuecomment-562210730
padenot referenced this issue in WebAudio/web-audio-api Dec 19, 2019
This is intentionaly vague to not restrict implementors: it's plausible
that an implementation chooses to be transient or sticky here.

This fixes #2107.

Address comments from Marcos

Don't use explicit link, and follow the guideline in https://github.com/whatwg/html/issues/5129\#issuecomment-562210730
tidoust added a commit to tidoust/picture-in-picture that referenced this issue Jan 14, 2020
Minor editorial updates to fix a few broken links and correct references:
- Drop custom definitions that are no longer needed
- Replace "triggered by user activation" with new user activation model
(see whatwg/html#5129)
- Use back ticks for values instead of var shorthand
- Drop link to feature name in Feature Policy (term no longer exists)
tidoust added a commit to tidoust/mediasession that referenced this issue Jan 14, 2020
A few editorial updates to fix a few broken links and references:
- Drop custom dfns that are no longer needed (fixes a few outdated fragments
and allows to see which additional dfns the spec needs on top of those that the
referenced specs export)
- Replace "triggered by user activation" with new user activation model
(see whatwg/html#5129). This may warrant another
iteration as I'm not clear whether we're supposed to call the "activation
notification" steps
- Update definition of methods to fix IDL links
- Update reference to Web App Manifest and flag the paragraph as informative
- Fix links to "action"
@mustaqahmed
Copy link
Contributor Author

We have collected a set of general tips in this doc: User Activation: Guidance for spec authors.

We will try our best to keep the doc updated if we encounter anything that applies to more than a few specs.

mounirlamouri pushed a commit to w3c/mediasession that referenced this issue Jan 28, 2020
A few editorial updates to fix a few broken links and references:
- Drop custom dfns that are no longer needed (fixes a few outdated fragments
and allows to see which additional dfns the spec needs on top of those that the
referenced specs export)
- Replace "triggered by user activation" with new user activation model
(see whatwg/html#5129). This may warrant another
iteration as I'm not clear whether we're supposed to call the "activation
notification" steps
- Update definition of methods to fix IDL links
- Update reference to Web App Manifest and flag the paragraph as informative
- Fix links to "action"
rakuco pushed a commit to rakuco/wake-lock that referenced this issue Feb 5, 2020
Adapt to whatwg/html#5129 and follow the spec editing advice from
https://docs.google.com/document/d/14wT89JZ0qeRehXGkcn3_meXxjvlHKgM9d7aJj80kQcQ/edit ("User
Activation: Guidance for spec authors") by replacing "triggered by user
activation" with "the current global object has transient activation".

This makes ReSpec happy again.
rakuco pushed a commit to rakuco/wake-lock that referenced this issue Feb 5, 2020
Adapt to whatwg/html#5129 and follow the spec editing advice from
https://docs.google.com/document/d/14wT89JZ0qeRehXGkcn3_meXxjvlHKgM9d7aJj80kQcQ/edit ("User
Activation: Guidance for spec authors") by replacing "triggered by user
activation" with "the current global object has transient activation".

This makes ReSpec happy again.
@rakuco
Copy link
Member

rakuco commented Feb 5, 2020

The Wake Lock spec is being updated in w3c/screen-wake-lock#252

rakuco pushed a commit to rakuco/wake-lock that referenced this issue Feb 5, 2020
Adapt to whatwg/html#5129 and follow the spec editing advice from
https://docs.google.com/document/d/14wT89JZ0qeRehXGkcn3_meXxjvlHKgM9d7aJj80kQcQ/edit ("User
Activation: Guidance for spec authors") by replacing "triggered by user
activation" with "the current global object has transient activation".

This makes ReSpec happy again.
rakuco pushed a commit to w3c/screen-wake-lock that referenced this issue Feb 7, 2020
Adapt to whatwg/html#5129 and follow the spec editing advice from
https://docs.google.com/document/d/14wT89JZ0qeRehXGkcn3_meXxjvlHKgM9d7aJj80kQcQ/edit ("User
Activation: Guidance for spec authors") by replacing "triggered by user
activation" with "the current global object has transient activation".

This makes ReSpec happy again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

6 participants