When invoked, the [[\DiscoverFromExternalSource]](origin, options,
@@ -778,7 +789,7 @@
Let |requests| be |options|'s {{CredentialRequestOptions/digital}}'s
{{DigitalCredentialRequestOptions/requests}} member.
-
If |requests| is empty, [=exception/throw=] a {{TypeError}}.
+
If |requests| [=list/is empty=], [=exception/throw=] a {{TypeError}}.
[=List/For each=] |request| of |requests|:
@@ -786,15 +797,57 @@
|request| to a JSON string. [=exception/throw|Re-throw=] any
[=exception=].
+
Let |protocol| be |request|'s
+ {{DigitalCredentialGetRequest/protocol}}.
+
+
Optionally, if |protocol| is unknown to the user agent,
+ [=exception/throw=] a {{TypeError}}.
+
+
+
If |protocol| is not supported by the user agent,
+ [=exception/throw=] a {{"NotSupportedError"}} {{DOMException}}.
+
+
If |protocol| is not allowed by the user agent for security
+ reasons, [=exception/throw=] a {{"SecurityError"}} {{DOMException}}.
+
+
If the [=registry/link|specification=] corresponding to
+ |protocol| defines an IDL [=dictionary=] for [=converted to an idl
+ value|conversion=]:
+
+
Let |converted| be |request|'s
+ {{DigitalCredentialGetRequest/data}} [=converted to an idl
+ value|converted=] to that dictionary. [=exception/throw|Rethrow=]
+ any exceptions.
+
+
+
+
Otherwise, let |data| be |request|'s
+ {{DigitalCredentialGetRequest/data}}.
+
+
Optionally, validate |data| against any validation rules set
+ forth in the corresponding [=registry/link|specification=]. If any of
+ |data|'s members are invalid, [=exception/throw=] a {{TypeError}}.
+
-
-
+
Let |coordinator| be the [=credential request coordinator=]
+ associated with |document|'s [=top-level traversable=].
+
+
Let |signal| be |options|'s {{CredentialRequestOptions/signal}}, if
+ present.
+
+
Let |result| be the result of awaiting the [=present credential
+ request UI=] algorithm, passing |document|, |requests|, and |signal|.
+
+
If |result| is an [=exception=], [=exception/throw=] that exception.