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
Copy file name to clipboardExpand all lines: index.bs
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2176,7 +2176,11 @@ Every [=interface=] [=interface/including=] the {{DestroyableModel}} interface m
2176
2176
<div algorithm>
2177
2177
To <dfn export>measure AI model input usage</dfn> given an {{DestroyableModel}} |modelObject|, an [=ordered map=] |options|, and an algorithm |measure|:
2178
2178
2179
-
1. If |modelObject|'s [=relevant global object=] is a {{Window}} whose [=associated Document=] is not [=Document/fully active=], then return [=a promise rejected with=] an "{{InvalidStateError}}" {{DOMException}}.
2179
+
1. Let |global| be |modelObject|'s [=relevant global object=].
2180
+
2181
+
1. [=Assert=]: |global| is a {{Window}} object.
2182
+
2183
+
1. If |global|'s [=associated Document=] is not [=Document/fully active=], then return [=a promise rejected with=] an "{{InvalidStateError}}" {{DOMException}}.
2180
2184
2181
2185
1. Let |signals| be « |modelObject|'s [=DestroyableModel/destruction abort controller=]'s [=AbortController/signal=] ».
2182
2186
@@ -2204,7 +2208,7 @@ Every [=interface=] [=interface/including=] the {{DestroyableModel}} interface m
2204
2208
2205
2209
1. Let |result| be the result of performing |measure| given |stopMeasuring|.
2206
2210
2207
-
1. [=Queue a global task=] on the [=AI task source=] given |modelObject|'s [=relevant global object=] to perform the following steps:
2211
+
1. [=Queue a global task=] on the [=AI task source=] given |global| to perform the following steps:
2208
2212
2209
2213
1. If |abortedDuringMeasurement| is true, then [=reject=] |promise| with |compositeSignal|'s [=AbortSignal/abort reason=].
0 commit comments