Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[CredentialManagement] Add IDL definitions for Credential, SiteBoundC…
…redential, and PasswordCredential https://bugs.webkit.org/show_bug.cgi?id=168616 <rdar://problem/30167149> Reviewed by Daniel Bates. Source/WebCore: This patch adds IDL definitions for: 1. Credential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-credential), 2. SiteBoundCredential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-siteboundcredential), and 3. PasswordCredential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-passwordcredential). Test: credentials/idlharness.html * CMakeLists.txt: * DerivedSources.make: * Modules/credentials/BasicCredential.cpp: Added. (WebCore::BasicCredential::BasicCredential): (WebCore::BasicCredential::~BasicCredential): (WebCore::BasicCredential::type): * Modules/credentials/BasicCredential.h: Added. (WebCore::BasicCredential::id): * Modules/credentials/BasicCredential.idl: Added. * Modules/credentials/CredentialData.h: Added. * Modules/credentials/CredentialData.idl: Added. * Modules/credentials/PasswordCredential.cpp: Added. (WebCore::PasswordCredential::PasswordCredential): (WebCore::PasswordCredential::PasswordCredential): Dummy constructors for now. * Modules/credentials/PasswordCredential.h: Added. (WebCore::PasswordCredential::create): (WebCore::PasswordCredential::create): (WebCore::PasswordCredential::setIdName): (WebCore::PasswordCredential::idName): (WebCore::PasswordCredential::setPasswordName): (WebCore::PasswordCredential::passwordName): (WebCore::PasswordCredential::setAdditionalData): (WebCore::PasswordCredential::additionalData): * Modules/credentials/PasswordCredential.idl: Added. * Modules/credentials/SiteBoundCredential.cpp: Added. (WebCore::SiteBoundCredential::SiteBoundCredential): (WebCore::SiteBoundCredential::~SiteBoundCredential): * Modules/credentials/SiteBoundCredential.h: Added. (WebCore::SiteBoundCredential::name): (WebCore::SiteBoundCredential::iconURL): (WebCore::SiteBoundCredential::setOrigin): (WebCore::SiteBoundCredential::origin): * Modules/credentials/SiteBoundCredential.idl: Added. * Modules/credentials/SiteBoundCredentialData.h: Added. * Modules/credentials/SiteBoundCredentialData.idl: Added. * WebCore.xcodeproj/project.pbxproj: LayoutTests: * credentials/idlharness-expected.txt: Added. * credentials/idlharness.html: Added. * platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt: * platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt: * platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt: * platform/mac/js/dom/global-constructors-attributes-expected.txt: * resources/WebIDLParser.js: Added. * resources/idlharness.js: Renamed from LayoutTests/imported/w3c/resources/idlharness.js. Removed LayoutTests/imported/w3c/resources/idlharness.js since it is not needed any more. Added resources/idlharness.js for idl harness. Canonical link: https://commits.webkit.org/185913@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213081 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Jiewen Tan
committed
Feb 27, 2017
1 parent
f058561
commit a95761f
Showing
26 changed files
with
2,057 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
idlharness test | ||
|
||
This test validates the WebIDL included in the Credential Management API. | ||
|
||
|
||
PASS Credential interface: existence and properties of interface object | ||
PASS Credential interface object length | ||
PASS Credential interface object name | ||
PASS Credential interface: existence and properties of interface prototype object | ||
PASS Credential interface: existence and properties of interface prototype object's "constructor" property | ||
PASS Credential interface: attribute id | ||
PASS Credential interface: attribute type | ||
PASS SiteBoundCredential interface: existence and properties of interface object | ||
PASS SiteBoundCredential interface object length | ||
PASS SiteBoundCredential interface object name | ||
PASS SiteBoundCredential interface: existence and properties of interface prototype object | ||
PASS SiteBoundCredential interface: existence and properties of interface prototype object's "constructor" property | ||
PASS SiteBoundCredential interface: attribute name | ||
PASS SiteBoundCredential interface: attribute iconURL | ||
PASS PasswordCredential interface: existence and properties of interface object | ||
PASS PasswordCredential interface object length | ||
PASS PasswordCredential interface object name | ||
PASS PasswordCredential interface: existence and properties of interface prototype object | ||
PASS PasswordCredential interface: existence and properties of interface prototype object's "constructor" property | ||
PASS PasswordCredential interface: attribute idName | ||
PASS PasswordCredential interface: attribute passwordName | ||
PASS PasswordCredential interface: attribute additionalData | ||
PASS PasswordCredential must be primary interface of new PasswordCredential({ password: "12345", id: "12345" }) | ||
PASS Stringification of new PasswordCredential({ password: "12345", id: "12345" }) | ||
PASS PasswordCredential interface: new PasswordCredential({ password: "12345", id: "12345" }) must inherit property "idName" with the proper type (0) | ||
PASS PasswordCredential interface: new PasswordCredential({ password: "12345", id: "12345" }) must inherit property "passwordName" with the proper type (1) | ||
PASS PasswordCredential interface: new PasswordCredential({ password: "12345", id: "12345" }) must inherit property "additionalData" with the proper type (2) | ||
PASS SiteBoundCredential interface: new PasswordCredential({ password: "12345", id: "12345" }) must inherit property "name" with the proper type (0) | ||
PASS SiteBoundCredential interface: new PasswordCredential({ password: "12345", id: "12345" }) must inherit property "iconURL" with the proper type (1) | ||
PASS Credential interface: new PasswordCredential({ password: "12345", id: "12345" }) must inherit property "id" with the proper type (0) | ||
PASS Credential interface: new PasswordCredential({ password: "12345", id: "12345" }) must inherit property "type" with the proper type (1) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<!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> | ||
|
||
<h1>idlharness test</h1> | ||
<p>This test validates the WebIDL included in the Credential Management API.</p> | ||
|
||
<script type="text/plain" class="untested-idl"> | ||
interface Window {}; | ||
</script> | ||
|
||
<script type="text/plain" class="idl"> | ||
// 3.1.1 Credential | ||
|
||
dictionary CredentialData { | ||
required USVString id; | ||
}; | ||
|
||
[SecureContext] interface Credential { | ||
readonly attribute USVString id; | ||
readonly attribute DOMString type; | ||
}; | ||
|
||
// No Transferable at this moment | ||
// Credential implements Transferable; | ||
|
||
dictionary SiteBoundCredentialData : CredentialData { | ||
USVString name; | ||
USVString iconURL; | ||
}; | ||
|
||
[SecureContext] interface SiteBoundCredential : Credential { | ||
readonly attribute USVString name; | ||
readonly attribute USVString iconURL; | ||
}; | ||
|
||
// 3.1.3 PasswordCredential | ||
|
||
dictionary PasswordCredentialData : SiteBoundCredentialData { | ||
required USVString password; | ||
}; | ||
|
||
typedef (FormData or URLSearchParams) CredentialBodyType; | ||
|
||
[Constructor(PasswordCredentialData data), | ||
Constructor(HTMLFormElement form), | ||
Exposed=Window, | ||
SecureContext] | ||
interface PasswordCredential : SiteBoundCredential { | ||
attribute USVString idName; | ||
attribute USVString passwordName; | ||
|
||
attribute CredentialBodyType? additionalData; | ||
}; | ||
|
||
</script> | ||
|
||
<script> | ||
function select(selector) { | ||
return [].slice.call(document.querySelectorAll(selector)) | ||
.map(function(e) { return e.textContent; }) | ||
.join('\n\n'); | ||
} | ||
|
||
var idl = select('.idl') | ||
var untested = select('.untested-idl'); | ||
var idl_array = new IdlArray(); | ||
idl_array.add_untested_idls(untested); | ||
idl_array.add_idls(idl); | ||
idl_array.add_objects({ | ||
PasswordCredential: ['new PasswordCredential({ password: "12345", id: "12345" })'], | ||
}); | ||
idl_array.test(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.