mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-29 20:57:43 -10:00
94 lines
2.8 KiB
HTML
94 lines
2.8 KiB
HTML
<!DOCTYPE html>
|
|
<script src=/resources/testharness.js></script>
|
|
<script src=/resources/testharnessreport.js></script>
|
|
<script src=/resources/WebIDLParser.js></script>
|
|
<script src=/resources/idlharness.js></script>
|
|
<script type="text/plain" id="untested">
|
|
dictionary CredentialData {
|
|
USVString id;
|
|
};
|
|
|
|
[Exposed=Window, SecureContext]
|
|
interface Credential {
|
|
readonly attribute USVString id;
|
|
readonly attribute DOMString type;
|
|
};
|
|
|
|
dictionary SiteBoundCredentialData : CredentialData {
|
|
USVString name;
|
|
USVString iconURL;
|
|
};
|
|
|
|
[NoInterfaceObject, SecureContext]
|
|
interface CredentialUserData {
|
|
readonly attribute USVString name;
|
|
readonly attribute USVString iconURL;
|
|
};
|
|
|
|
dictionary PasswordCredentialData : SiteBoundCredentialData {
|
|
USVString password;
|
|
};
|
|
|
|
typedef (FormData or URLSearchParams) CredentialBodyType;
|
|
|
|
|
|
dictionary FederatedCredentialData : SiteBoundCredentialData {
|
|
USVString provider;
|
|
DOMString protocol;
|
|
};
|
|
|
|
dictionary CredentialRequestOptions {
|
|
boolean password = false;
|
|
FederatedCredentialRequestOptions federated;
|
|
|
|
boolean unmediated = false;
|
|
};
|
|
|
|
dictionary FederatedCredentialRequestOptions {
|
|
sequence<USVString> providers;
|
|
sequence<DOMString> protocols;
|
|
};
|
|
|
|
</script>
|
|
<script type="text/plain" id="tested">
|
|
interface CredentialsContainer {
|
|
Promise<Credential> get(optional CredentialRequestOptions options);
|
|
Promise<Credential> store(Credential credential);
|
|
Promise<void> requireUserMediation();
|
|
};
|
|
|
|
[Constructor(PasswordCredentialData data),
|
|
Constructor(HTMLFormElement form),
|
|
Exposed=Window,
|
|
SecureContext]
|
|
interface PasswordCredential : Credential {
|
|
attribute USVString idName;
|
|
attribute USVString passwordName;
|
|
|
|
attribute CredentialBodyType? additionalData;
|
|
};
|
|
PasswordCredential implements CredentialUserData;
|
|
|
|
[Constructor(FederatedCredentialData data),
|
|
Exposed=Window,
|
|
SecureContext]
|
|
interface FederatedCredential : Credential {
|
|
readonly attribute USVString provider;
|
|
readonly attribute DOMString? protocol;
|
|
};
|
|
FederatedCredential implements CredentialUserData;
|
|
</script>
|
|
<script>
|
|
"use strict";
|
|
var idl_array = new IdlArray();
|
|
idl_array.add_untested_idls(document.querySelector('#untested').textContent);
|
|
idl_array.add_idls(document.querySelector('#tested').textContent);
|
|
idl_array.add_objects({
|
|
CredentialsContainer: ['navigator.credentials'],
|
|
PasswordCredential: ['new PasswordCredential({ id: "id", password: "pencil", iconURL: "https://example.com/", name: "name" })'],
|
|
FederatedCredential: ['new FederatedCredential({ id: "id", provider: "https://example.com", iconURL: "https://example.com/", name: "name" })']
|
|
});
|
|
idl_array.test();
|
|
</script>
|
|
|