mirror of
https://github.com/servo/servo
synced 2026-05-08 16:12:15 +02:00
Implement the `SubtleCrypto.supports` method in our WebCrypto API. The *check support for an algorithm* algorithm is also implemented to support the functionality of the `SubtleCrypto.supports` method. The `SubtleCrypto.supports` method has two overloads. One of them has a union containing a non-object value at the distinguishing index. Our `codegen.py` currently does not support unions of non-object values at distinguish index. So, `codegen.py` is also patched to extend its support to unions of objects, strings, numbers and boolean values. Specification of `SubtleCrypto.supports`: https://wicg.github.io/webcrypto-modern-algos/#SubtleCrypto-method-supports Specification of "check support for an algorithm": https://wicg.github.io/webcrypto-modern-algos/#dfn-check-support-for-algorithm Testing: - Pass WPT tests related to `supports` method. - Add new tests for IDL operation overloading with unions of various types. Fixes: Part of #40687 --------- Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>