diff --git a/index.bs b/index.bs index 53acd0b6..4f4be8c2 100644 --- a/index.bs +++ b/index.bs @@ -474,6 +474,31 @@ interface ML { }; +The {{ML/createContext()}} method steps are: +1. If the [=responsible document=] is not [=allowed to use=] the [=webnn-feature|webnn=] feature, then throw a "{{SecurityError!!exception}}" {{DOMException}} and abort these steps. +1. Let |context| be a new {{MLContext}} object. +1. Switch on the method's first argument: +
+
{{MLContextOptions}} +
Set |context|'s [=context type=] to [=default-context|default=]. + +
{{WebGLRenderingContext}} +
Set |context|'s [=context type=] to [=webgl-context|webgl=]. + +
{{GPUDevice}} +
Set |context|'s [=context type=] to [=webgpu-context|webgpu=]. + +
Otherwise +
Set |context|'s [=context type=] to [=default-context|default=]. +
+1. Return |context|. + +### Permissions Policy Integration ### {#permissions-policy-integration} + +This specification defines a policy-controlled feature identified by the +string "webnn". +Its default allowlist is 'self'. + ## MLContext ## {#api-mlcontext} The {{MLContext}} interface represents a global state of neural network compute workload and execution processes. +The context type for an {{MLContext}} is either "default", "webgl" or "webgpu". + ## MLOperandDescriptor ## {#api-mloperanddescriptor}