LibWeb: Default implementation of some Credential methods

Provide the default implementation for
`is_conditional_mediation_available` and
`will_request_conditional_creation`.
This commit is contained in:
devgianlu 2025-02-07 16:54:58 +01:00
parent 21f4fdf804
commit cb2bcb30e4

View file

@ -12,15 +12,15 @@ namespace Web::CredentialManagement {
// https://www.w3.org/TR/credential-management-1/#dom-credential-isconditionalmediationavailable
GC::Ref<WebIDL::Promise> Credential::is_conditional_mediation_available(JS::VM& vm)
{
auto* realm = vm.current_realm();
return WebIDL::create_rejected_promise_from_exception(*realm, vm.throw_completion<JS::InternalError>(JS::ErrorType::NotImplemented, "is conditional mediation available"sv));
// 1. Return a promise resolved with false.
return WebIDL::create_resolved_promise(*vm.current_realm(), JS::Value(false));
}
// https://www.w3.org/TR/credential-management-1/#dom-credential-willrequestconditionalcreation
GC::Ref<WebIDL::Promise> Credential::will_request_conditional_creation(JS::VM& vm)
{
auto* realm = vm.current_realm();
return WebIDL::create_rejected_promise_from_exception(*realm, vm.throw_completion<JS::InternalError>(JS::ErrorType::NotImplemented, "will request conditional creation"sv));
// 1. Return a promise resolved with undefined.
return WebIDL::create_resolved_promise(*vm.current_realm(), JS::js_undefined());
}
Credential::~Credential() { }