You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Relax user activation requirements for session creation (#86)
This change updates the specification to require sticky user activation
instead of transient user activation for creating sessions under
certain conditions, as discussed in issue #83.
Fixes: #83
The static <dfn method for="Summarizer">create(|options|)</dfn> method steps are:
115
115
116
-
1. Return the result of [=creating an AI model object=] given |options|, "{{summarizer}}", [=validate and canonicalize summarizer options=], [=computing summarizer options availability=], [=download the summarizer model=], [=initialize the summarizer model=], and [=create a summarizer object=].
116
+
1. Return the result of [=creating an AI model object=] given |options|, "{{summarizer}}", [=validate and canonicalize summarizer options=], [=computing summarizer options availability=], [=download the summarizer model=], [=initialize the summarizer model=], [=create a summarizer object=], and false.
The static <dfn method for="Writer">create(|options|)</dfn> method steps are:
701
701
702
-
1. Return the result of [=creating an AI model object=] given |options|, "{{writer}}", [=validate and canonicalize writer options=], [=computing writer options availability=], [=download the writer model=], [=initialize the writer model=], and [=create a writer object=].
702
+
1. Return the result of [=creating an AI model object=] given |options|, "{{writer}}", [=validate and canonicalize writer options=], [=computing writer options availability=], [=download the writer model=], [=initialize the writer model=], [=create a writer object=], and false.
The static <dfn method for="Rewriter">create(|options|)</dfn> method steps are:
1216
1216
1217
-
1. Return the result of [=creating an AI model object=] given |options|, "{{rewriter}}", [=validate and canonicalize rewriter options=], [=computing rewriter options availability=], [=download the rewriter model=], [=initialize the rewriter model=], and [=create a rewriter object=].
1217
+
1. Return the result of [=creating an AI model object=] given |options|, "{{rewriter}}", [=validate and canonicalize rewriter options=], [=computing rewriter options availability=], [=download the rewriter model=], [=initialize the rewriter model=], [=create a rewriter object=], and false.
1218
1218
</div>
1219
1219
1220
1220
<div algorithm>
@@ -1745,7 +1745,7 @@ Every [=interface=] [=interface/including=] the {{DestroyableModel}} interface m
1745
1745
* an algorithm |getAvailability| taking an [=ordered map=] and returning an {{Availability}} or null,
1746
1746
* an algorithm |startDownload| taking an [=ordered map=] and returning a boolean,
1747
1747
* an algorithm |initialize| taking an [=ordered map=] and returning an error information or null, and
1748
-
* an algorithm |create| taking a [=ECMAScript/realm=] and an [=ordered map=] and returning a Web IDL object representing the model,
1748
+
* an algorithm |create| taking a [=ECMAScript/realm=], an [=ordered map=] and an optional boolean |requireTransientActivation| (default true) and returning a Web IDL object representing the model,
1749
1749
1750
1750
perform the following steps:
1751
1751
@@ -1827,13 +1827,20 @@ Every [=interface=] [=interface/including=] the {{DestroyableModel}} interface m
1827
1827
::
1828
1828
1. If |availability| is "{{Availability/downloadable}}", then:
1829
1829
1830
-
1. If |realm|'s [=realm/global object=] does not have [=transient activation=], then:
1830
+
1. If |requireTransientActivation| is true, then:
1831
+
1. If |realm|'s [=realm/global object=] does not have [=transient activation=], then:
1831
1832
1832
-
1. [=Queue a global task=] on the [=AI task source=] given |realm|'s [=realm/global object=] to [=reject=] |promise| with a "{{NotAllowedError}}" {{DOMException}}.
1833
+
1. [=Queue a global task=] on the [=AI task source=] given |realm|'s [=realm/global object=] to [=reject=] |promise| with a "{{NotAllowedError}}" {{DOMException}}.
1833
1834
1834
-
1. Abort these steps.
1835
+
1. Abort these steps.
1835
1836
1836
-
1. [=Consume user activation=] given |realm|'s [=realm/global object=].
1837
+
1. [=Consume user activation=] given |realm|'s [=realm/global object=].
1838
+
1. Otherwise:
1839
+
1. If |realm|'s [=realm/global object=] does not have [=sticky activation=], then:
1840
+
1841
+
1. [=Queue a global task=] on the [=AI task source=] given |realm|'s [=realm/global object=] to [=reject=] |promise| with a "{{NotAllowedError}}" {{DOMException}}.
1842
+
1843
+
1. Abort these steps.
1837
1844
1838
1845
1. <span id="step-download-user-interface"></span>The user agent may display a user interface to the user to confirm that they want to perform the download operation given by |startDownload|, or to show the progress of the download. Alternately, the user agent may decide to deny the ability to perform |startDownload| based on implicit signals of the user's intent, including the considerations in [[#privacy-availability-eviction]] and [[#security-disk-space]]. If the user explicitly or implicitly signals that they do not want to start the download, then:
0 commit comments