Open Schwusch opened 3 months ago
Hmm, this may be a bug with the Web IDL but not sure.
KeyAlgorithm
is defined but never used in the IDL except as a superinterface: https://github.com/w3c/webref/blob/5308f9a9c0914d765fcbbb55f7d01d313ae37eda/ed/idl/WebCryptoAPI.idl#L25. The subinterfaces are never referred to either.
https://github.com/dart-lang/web/commit/7604578eb538c471d438608673c037121d95dba5 uses the MDN compatibility data to avoid emitting experimental/nonstandard APIs. MDN doesn't contain compatibility data for dictionaries, so we depend on whether or not its used by a non-experimental/standard API to determine if we should emit the dictionary. Here, KeyAlgorithm
is never actually used except as a superinterface, and the subinterfaces are never used either: https://github.com/w3c/webref/blob/5308f9a9c0914d765fcbbb55f7d01d313ae37eda/ed/idl/WebCryptoAPI.idl#L25. The case is the same with AesGcmParams
: https://github.com/w3c/webref/blob/5308f9a9c0914d765fcbbb55f7d01d313ae37eda/ed/idl/WebCryptoAPI.idl#L206.
We could instead choose to only not emit dictionaries that are explicitly used by experimental/nonstandard APIs, and that may cover this, but it also may mean we're including some dictionary types that are subject to change often.
In 1.0.0, some
SubtleCrypto
methods have untyped parameters, thus making them hard to use: E.g.importKey()
:Before 1.0.0, it was possible to figure out and pass
KeyAlgorithm(name: 'AES-GCM')
as thealgorithm
argument. This class is however gone in 1.0.0. Other missing definition examples areAesGcmParams
, which was useful forSubtleCrypto.encrypt()
/SubtleCrypto.decrypt()
. Current implementation ofAlgorithmIdentifier
is a simple typedef: