[CredentialManagement] Add IDL definitions for Credential, SiteBoundCredential, and...
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Feb 2017 19:01:13 +0000 (19:01 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Feb 2017 19:01:13 +0000 (19:01 +0000)
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213081 268f45cc-cd09-0410-ab3c-d52691b4dbfc

26 files changed:
LayoutTests/ChangeLog
LayoutTests/credentials/idlharness-expected.txt [new file with mode: 0644]
LayoutTests/credentials/idlharness.html [new file with mode: 0644]
LayoutTests/platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt
LayoutTests/resources/WebIDLParser.js [new file with mode: 0644]
LayoutTests/resources/idlharness.js [moved from LayoutTests/imported/w3c/resources/idlharness.js with 92% similarity]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/credentials/BasicCredential.cpp [new file with mode: 0644]
Source/WebCore/Modules/credentials/BasicCredential.h [new file with mode: 0644]
Source/WebCore/Modules/credentials/BasicCredential.idl [new file with mode: 0644]
Source/WebCore/Modules/credentials/CredentialData.h [new file with mode: 0644]
Source/WebCore/Modules/credentials/CredentialData.idl [new file with mode: 0644]
Source/WebCore/Modules/credentials/PasswordCredential.cpp [new file with mode: 0644]
Source/WebCore/Modules/credentials/PasswordCredential.h [new file with mode: 0644]
Source/WebCore/Modules/credentials/PasswordCredential.idl [new file with mode: 0644]
Source/WebCore/Modules/credentials/SiteBoundCredential.cpp [new file with mode: 0644]
Source/WebCore/Modules/credentials/SiteBoundCredential.h [new file with mode: 0644]
Source/WebCore/Modules/credentials/SiteBoundCredential.idl [new file with mode: 0644]
Source/WebCore/Modules/credentials/SiteBoundCredentialData.h [new file with mode: 0644]
Source/WebCore/Modules/credentials/SiteBoundCredentialData.idl [new file with mode: 0644]
Source/WebCore/WebCore.xcodeproj/project.pbxproj

index 0e2bccf..bf86bd6 100644 (file)
@@ -1,3 +1,22 @@
+2017-02-27  Jiewen Tan  <jiewen_tan@apple.com>
+
+        [CredentialManagement] Add IDL definitions for Credential, SiteBoundCredential, and PasswordCredential
+        https://bugs.webkit.org/show_bug.cgi?id=168616
+        <rdar://problem/30167149>
+
+        Reviewed by Daniel Bates.
+
+        * 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.
+
 2017-02-27  Jer Noble  <jer.noble@apple.com>
 
         [WebRTC] Fix remote audio rendering
diff --git a/LayoutTests/credentials/idlharness-expected.txt b/LayoutTests/credentials/idlharness-expected.txt
new file mode 100644 (file)
index 0000000..0664fa9
--- /dev/null
@@ -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) 
+
diff --git a/LayoutTests/credentials/idlharness.html b/LayoutTests/credentials/idlharness.html
new file mode 100644 (file)
index 0000000..ed30a05
--- /dev/null
@@ -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>
index 3f67cc4..e6494a0 100644 (file)
@@ -298,6 +298,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'Counter').hasOwnProperty('get') is
 PASS Object.getOwnPropertyDescriptor(global, 'Counter').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'Counter').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'Counter').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'Credential').value is Credential
+PASS Object.getOwnPropertyDescriptor(global, 'Credential').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Credential').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Credential').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'Credential').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'Crypto').value is Crypto
 PASS Object.getOwnPropertyDescriptor(global, 'Crypto').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'Crypto').hasOwnProperty('set') is false
@@ -1163,6 +1168,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').hasOwnProper
 PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').value is PasswordCredential
+PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'Path2D').value is Path2D
 PASS Object.getOwnPropertyDescriptor(global, 'Path2D').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'Path2D').hasOwnProperty('set') is false
@@ -2093,6 +2103,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').hasOwnProperty
 PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').value is SiteBoundCredential
+PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').value is SourceBuffer
 PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('set') is false
index 3f67cc4..e6494a0 100644 (file)
@@ -298,6 +298,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'Counter').hasOwnProperty('get') is
 PASS Object.getOwnPropertyDescriptor(global, 'Counter').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'Counter').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'Counter').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'Credential').value is Credential
+PASS Object.getOwnPropertyDescriptor(global, 'Credential').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Credential').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Credential').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'Credential').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'Crypto').value is Crypto
 PASS Object.getOwnPropertyDescriptor(global, 'Crypto').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'Crypto').hasOwnProperty('set') is false
@@ -1163,6 +1168,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').hasOwnProper
 PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').value is PasswordCredential
+PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'Path2D').value is Path2D
 PASS Object.getOwnPropertyDescriptor(global, 'Path2D').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'Path2D').hasOwnProperty('set') is false
@@ -2093,6 +2103,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').hasOwnProperty
 PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').value is SiteBoundCredential
+PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').value is SourceBuffer
 PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('set') is false
index 480f245..77a6848 100644 (file)
@@ -298,6 +298,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'Counter').hasOwnProperty('get') is
 PASS Object.getOwnPropertyDescriptor(global, 'Counter').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'Counter').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'Counter').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'Credential').value is Credential
+PASS Object.getOwnPropertyDescriptor(global, 'Credential').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Credential').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Credential').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'Credential').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'Crypto').value is Crypto
 PASS Object.getOwnPropertyDescriptor(global, 'Crypto').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'Crypto').hasOwnProperty('set') is false
@@ -1158,6 +1163,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').hasOwnProper
 PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').value is PasswordCredential
+PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'Path2D').value is Path2D
 PASS Object.getOwnPropertyDescriptor(global, 'Path2D').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'Path2D').hasOwnProperty('set') is false
@@ -2088,6 +2098,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').hasOwnProperty
 PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').value is SiteBoundCredential
+PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').value is SourceBuffer
 PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('set') is false
index 31f4083..bbedd37 100644 (file)
@@ -303,6 +303,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'Counter').hasOwnProperty('get') is
 PASS Object.getOwnPropertyDescriptor(global, 'Counter').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'Counter').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'Counter').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'Credential').value is Credential
+PASS Object.getOwnPropertyDescriptor(global, 'Credential').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Credential').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Credential').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'Credential').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'Crypto').value is Crypto
 PASS Object.getOwnPropertyDescriptor(global, 'Crypto').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'Crypto').hasOwnProperty('set') is false
@@ -1168,6 +1173,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').hasOwnProper
 PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').value is PasswordCredential
+PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'Path2D').value is Path2D
 PASS Object.getOwnPropertyDescriptor(global, 'Path2D').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'Path2D').hasOwnProperty('set') is false
@@ -2098,6 +2108,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').hasOwnProperty
 PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').value is SiteBoundCredential
+PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').value is SourceBuffer
 PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('set') is false
diff --git a/LayoutTests/resources/WebIDLParser.js b/LayoutTests/resources/WebIDLParser.js
new file mode 100644 (file)
index 0000000..9e504fc
--- /dev/null
@@ -0,0 +1,1012 @@
+
+
+(function () {
+    var tokenise = function (str) {
+        var tokens = []
+        ,   re = {
+                "float":        /^-?(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/
+            ,   "integer":      /^-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/
+            ,   "identifier":   /^[A-Z_a-z][0-9A-Z_a-z]*/
+            ,   "string":       /^"[^"]*"/
+            ,   "whitespace":   /^(?:[\t\n\r ]+|[\t\n\r ]*((\/\/.*|\/\*(.|\n|\r)*?\*\/)[\t\n\r ]*))+/
+            ,   "other":        /^[^\t\n\r 0-9A-Z_a-z]/
+            }
+        ,   types = []
+        ;
+        for (var k in re) types.push(k);
+        while (str.length > 0) {
+            var matched = false;
+            for (var i = 0, n = types.length; i < n; i++) {
+                var type = types[i];
+                str = str.replace(re[type], function (tok) {
+                    tokens.push({ type: type, value: tok });
+                    matched = true;
+                    return "";
+                });
+                if (matched) break;
+            }
+            if (matched) continue;
+            throw new Error("Token stream not progressing");
+        }
+        return tokens;
+    };
+    
+    var parse = function (tokens, opt) {
+        var line = 1;
+        tokens = tokens.slice();
+        
+        var FLOAT = "float"
+        ,   INT = "integer"
+        ,   ID = "identifier"
+        ,   STR = "string"
+        ,   OTHER = "other"
+        ;
+        
+        var WebIDLParseError = function (str, line, input, tokens) {
+            this.message = str;
+            this.line = line;
+            this.input = input;
+            this.tokens = tokens;
+        };
+        WebIDLParseError.prototype.toString = function () {
+            return this.message + ", line " + this.line + " (tokens: '" + this.input + "')\n" +
+                   JSON.stringify(this.tokens, null, 4);
+        };
+        
+        var error = function (str) {
+            var tok = "", numTokens = 0, maxTokens = 5;
+            while (numTokens < maxTokens && tokens.length > numTokens) {
+                tok += tokens[numTokens].value;
+                numTokens++;
+            }
+            throw new WebIDLParseError(str, line, tok, tokens.slice(0, 5));
+        };
+        
+        var last_token = null;
+        
+        var consume = function (type, value) {
+            if (!tokens.length || tokens[0].type !== type) return;
+            if (typeof value === "undefined" || tokens[0].value === value) {
+                 last_token = tokens.shift();
+                 if (type === ID) last_token.value = last_token.value.replace(/^_/, "");
+                 return last_token;
+             }
+        };
+        
+        var ws = function () {
+            if (!tokens.length) return;
+            if (tokens[0].type === "whitespace") {
+                var t = tokens.shift();
+                t.value.replace(/\n/g, function (m) { line++; return m; });
+                return t;
+            }
+        };
+        
+        var all_ws = function (store, pea) { // pea == post extended attribute, tpea = same for types
+            var t = { type: "whitespace", value: "" };
+            while (true) {
+                var w = ws();
+                if (!w) break;
+                t.value += w.value;
+            }
+            if (t.value.length > 0) {
+                if (store) {
+                    var w = t.value
+                    ,   re = {
+                            "ws":                   /^([\t\n\r ]+)/
+                        ,   "line-comment":         /^\/\/(.*)\n?/m
+                        ,   "multiline-comment":    /^\/\*((?:.|\n|\r)*?)\*\//
+                        }
+                    ,   wsTypes = []
+                    ;
+                    for (var k in re) wsTypes.push(k);
+                    while (w.length) {
+                        var matched = false;
+                        for (var i = 0, n = wsTypes.length; i < n; i++) {
+                            var type = wsTypes[i];
+                            w = w.replace(re[type], function (tok, m1) {
+                                store.push({ type: type + (pea ? ("-" + pea) : ""), value: m1 });
+                                matched = true;
+                                return "";
+                            });
+                            if (matched) break;
+                        }
+                        if (matched) continue;
+                        throw new Error("Surprising white space construct."); // this shouldn't happen
+                    }
+                }
+                return t;
+            }
+        };
+        
+        var integer_type = function () {
+            var ret = "";
+            all_ws();
+            if (consume(ID, "unsigned")) ret = "unsigned ";
+            all_ws();
+            if (consume(ID, "short")) return ret + "short";
+            if (consume(ID, "long")) {
+                ret += "long";
+                all_ws();
+                if (consume(ID, "long")) return ret + " long";
+                return ret;
+            }
+            if (ret) error("Failed to parse integer type");
+        };
+        
+        var float_type = function () {
+            var ret = "";
+            all_ws();
+            if (consume(ID, "unrestricted")) ret = "unrestricted ";
+            all_ws();
+            if (consume(ID, "float")) return ret + "float";
+            if (consume(ID, "double")) return ret + "double";
+            if (ret) error("Failed to parse float type");
+        };
+        
+        var primitive_type = function () {
+            var num_type = integer_type() || float_type();
+            if (num_type) return num_type;
+            all_ws();
+            if (consume(ID, "boolean")) return "boolean";
+            if (consume(ID, "byte")) return "byte";
+            if (consume(ID, "octet")) return "octet";
+        };
+        
+        var const_value = function () {
+            if (consume(ID, "true")) return { type: "boolean", value: true };
+            if (consume(ID, "false")) return { type: "boolean", value: false };
+            if (consume(ID, "null")) return { type: "null" };
+            if (consume(ID, "Infinity")) return { type: "Infinity", negative: false };
+            if (consume(ID, "NaN")) return { type: "NaN" };
+            var ret = consume(FLOAT) || consume(INT);
+            if (ret) return { type: "number", value: 1 * ret.value };
+            var tok = consume(OTHER, "-");
+            if (tok) {
+                if (consume(ID, "Infinity")) return { type: "Infinity", negative: true };
+                else tokens.unshift(tok);
+            }
+        };
+        
+        var type_suffix = function (obj) {
+            while (true) {
+                all_ws();
+                if (consume(OTHER, "?")) {
+                    if (obj.nullable) error("Can't nullable more than once");
+                    obj.nullable = true;
+                }
+                else if (consume(OTHER, "[")) {
+                    all_ws();
+                    consume(OTHER, "]") || error("Unterminated array type");
+                    if (!obj.array) {
+                        obj.array = 1;
+                        obj.nullableArray = [obj.nullable];
+                    }
+                    else {
+                        obj.array++;
+                        obj.nullableArray.push(obj.nullable);
+                    }
+                    obj.nullable = false;
+                }
+                else return;
+            }
+        };
+        
+        var single_type = function () {
+            var prim = primitive_type()
+            ,   ret = { sequence: false, generic: null, nullable: false, array: false, union: false }
+            ,   name
+            ,   value
+            ;
+            if (prim) {
+                ret.idlType = prim;
+            }
+            else if (name = consume(ID)) {
+                value = name.value;
+                all_ws();
+                // Generic types
+                if (consume(OTHER, "<")) {
+                    // backwards compat
+                    if (value === "sequence") {
+                        ret.sequence = true;
+                    }
+                    ret.generic = value;
+                    ret.idlType = type() || error("Error parsing generic type " + value);
+                    all_ws();
+                    if (!consume(OTHER, ">")) error("Unterminated generic type " + value);
+                    type_suffix(ret);
+                    return ret;
+                }
+                else {
+                    ret.idlType = value;
+                }
+            }
+            else {
+                return;
+            }
+            type_suffix(ret);
+            if (ret.nullable && !ret.array && ret.idlType === "any") error("Type any cannot be made nullable");
+            return ret;
+        };
+        
+        var union_type = function () {
+            all_ws();
+            if (!consume(OTHER, "(")) return;
+            var ret = { sequence: false, generic: null, nullable: false, array: false, union: true, idlType: [] };
+            var fst = type() || error("Union type with no content");
+            ret.idlType.push(fst);
+            while (true) {
+                all_ws();
+                if (!consume(ID, "or")) break;
+                var typ = type() || error("No type after 'or' in union type");
+                ret.idlType.push(typ);
+            }
+            if (!consume(OTHER, ")")) error("Unterminated union type");
+            type_suffix(ret);
+            return ret;
+        };
+        
+        var type = function () {
+            return single_type() || union_type();
+        };
+        
+        var argument = function (store) {
+            var ret = { optional: false, variadic: false };
+            ret.extAttrs = extended_attrs(store);
+            all_ws(store, "pea");
+            var opt_token = consume(ID, "optional");
+            if (opt_token) {
+                ret.optional = true;
+                all_ws();
+            }
+            ret.idlType = type();
+            if (!ret.idlType) {
+                if (opt_token) tokens.unshift(opt_token);
+                return;
+            }
+            var type_token = last_token;
+            if (!ret.optional) {
+                all_ws();
+                if (tokens.length >= 3 &&
+                    tokens[0].type === "other" && tokens[0].value === "." &&
+                    tokens[1].type === "other" && tokens[1].value === "." &&
+                    tokens[2].type === "other" && tokens[2].value === "."
+                    ) {
+                    tokens.shift();
+                    tokens.shift();
+                    tokens.shift();
+                    ret.variadic = true;
+                }
+            }
+            all_ws();
+            var name = consume(ID);
+            if (!name) {
+                if (opt_token) tokens.unshift(opt_token);
+                tokens.unshift(type_token);
+                return;
+            }
+            ret.name = name.value;
+            if (ret.optional) {
+                all_ws();
+                ret["default"] = default_();
+            }
+            return ret;
+        };
+        
+        var argument_list = function (store) {
+            var ret = []
+            ,   arg = argument(store ? ret : null)
+            ;
+            if (!arg) return;
+            ret.push(arg);
+            while (true) {
+                all_ws(store ? ret : null);
+                if (!consume(OTHER, ",")) return ret;
+                var nxt = argument(store ? ret : null) || error("Trailing comma in arguments list");
+                ret.push(nxt);
+            }
+        };
+        
+        var type_pair = function () {
+            all_ws();
+            var k = type();
+            if (!k) return;
+            all_ws()
+            if (!consume(OTHER, ",")) return;
+            all_ws();
+            var v = type();
+            if (!v) return;
+            return [k, v];
+        };
+        
+        var simple_extended_attr = function (store) {
+            all_ws();
+            var name = consume(ID);
+            if (!name) return;
+            var ret = {
+                name: name.value
+            ,   "arguments": null
+            };
+            all_ws();
+            var eq = consume(OTHER, "=");
+            if (eq) {
+                var rhs;
+                all_ws();
+                if (rhs = consume(ID)) {
+                  ret.rhs = rhs
+                }
+                else if (consume(OTHER, "(")) {
+                    // [Exposed=(Window,Worker)]
+                    rhs = [];
+                    var id = consume(ID);
+                    if (id) {
+                      rhs = [id.value];
+                    }
+                    identifiers(rhs);
+                    consume(OTHER, ")") || error("Unexpected token in extended attribute argument list or type pair");
+                    ret.rhs = {
+                        type: "identifier-list",
+                        value: rhs
+                    };
+                }
+                if (!ret.rhs) return error("No right hand side to extended attribute assignment");
+            }
+            all_ws();
+            if (consume(OTHER, "(")) {
+                var args, pair;
+                // [Constructor(DOMString str)]
+                if (args = argument_list(store)) {
+                    ret["arguments"] = args;
+                }
+                // [MapClass(DOMString, DOMString)]
+                else if (pair = type_pair()) {
+                    ret.typePair = pair;
+                }
+                // [Constructor()]
+                else {
+                    ret["arguments"] = [];
+                }
+                all_ws();
+                consume(OTHER, ")") || error("Unexpected token in extended attribute argument list or type pair");
+            }
+            return ret;
+        };
+        
+        // Note: we parse something simpler than the official syntax. It's all that ever
+        // seems to be used
+        var extended_attrs = function (store) {
+            var eas = [];
+            all_ws(store);
+            if (!consume(OTHER, "[")) return eas;
+            eas[0] = simple_extended_attr(store) || error("Extended attribute with not content");
+            all_ws();
+            while (consume(OTHER, ",")) {
+                eas.push(simple_extended_attr(store) || error("Trailing comma in extended attribute"));
+                all_ws();
+            }
+            consume(OTHER, "]") || error("No end of extended attribute");
+            return eas;
+        };
+        
+        var default_ = function () {
+            all_ws();
+            if (consume(OTHER, "=")) {
+                all_ws();
+                var def = const_value();
+                if (def) {
+                    return def;
+                }
+                else if (consume(OTHER, "[")) {
+                    if (!consume(OTHER, "]")) error("Default sequence value must be empty");
+                    return { type: "sequence", value: [] };
+                }
+                else {
+                    var str = consume(STR) || error("No value for default");
+                    str.value = str.value.replace(/^"/, "").replace(/"$/, "");
+                    return str;
+                }
+            }
+        };
+        
+        var const_ = function (store) {
+            all_ws(store, "pea");
+            if (!consume(ID, "const")) return;
+            var ret = { type: "const", nullable: false };
+            all_ws();
+            var typ = primitive_type();
+            if (!typ) {
+                typ = consume(ID) || error("No type for const");
+                typ = typ.value;
+            }
+            ret.idlType = typ;
+            all_ws();
+            if (consume(OTHER, "?")) {
+                ret.nullable = true;
+                all_ws();
+            }
+            var name = consume(ID) || error("No name for const");
+            ret.name = name.value;
+            all_ws();
+            consume(OTHER, "=") || error("No value assignment for const");
+            all_ws();
+            var cnt = const_value();
+            if (cnt) ret.value = cnt;
+            else error("No value for const");
+            all_ws();
+            consume(OTHER, ";") || error("Unterminated const");
+            return ret;
+        };
+        
+        var inheritance = function () {
+            all_ws();
+            if (consume(OTHER, ":")) {
+                all_ws();
+                var inh = consume(ID) || error ("No type in inheritance");
+                return inh.value;
+            }
+        };
+        
+        var operation_rest = function (ret, store) {
+            all_ws();
+            if (!ret) ret = {};
+            var name = consume(ID);
+            ret.name = name ? name.value : null;
+            all_ws();
+            consume(OTHER, "(") || error("Invalid operation");
+            ret["arguments"] = argument_list(store) || [];
+            all_ws();
+            consume(OTHER, ")") || error("Unterminated operation");
+            all_ws();
+            consume(OTHER, ";") || error("Unterminated operation");
+            return ret;
+        };
+        
+        var callback = function (store) {
+            all_ws(store, "pea");
+            var ret;
+            if (!consume(ID, "callback")) return;
+            all_ws();
+            var tok = consume(ID, "interface");
+            if (tok) {
+                tokens.unshift(tok);
+                ret = interface_();
+                ret.type = "callback interface";
+                return ret;
+            }
+            var name = consume(ID) || error("No name for callback");
+            ret = { type: "callback", name: name.value };
+            all_ws();
+            consume(OTHER, "=") || error("No assignment in callback");
+            all_ws();
+            ret.idlType = return_type();
+            all_ws();
+            consume(OTHER, "(") || error("No arguments in callback");
+            ret["arguments"] = argument_list(store) || [];
+            all_ws();
+            consume(OTHER, ")") || error("Unterminated callback");
+            all_ws();
+            consume(OTHER, ";") || error("Unterminated callback");
+            return ret;
+        };
+
+        var attribute = function (store) {
+            all_ws(store, "pea");
+            var grabbed = []
+            ,   ret = {
+                type:           "attribute"
+            ,   "static":       false
+            ,   stringifier:    false
+            ,   inherit:        false
+            ,   readonly:       false
+            };
+            if (consume(ID, "static")) {
+                ret["static"] = true;
+                grabbed.push(last_token);
+            }
+            else if (consume(ID, "stringifier")) {
+                ret.stringifier = true;
+                grabbed.push(last_token);
+            }
+            var w = all_ws();
+            if (w) grabbed.push(w);
+            if (consume(ID, "inherit")) {
+                if (ret["static"] || ret.stringifier) error("Cannot have a static or stringifier inherit");
+                ret.inherit = true;
+                grabbed.push(last_token);
+                var w = all_ws();
+                if (w) grabbed.push(w);
+            }
+            if (consume(ID, "readonly")) {
+                ret.readonly = true;
+                grabbed.push(last_token);
+                var w = all_ws();
+                if (w) grabbed.push(w);
+            }
+            if (!consume(ID, "attribute")) {
+                tokens = grabbed.concat(tokens);
+                return;
+            }
+            all_ws();
+            ret.idlType = type() || error("No type in attribute");
+            if (ret.idlType.sequence) error("Attributes cannot accept sequence types");
+            all_ws();
+            var name = consume(ID) || error("No name in attribute");
+            ret.name = name.value;
+            all_ws();
+            consume(OTHER, ";") || error("Unterminated attribute");
+            return ret;
+        };
+        
+        var return_type = function () {
+            var typ = type();
+            if (!typ) {
+                if (consume(ID, "void")) {
+                    return "void";
+                }
+                else error("No return type");
+            }
+            return typ;
+        };
+        
+        var operation = function (store) {
+            all_ws(store, "pea");
+            var ret = {
+                type:           "operation"
+            ,   getter:         false
+            ,   setter:         false
+            ,   creator:        false
+            ,   deleter:        false
+            ,   legacycaller:   false
+            ,   "static":       false
+            ,   stringifier:    false
+            };
+            while (true) {
+                all_ws();
+                if (consume(ID, "getter")) ret.getter = true;
+                else if (consume(ID, "setter")) ret.setter = true;
+                else if (consume(ID, "creator")) ret.creator = true;
+                else if (consume(ID, "deleter")) ret.deleter = true;
+                else if (consume(ID, "legacycaller")) ret.legacycaller = true;
+                else break;
+            }
+            if (ret.getter || ret.setter || ret.creator || ret.deleter || ret.legacycaller) {
+                all_ws();
+                ret.idlType = return_type();
+                operation_rest(ret, store);
+                return ret;
+            }
+            if (consume(ID, "static")) {
+                ret["static"] = true;
+                ret.idlType = return_type();
+                operation_rest(ret, store);
+                return ret;
+            }
+            else if (consume(ID, "stringifier")) {
+                ret.stringifier = true;-
+                all_ws();
+                if (consume(OTHER, ";")) return ret;
+                ret.idlType = return_type();
+                operation_rest(ret, store);
+                return ret;
+            }
+            ret.idlType = return_type();
+            all_ws();
+            if (consume(ID, "iterator")) {
+                all_ws();
+                ret.type = "iterator";
+                if (consume(ID, "object")) {
+                    ret.iteratorObject = "object";
+                }
+                else if (consume(OTHER, "=")) {
+                    all_ws();
+                    var name = consume(ID) || error("No right hand side in iterator");
+                    ret.iteratorObject = name.value;
+                }
+                all_ws();
+                consume(OTHER, ";") || error("Unterminated iterator");
+                return ret;
+            }
+            else {
+                operation_rest(ret, store);
+                return ret;
+            }
+        };
+        
+        var identifiers = function (arr) {
+            while (true) {
+                all_ws();
+                if (consume(OTHER, ",")) {
+                    all_ws();
+                    var name = consume(ID) || error("Trailing comma in identifiers list");
+                    arr.push(name.value);
+                }
+                else break;
+            }
+        };
+        
+        var serialiser = function (store) {
+            all_ws(store, "pea");
+            if (!consume(ID, "serializer")) return;
+            var ret = { type: "serializer" };
+            all_ws();
+            if (consume(OTHER, "=")) {
+                all_ws();
+                if (consume(OTHER, "{")) {
+                    ret.patternMap = true;
+                    all_ws();
+                    var id = consume(ID);
+                    if (id && id.value === "getter") {
+                        ret.names = ["getter"];
+                    }
+                    else if (id && id.value === "inherit") {
+                        ret.names = ["inherit"];
+                        identifiers(ret.names);
+                    }
+                    else if (id) {
+                        ret.names = [id.value];
+                        identifiers(ret.names);
+                    }
+                    else {
+                        ret.names = [];
+                    }
+                    all_ws();
+                    consume(OTHER, "}") || error("Unterminated serializer pattern map");
+                }
+                else if (consume(OTHER, "[")) {
+                    ret.patternList = true;
+                    all_ws();
+                    var id = consume(ID);
+                    if (id && id.value === "getter") {
+                        ret.names = ["getter"];
+                    }
+                    else if (id) {
+                        ret.names = [id.value];
+                        identifiers(ret.names);
+                    }
+                    else {
+                        ret.names = [];
+                    }
+                    all_ws();
+                    consume(OTHER, "]") || error("Unterminated serializer pattern list");
+                }
+                else {
+                    var name = consume(ID) || error("Invalid serializer");
+                    ret.name = name.value;
+                }
+                all_ws();
+                consume(OTHER, ";") || error("Unterminated serializer");
+                return ret;
+            }
+            else if (consume(OTHER, ";")) {
+                // noop, just parsing
+            }
+            else {
+                ret.idlType = return_type();
+                all_ws();
+                ret.operation = operation_rest(null, store);
+            }
+            return ret;
+        };
+
+        var iterable_type = function() {
+            if (consume(ID, "iterable")) return "iterable";
+            else if (consume(ID, "legacyiterable")) return "legacyiterable";
+            else if (consume(ID, "maplike")) return "maplike";
+            else if (consume(ID, "setlike")) return "setlike";
+            else return;
+        }
+
+        var readonly_iterable_type = function() {
+            if (consume(ID, "maplike")) return "maplike";
+            else if (consume(ID, "setlike")) return "setlike";
+            else return;
+        }
+
+        var iterable = function (store) {
+            all_ws(store, "pea");
+            var grabbed = [],
+                ret = {type: null, idlType: null, readonly: false};
+            if (consume(ID, "readonly")) {
+                ret.readonly = true;
+                grabbed.push(last_token);
+                var w = all_ws();
+                if (w) grabbed.push(w);
+            }
+            var consumeItType = ret.readonly ? readonly_iterable_type : iterable_type;
+
+            var ittype = consumeItType();
+            if (!ittype) {
+                tokens = grabbed.concat(tokens);
+                return;
+            }
+
+            var secondTypeRequired = ittype === "maplike";
+            var secondTypeAllowed = secondTypeRequired || ittype === "iterable";
+            ret.type = ittype;
+            if (ret.type !== 'maplike' && ret.type !== 'setlike')
+                delete ret.readonly;
+            all_ws();
+            if (consume(OTHER, "<")) {
+                ret.idlType = type() || error("Error parsing " + ittype + " declaration");
+                all_ws();
+                if (secondTypeAllowed) {
+                    var type2 = null;
+                    if (consume(OTHER, ",")) {
+                        all_ws();
+                        type2 = type();
+                        all_ws();                        
+                    }
+                    if (type2)
+                        ret.idlType = [ret.idlType, type2];
+                    else if (secondTypeRequired)
+                        error("Missing second type argument in " + ittype + " declaration");
+                }
+                if (!consume(OTHER, ">")) error("Unterminated " + ittype + " declaration");
+                all_ws();
+                if (!consume(OTHER, ";")) error("Missing semicolon after " + ittype + " declaration");
+            }
+            else
+                error("Error parsing " + ittype + " declaration");
+
+            return ret;            
+        }        
+        
+        var interface_ = function (isPartial, store) {
+            all_ws(isPartial ? null : store, "pea");
+            if (!consume(ID, "interface")) return;
+            all_ws();
+            var name = consume(ID) || error("No name for interface");
+            var mems = []
+            ,   ret = {
+                type:   "interface"
+            ,   name:   name.value
+            ,   partial:    false
+            ,   members:    mems
+            };
+            if (!isPartial) ret.inheritance = inheritance() || null;
+            all_ws();
+            consume(OTHER, "{") || error("Bodyless interface");
+            while (true) {
+                all_ws(store ? mems : null);
+                if (consume(OTHER, "}")) {
+                    all_ws();
+                    consume(OTHER, ";") || error("Missing semicolon after interface");
+                    return ret;
+                }
+                var ea = extended_attrs(store ? mems : null);
+                all_ws();
+                var cnt = const_(store ? mems : null);
+                if (cnt) {
+                    cnt.extAttrs = ea;
+                    ret.members.push(cnt);
+                    continue;
+                }
+                var mem = (opt.allowNestedTypedefs && typedef(store ? mems : null)) ||
+                          iterable(store ? mems : null) ||
+                          serialiser(store ? mems : null) ||
+                          attribute(store ? mems : null) ||
+                          operation(store ? mems : null) ||
+                          error("Unknown member");
+                mem.extAttrs = ea;
+                ret.members.push(mem);
+            }
+        };
+        
+        var partial = function (store) {
+            all_ws(store, "pea");
+            if (!consume(ID, "partial")) return;
+            var thing = dictionary(true, store) ||
+                        interface_(true, store) ||
+                        error("Partial doesn't apply to anything");
+            thing.partial = true;
+            return thing;
+        };
+        
+        var dictionary = function (isPartial, store) {
+            all_ws(isPartial ? null : store, "pea");
+            if (!consume(ID, "dictionary")) return;
+            all_ws();
+            var name = consume(ID) || error("No name for dictionary");
+            var mems = []
+            ,   ret = {
+                type:   "dictionary"
+            ,   name:   name.value
+            ,   partial:    false
+            ,   members:    mems
+            };
+            if (!isPartial) ret.inheritance = inheritance() || null;
+            all_ws();
+            consume(OTHER, "{") || error("Bodyless dictionary");
+            while (true) {
+                all_ws(store ? mems : null);
+                if (consume(OTHER, "}")) {
+                    all_ws();
+                    consume(OTHER, ";") || error("Missing semicolon after dictionary");
+                    return ret;
+                }
+                var ea = extended_attrs(store ? mems : null);
+                all_ws(store ? mems : null, "pea");
+                var required = consume(ID, "required");
+                var typ = type() || error("No type for dictionary member");
+                all_ws();
+                var name = consume(ID) || error("No name for dictionary member");
+                var dflt = default_();
+                if (required && dflt) error("Required member must not have a default");
+                ret.members.push({
+                    type:       "field"
+                ,   name:       name.value
+                ,   required:   !!required
+                ,   idlType:    typ
+                ,   extAttrs:   ea
+                ,   "default":  dflt
+                });
+                all_ws();
+                consume(OTHER, ";") || error("Unterminated dictionary member");
+            }
+        };
+        
+        var exception = function (store) {
+            all_ws(store, "pea");
+            if (!consume(ID, "exception")) return;
+            all_ws();
+            var name = consume(ID) || error("No name for exception");
+            var mems = []
+            ,   ret = {
+                type:   "exception"
+            ,   name:   name.value
+            ,   members:    mems
+            };
+            ret.inheritance = inheritance() || null;
+            all_ws();
+            consume(OTHER, "{") || error("Bodyless exception");
+            while (true) {
+                all_ws(store ? mems : null);
+                if (consume(OTHER, "}")) {
+                    all_ws();
+                    consume(OTHER, ";") || error("Missing semicolon after exception");
+                    return ret;
+                }
+                var ea = extended_attrs(store ? mems : null);
+                all_ws(store ? mems : null, "pea");
+                var cnt = const_();
+                if (cnt) {
+                    cnt.extAttrs = ea;
+                    ret.members.push(cnt);
+                }
+                else {
+                    var typ = type();
+                    all_ws();
+                    var name = consume(ID);
+                    all_ws();
+                    if (!typ || !name || !consume(OTHER, ";")) error("Unknown member in exception body");
+                    ret.members.push({
+                        type:       "field"
+                    ,   name:       name.value
+                    ,   idlType:    typ
+                    ,   extAttrs:   ea
+                    });
+                }
+            }
+        };
+        
+        var enum_ = function (store) {
+            all_ws(store, "pea");
+            if (!consume(ID, "enum")) return;
+            all_ws();
+            var name = consume(ID) || error("No name for enum");
+            var vals = []
+            ,   ret = {
+                type:   "enum"
+            ,   name:   name.value
+            ,   values: vals
+            };
+            all_ws();
+            consume(OTHER, "{") || error("No curly for enum");
+            var saw_comma = false;
+            while (true) {
+                all_ws(store ? vals : null);
+                if (consume(OTHER, "}")) {
+                    all_ws();
+                    consume(OTHER, ";") || error("No semicolon after enum");
+                    return ret;
+                }
+                var val = consume(STR) || error("Unexpected value in enum");
+                ret.values.push(val.value.replace(/"/g, ""));
+                all_ws(store ? vals : null);
+                if (consume(OTHER, ",")) {
+                    if (store) vals.push({ type: "," });
+                    all_ws(store ? vals : null);
+                    saw_comma = true;
+                }
+                else {
+                    saw_comma = false;
+                }
+            }
+        };
+        
+        var typedef = function (store) {
+            all_ws(store, "pea");
+            if (!consume(ID, "typedef")) return;
+            var ret = {
+                type:   "typedef"
+            };
+            all_ws();
+            ret.typeExtAttrs = extended_attrs();
+            all_ws(store, "tpea");
+            ret.idlType = type() || error("No type in typedef");
+            all_ws();
+            var name = consume(ID) || error("No name in typedef");
+            ret.name = name.value;
+            all_ws();
+            consume(OTHER, ";") || error("Unterminated typedef");
+            return ret;
+        };
+        
+        var implements_ = function (store) {
+            all_ws(store, "pea");
+            var target = consume(ID);
+            if (!target) return;
+            var w = all_ws();
+            if (consume(ID, "implements")) {
+                var ret = {
+                    type:   "implements"
+                ,   target: target.value
+                };
+                all_ws();
+                var imp = consume(ID) || error("Incomplete implements statement");
+                ret["implements"] = imp.value;
+                all_ws();
+                consume(OTHER, ";") || error("No terminating ; for implements statement");
+                return ret;
+            }
+            else {
+                // rollback
+                tokens.unshift(w);
+                tokens.unshift(target);
+            }
+        };
+        
+        var definition = function (store) {
+            return  callback(store)             ||
+                    interface_(false, store)    ||
+                    partial(store)              ||
+                    dictionary(false, store)    ||
+                    exception(store)            ||
+                    enum_(store)                ||
+                    typedef(store)              ||
+                    implements_(store)
+                    ;
+        };
+        
+        var definitions = function (store) {
+            if (!tokens.length) return [];
+            var defs = [];
+            while (true) {
+                var ea = extended_attrs(store ? defs : null)
+                ,   def = definition(store ? defs : null);
+                if (!def) {
+                    if (ea.length) error("Stray extended attributes");
+                    break;
+                }
+                def.extAttrs = ea;
+                defs.push(def);
+            }
+            return defs;
+        };
+        var res = definitions(opt.ws);
+        if (tokens.length) error("Unrecognised tokens");
+        return res;
+    };
+
+    var inNode = typeof module !== "undefined" && module.exports
+    ,   obj = {
+            parse:  function (str, opt) {
+                if (!opt) opt = {};
+                var tokens = tokenise(str);
+                return parse(tokens, opt);
+            }
+    };
+
+    if (inNode) module.exports = obj;
+    else        self.WebIDL2 = obj;
+}());
similarity index 92%
rename from LayoutTests/imported/w3c/resources/idlharness.js
rename to LayoutTests/resources/idlharness.js
index 5002ec5..a52228e 100644 (file)
@@ -49,14 +49,19 @@ policies and contribution forms [3].
 (function(){
 "use strict";
 /// Helpers ///
-function constValue (cnt) {
+function constValue (cnt)
+//@{
+{
     if (cnt.type === "null") return null;
     if (cnt.type === "NaN") return NaN;
     if (cnt.type === "Infinity") return cnt.negative ? -Infinity : Infinity;
     return cnt.value;
 }
 
-function minOverloadLength(overloads) {
+//@}
+function minOverloadLength(overloads)
+//@{
+{
     if (!overloads.length) {
         return 0;
     }
@@ -69,7 +74,10 @@ function minOverloadLength(overloads) {
     .reduce(function(m, n) { return Math.min(m, n); });
 }
 
-function throwOrReject(a_test, operation, fn, obj, args,  message, cb) {
+//@}
+function throwOrReject(a_test, operation, fn, obj, args,  message, cb)
+//@{
+{
     if (operation.idlType.generic !== "Promise") {
         assert_throws(new TypeError(), function() {
             fn.apply(obj, args);
@@ -87,7 +95,10 @@ function throwOrReject(a_test, operation, fn, obj, args,  message, cb) {
     }
 }
 
-function awaitNCallbacks(n, cb, ctx) {
+//@}
+function awaitNCallbacks(n, cb, ctx)
+//@{
+{
     var counter = 0;
     return function() {
         counter++;
@@ -97,7 +108,10 @@ function awaitNCallbacks(n, cb, ctx) {
     };
 }
 
-var fround = (function(){
+//@}
+var fround =
+//@{
+(function(){
     if (Math.fround) return Math.fround;
 
     var arr = new Float32Array(1);
@@ -106,6 +120,7 @@ var fround = (function(){
         return arr[0];
     };
 })();
+//@}
 
 /// IdlArray ///
 // Entry point
@@ -447,6 +462,14 @@ IdlArray.prototype.assert_type_is = function(value, type)
         return;
     }
 
+    if (type.generic === "Promise") {
+        assert_true("then" in value, "Attribute with a Promise type has a then property");
+        // TODO: Ideally, we would check on project fulfillment
+        // that we get the right type
+        // but that would require making the type check async
+        return;
+    }
+
     type = type.idlType;
 
     switch(type)
@@ -642,7 +665,9 @@ function IdlDictionary(obj)
 IdlDictionary.prototype = Object.create(IdlObject.prototype);
 
 /// IdlInterface ///
-function IdlInterface(obj, is_callback) {
+function IdlInterface(obj, is_callback)
+//@{
+{
     /**
      * obj is an object produced by the WebIDLParser.js "interface" production.
      */
@@ -679,6 +704,7 @@ function IdlInterface(obj, is_callback) {
 
     this._is_callback = is_callback;
 }
+//@}
 IdlInterface.prototype = Object.create(IdlObject.prototype);
 IdlInterface.prototype.is_callback = function()
 //@{
@@ -775,8 +801,8 @@ IdlInterface.prototype.test_self = function()
 
         if (this.is_callback()) {
             // "The internal [[Prototype]] property of an interface object for
-            // a callback interface MUST be the Object.prototype object."
-            assert_equals(Object.getPrototypeOf(self[this.name]), Object.prototype,
+            // a callback interface must be the Function.prototype object."
+            assert_equals(Object.getPrototypeOf(self[this.name]), Function.prototype,
                           "prototype of self's property " + format_value(this.name) + " is not Object.prototype");
 
             return;
@@ -1109,10 +1135,12 @@ IdlInterface.prototype.test_member_const = function(member)
 //@}
 IdlInterface.prototype.test_member_attribute = function(member)
 //@{
-{
-    test(function()
+  {
+    var a_test = async_test(this.name + " interface: attribute " + member.name);
+    a_test.step(function()
     {
         if (this.is_callback() && !this.has_constants()) {
+            a_test.done()
             return;
         }
 
@@ -1125,6 +1153,7 @@ IdlInterface.prototype.test_member_attribute = function(member)
             assert_own_property(self[this.name], member.name,
                 "The interface object must have a property " +
                 format_value(member.name));
+            a_test.done();
         } else if (this.is_global()) {
             assert_own_property(self, member.name,
                 "The global object must have a property " +
@@ -1153,23 +1182,42 @@ IdlInterface.prototype.test_member_attribute = function(member)
                               "Gets on a global should not require an explicit this");
             }
 
-            this.do_interface_attribute_asserts(self, member);
+            // do_interface_attribute_asserts must be the last thing we do,
+            // since it will call done() on a_test.
+            this.do_interface_attribute_asserts(self, member, a_test);
         } else {
             assert_true(member.name in self[this.name].prototype,
                 "The prototype object must have a property " +
                 format_value(member.name));
 
             if (!member.has_extended_attribute("LenientThis")) {
-                assert_throws(new TypeError(), function() {
-                    self[this.name].prototype[member.name];
-                }.bind(this), "getting property on prototype object must throw TypeError");
+                if (member.idlType.generic !== "Promise") {
+                    assert_throws(new TypeError(), function() {
+                        self[this.name].prototype[member.name];
+                    }.bind(this), "getting property on prototype object must throw TypeError");
+                    // do_interface_attribute_asserts must be the last thing we
+                    // do, since it will call done() on a_test.
+                    this.do_interface_attribute_asserts(self[this.name].prototype, member, a_test);
+                } else {
+                    promise_rejects(a_test, new TypeError(),
+                                    self[this.name].prototype[member.name])
+                        .then(function() {
+                            // do_interface_attribute_asserts must be the last
+                            // thing we do, since it will call done() on a_test.
+                            this.do_interface_attribute_asserts(self[this.name].prototype,
+                                                                member, a_test);
+                        }.bind(this));
+                }
             } else {
                 assert_equals(self[this.name].prototype[member.name], undefined,
                               "getting property on prototype object must return undefined");
+              // do_interface_attribute_asserts must be the last thing we do,
+              // since it will call done() on a_test.
+              this.do_interface_attribute_asserts(self[this.name].prototype, member, a_test);
             }
-            this.do_interface_attribute_asserts(self[this.name].prototype, member);
+
         }
-    }.bind(this), this.name + " interface: attribute " + member.name);
+    }.bind(this));
 };
 
 //@}
@@ -1308,6 +1356,46 @@ IdlInterface.prototype.do_member_operation_asserts = function(memberHolderObject
 }
 
 //@}
+IdlInterface.prototype.add_iterable_members = function(member)
+//@{
+{
+    this.members.push({type: "operation", name: "entries", idlType: "iterator", arguments: []});
+    this.members.push({type: "operation", name: "keys", idlType: "iterator", arguments: []});
+    this.members.push({type: "operation", name: "values", idlType: "iterator", arguments: []});
+    this.members.push({type: "operation", name: "forEach", idlType: "void", arguments:
+        [{ name: "callback", idlType: {idlType: "function"}},
+        { name: "thisValue", idlType: {idlType: "any"}, optional: true}]});
+};
+
+//@}
+IdlInterface.prototype.test_member_iterable = function(member)
+//@{
+{
+    var interfaceName = this.name;
+    var isPairIterator = member.idlType instanceof Array;
+    test(function()
+    {
+        var descriptor = Object.getOwnPropertyDescriptor(self[interfaceName].prototype, Symbol.iterator);
+        assert_true(descriptor.writable, "property is not writable");
+        assert_true(descriptor.configurable, "property is not configurable");
+        assert_false(descriptor.enumerable, "property is enumerable");
+        assert_equals(self[interfaceName].prototype[Symbol.iterator].name, isPairIterator ? "entries" : "values", "@@iterator function does not have the right name");
+    }, "Testing Symbol.iterator property of iterable interface " + interfaceName);
+
+    if (isPairIterator) {
+        test(function() {
+            assert_equals(self[interfaceName].prototype[Symbol.iterator], self[interfaceName].prototype["entries"], "entries method is not the same as @@iterator");
+        }, "Testing pair iterable interface " + interfaceName);
+    } else {
+        test(function() {
+            ["entries", "keys", "values", "forEach", Symbol.Iterator].forEach(function(property) {
+                assert_equals(self[interfaceName].prototype[property], Array.prototype[property], property + " function is not the same as Array one");
+            });
+        }, "Testing value iterable interface " + interfaceName);
+    }
+};
+
+//@}
 IdlInterface.prototype.test_member_stringifier = function(member)
 //@{
 {
@@ -1378,6 +1466,19 @@ IdlInterface.prototype.test_members = function()
     for (var i = 0; i < this.members.length; i++)
     {
         var member = this.members[i];
+        switch (member.type) {
+        case "iterable":
+            this.add_iterable_members(member);
+            break;
+        // TODO: add setlike and maplike handling.
+        default:
+            break;
+        }
+    }
+
+    for (var i = 0; i < this.members.length; i++)
+    {
+        var member = this.members[i];
         if (member.untested) {
             continue;
         }
@@ -1394,6 +1495,9 @@ IdlInterface.prototype.test_members = function()
             {
                 this.test_member_attribute(member);
             }
+            if (member.stringifier) {
+                this.test_member_stringifier(member);
+            }
             break;
 
         case "operation":
@@ -1411,6 +1515,9 @@ IdlInterface.prototype.test_members = function()
             }
             break;
 
+        case "iterable":
+            this.test_member_iterable(member);
+            break;
         default:
             // TODO: check more member types.
             break;
@@ -1511,12 +1618,13 @@ IdlInterface.prototype.test_interface_of = function(desc, obj, exception, expect
         var member = this.members[i];
         if (member.type == "attribute" && member.isUnforgeable)
         {
-            test(function()
-            {
+            var a_test = async_test(this.name + " interface: " + desc + ' must have own property "' + member.name + '"');
+            a_test.step(function() {
                 assert_equals(exception, null, "Unexpected exception when evaluating object");
                 assert_equals(typeof obj, expected_typeof, "wrong typeof object");
-                this.do_interface_attribute_asserts(obj, member);
-            }.bind(this), this.name + " interface: " + desc + ' must have own property "' + member.name + '"');
+                // Call do_interface_attribute_asserts last, since it will call a_test.done()
+                this.do_interface_attribute_asserts(obj, member, a_test);
+            }.bind(this));
         }
         else if (member.type == "operation" &&
                  member.name &&
@@ -1635,7 +1743,7 @@ IdlInterface.prototype.has_stringifier = function()
 };
 
 //@}
-IdlInterface.prototype.do_interface_attribute_asserts = function(obj, member)
+IdlInterface.prototype.do_interface_attribute_asserts = function(obj, member, a_test)
 //@{
 {
     // This function tests WebIDL as of 2015-01-27.
@@ -1645,6 +1753,8 @@ IdlInterface.prototype.do_interface_attribute_asserts = function(obj, member)
     // it is not a global, and the global otherwise, and by test_interface_of()
     // with the object as obj.
 
+    var pendingPromises = [];
+
     // "For each exposed attribute of the interface, whether it was declared on
     // the interface itself or one of its consequential interfaces, there MUST
     // exist a corresponding property. The characteristics of this property are
@@ -1684,9 +1794,15 @@ IdlInterface.prototype.do_interface_attribute_asserts = function(obj, member)
         // attribute, then return undefined.
         // "Otherwise, throw a TypeError."
         if (!member.has_extended_attribute("LenientThis")) {
-            assert_throws(new TypeError(), function() {
-                desc.get.call({});
-            }.bind(this), "calling getter on wrong object type must throw TypeError");
+            if (member.idlType.generic !== "Promise") {
+                assert_throws(new TypeError(), function() {
+                    desc.get.call({});
+                }.bind(this), "calling getter on wrong object type must throw TypeError");
+            } else {
+                pendingPromises.push(
+                    promise_rejects(a_test, new TypeError(), desc.get.call({}),
+                                    "calling getter on wrong object type must reject the return promise with TypeError"));
+            }
         } else {
             assert_equals(desc.get.call({}), undefined,
                           "calling getter on wrong object type must return undefined");
@@ -1737,6 +1853,8 @@ IdlInterface.prototype.do_interface_attribute_asserts = function(obj, member)
         // value 1."
         assert_equals(desc.set.length, 1, "setter length must be 1");
     }
+
+    Promise.all(pendingPromises).then(a_test.done.bind(a_test));
 }
 //@}
 
index c9219b5..a8db064 100644 (file)
@@ -8,6 +8,7 @@ set(WebCore_INCLUDE_DIRECTORIES
     "${WEBCORE_DIR}"
     "${WEBCORE_DIR}/Modules/airplay"
     "${WEBCORE_DIR}/Modules/applepay"
+    "${WEBCORE_DIR}/Modules/credentials"
     "${WEBCORE_DIR}/Modules/encryptedmedia"
     "${WEBCORE_DIR}/Modules/encryptedmedia/legacy"
     "${WEBCORE_DIR}/Modules/fetch"
@@ -137,6 +138,7 @@ set(WebCore_IDL_INCLUDES
     xml
 
     Modules/airplay
+    Modules/credentials
     Modules/encryptedmedia/legacy
     Modules/fetch
     Modules/geolocation
@@ -165,6 +167,12 @@ set(WebCore_IDL_INCLUDES
 set(WebCore_NON_SVG_IDL_FILES
     Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl
 
+    Modules/credentials/BasicCredential.idl
+    Modules/credentials/CredentialData.idl
+    Modules/credentials/PasswordCredential.idl
+    Modules/credentials/SiteBoundCredential.idl
+    Modules/credentials/SiteBoundCredentialData.idl
+
     Modules/fetch/DOMWindowFetch.idl
     Modules/fetch/FetchBody.idl
     Modules/fetch/FetchHeaders.idl
@@ -800,6 +808,10 @@ endif ()
 set(WebCore_SOURCES
     Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp
 
+    Modules/credentials/BasicCredential.cpp
+    Modules/credentials/PasswordCredential.cpp
+    Modules/credentials/SiteBoundCredential.cpp
+
     Modules/fetch/DOMWindowFetch.cpp
     Modules/fetch/FetchBody.cpp
     Modules/fetch/FetchBodyConsumer.cpp
index e7f5131..4893ccb 100644 (file)
@@ -1,3 +1,56 @@
+2017-02-27  Jiewen Tan  <jiewen_tan@apple.com>
+
+        [CredentialManagement] Add IDL definitions for Credential, SiteBoundCredential, and PasswordCredential
+        https://bugs.webkit.org/show_bug.cgi?id=168616
+        <rdar://problem/30167149>
+
+        Reviewed by Daniel Bates.
+
+        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:
+
 2017-02-27  Jer Noble  <jer.noble@apple.com>
 
         [WebRTC] Fix remote audio rendering
index f13f26c..d776410 100644 (file)
@@ -30,6 +30,7 @@ VPATH = \
     $(WebCore) \
     $(WebCore)/Modules/airplay \
     $(WebCore)/Modules/applepay \
+    $(WebCore)/Modules/credentials \
     $(WebCore)/Modules/encryptedmedia \
     $(WebCore)/Modules/encryptedmedia/legacy \
     $(WebCore)/Modules/fetch \
@@ -91,6 +92,11 @@ JS_BINDING_IDLS = \
     $(WebCore)/Modules/applepay/ApplePayShippingMethod.idl \
     $(WebCore)/Modules/applepay/ApplePayShippingMethodSelectedEvent.idl \
     $(WebCore)/Modules/applepay/ApplePayValidateMerchantEvent.idl \
+    $(WebCore)/Modules/credentials/BasicCredential.idl \
+    $(WebCore)/Modules/credentials/CredentialData.idl \
+    $(WebCore)/Modules/credentials/PasswordCredential.idl \
+    $(WebCore)/Modules/credentials/SiteBoundCredential.idl \
+    $(WebCore)/Modules/credentials/SiteBoundCredentialData.idl \
     $(WebCore)/Modules/encryptedmedia/MediaKeyMessageEvent.idl \
     $(WebCore)/Modules/encryptedmedia/MediaKeySession.idl \
     $(WebCore)/Modules/encryptedmedia/MediaKeySessionType.idl \
diff --git a/Source/WebCore/Modules/credentials/BasicCredential.cpp b/Source/WebCore/Modules/credentials/BasicCredential.cpp
new file mode 100644 (file)
index 0000000..e13c5e0
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "BasicCredential.h"
+
+namespace WebCore {
+
+BasicCredential::BasicCredential(const CredentialData& data, Type type)
+    : m_id(data.id)
+    , m_type(type)
+{
+}
+
+BasicCredential::~BasicCredential()
+{
+}
+
+String BasicCredential::type() const
+{
+    switch (m_type) {
+    case Type::Password:
+        return ASCIILiteral("password");
+    case Type::Federated:
+        return ASCIILiteral("federated");
+    }
+
+    ASSERT_NOT_REACHED();
+    return emptyString();
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/credentials/BasicCredential.h b/Source/WebCore/Modules/credentials/BasicCredential.h
new file mode 100644 (file)
index 0000000..4579a24
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "CredentialData.h"
+#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class BasicCredential : public RefCounted<BasicCredential> {
+public:
+    enum class Type {
+        Password,
+        Federated,
+    };
+
+    virtual ~BasicCredential();
+
+    const String& id() const { return m_id; }
+    String type() const;
+
+protected:
+    BasicCredential(const CredentialData&, Type);
+
+private:
+    String m_id;
+    Type m_type;
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/credentials/BasicCredential.idl b/Source/WebCore/Modules/credentials/BasicCredential.idl
new file mode 100644 (file)
index 0000000..ade33eb
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    InterfaceName=Credential,
+] interface BasicCredential {
+    readonly attribute USVString id;
+    readonly attribute DOMString type;
+};
diff --git a/Source/WebCore/Modules/credentials/CredentialData.h b/Source/WebCore/Modules/credentials/CredentialData.h
new file mode 100644 (file)
index 0000000..c933a7f
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+struct CredentialData {
+    String id;
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/credentials/CredentialData.idl b/Source/WebCore/Modules/credentials/CredentialData.idl
new file mode 100644 (file)
index 0000000..6014f7f
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+dictionary CredentialData {
+    required USVString id;
+};
diff --git a/Source/WebCore/Modules/credentials/PasswordCredential.cpp b/Source/WebCore/Modules/credentials/PasswordCredential.cpp
new file mode 100644 (file)
index 0000000..8b2210b
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PasswordCredential.h"
+
+namespace WebCore {
+
+PasswordCredential::PasswordCredential(const Data& data)
+    : SiteBoundCredential(data, Type::Password)
+{
+}
+
+PasswordCredential::PasswordCredential(const HTMLFormElement&)
+    : SiteBoundCredential(Data(), Type::Password)
+{
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/credentials/PasswordCredential.h b/Source/WebCore/Modules/credentials/PasswordCredential.h
new file mode 100644 (file)
index 0000000..d06f29d
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "DOMFormData.h"
+#include "SiteBoundCredential.h"
+#include "URLSearchParams.h"
+#include <wtf/Variant.h>
+
+namespace WebCore {
+
+class HTMLFormElement;
+
+class PasswordCredential : public SiteBoundCredential {
+public:
+    struct Data : public SiteBoundCredentialData {
+        String password;
+    };
+
+    static Ref<PasswordCredential> create(const Data& data) { return adoptRef(*new PasswordCredential(data)); }
+    static Ref<PasswordCredential> create(const HTMLFormElement& form) { return adoptRef(*new PasswordCredential(form)); }
+
+    void setIdName(String&& idName) { m_idName = WTFMove(idName); }
+    const String& idName() const { return m_idName; }
+
+    void setPasswordName(String&& passwordName) { m_passwordName = WTFMove(passwordName); }
+    const String& passwordName() const { return m_passwordName; }
+
+    using CredentialBodyType = std::optional<Variant<RefPtr<DOMFormData>, RefPtr<URLSearchParams>>>;
+    void setAdditionalData(CredentialBodyType&& additionalData) { m_additionalData = WTFMove(additionalData); }
+    const CredentialBodyType& additionalData() const { return m_additionalData; }
+
+private:
+    PasswordCredential(const Data&);
+    PasswordCredential(const HTMLFormElement&);
+
+    String m_idName;
+    String m_passwordName;
+    CredentialBodyType m_additionalData;
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/credentials/PasswordCredential.idl b/Source/WebCore/Modules/credentials/PasswordCredential.idl
new file mode 100644 (file)
index 0000000..dc5b948
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+typedef (DOMFormData or URLSearchParams) CredentialBodyType;
+
+[
+    Constructor(PasswordCredentialData data),
+    Constructor(HTMLFormElement form),
+    Exposed=Window,
+] interface PasswordCredential : SiteBoundCredential {
+    attribute USVString idName;
+    attribute USVString passwordName;
+
+    attribute CredentialBodyType? additionalData;
+};
+
+dictionary PasswordCredentialData : SiteBoundCredentialData {
+    required USVString password;
+};
diff --git a/Source/WebCore/Modules/credentials/SiteBoundCredential.cpp b/Source/WebCore/Modules/credentials/SiteBoundCredential.cpp
new file mode 100644 (file)
index 0000000..6c9b43e
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "SiteBoundCredential.h"
+
+namespace WebCore {
+
+SiteBoundCredential::SiteBoundCredential(const SiteBoundCredentialData& data, Type type)
+    : BasicCredential(data, type)
+    , m_name(data.name)
+    , m_iconURL(URL(URL(), data.iconURL))
+    , m_origin(SecurityOrigin::create(URL()))
+{
+}
+
+SiteBoundCredential::~SiteBoundCredential()
+{
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/credentials/SiteBoundCredential.h b/Source/WebCore/Modules/credentials/SiteBoundCredential.h
new file mode 100644 (file)
index 0000000..f320538
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "BasicCredential.h"
+#include "SecurityOrigin.h"
+#include "SiteBoundCredentialData.h"
+#include "URL.h"
+
+namespace WebCore {
+
+class SiteBoundCredential : public BasicCredential {
+public:
+    virtual ~SiteBoundCredential();
+
+    const String& name() const { return m_name; }
+    const URL& iconURL() const { return m_iconURL; }
+
+    void setOrigin(const URL& origin) { m_origin = SecurityOrigin::create(origin); }
+    const SecurityOrigin& origin() const { return m_origin.get(); }
+
+protected:
+    SiteBoundCredential(const SiteBoundCredentialData&, Type);
+
+private:
+    String m_name;
+    URL m_iconURL;
+    Ref<SecurityOrigin> m_origin;
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/credentials/SiteBoundCredential.idl b/Source/WebCore/Modules/credentials/SiteBoundCredential.idl
new file mode 100644 (file)
index 0000000..7851185
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+interface SiteBoundCredential : BasicCredential {
+    readonly attribute USVString name;
+    readonly attribute USVString iconURL;
+};
diff --git a/Source/WebCore/Modules/credentials/SiteBoundCredentialData.h b/Source/WebCore/Modules/credentials/SiteBoundCredentialData.h
new file mode 100644 (file)
index 0000000..b3b16eb
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "CredentialData.h"
+
+namespace WebCore {
+
+struct SiteBoundCredentialData : public CredentialData {
+    String name;
+    String iconURL;
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/credentials/SiteBoundCredentialData.idl b/Source/WebCore/Modules/credentials/SiteBoundCredentialData.idl
new file mode 100644 (file)
index 0000000..823b2d2
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+dictionary SiteBoundCredentialData : CredentialData {
+    USVString name;
+    USVString iconURL;
+};
index de01711..e72ee8c 100644 (file)
                5778BD821DA4806C009E3009 /* SubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 5778BD811DA4802C009E3009 /* SubtleCrypto.h */; };
                5778BD841DA4817B009E3009 /* SubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5778BD831DA4817B009E3009 /* SubtleCrypto.cpp */; };
                57A9C88E1DA70BF800BC7305 /* JSSubtleCryptoCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57A9C88D1DA70BF800BC7305 /* JSSubtleCryptoCustom.cpp */; };
+               57B5F7D41E57CF6800F34F90 /* SiteBoundCredential.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57B5F7D21E57CF6800F34F90 /* SiteBoundCredential.cpp */; };
+               57B5F7D51E57CF6800F34F90 /* SiteBoundCredential.h in Headers */ = {isa = PBXBuildFile; fileRef = 57B5F7D31E57CF6800F34F90 /* SiteBoundCredential.h */; };
+               57B5F7D81E57D3C900F34F90 /* CredentialData.h in Headers */ = {isa = PBXBuildFile; fileRef = 57B5F7D71E57D3C900F34F90 /* CredentialData.h */; };
+               57B5F7DB1E57D4CC00F34F90 /* SiteBoundCredentialData.h in Headers */ = {isa = PBXBuildFile; fileRef = 57B5F7DA1E57D4CC00F34F90 /* SiteBoundCredentialData.h */; };
+               57B5F7E01E57DBC800F34F90 /* JSSiteBoundCredential.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57B5F7DC1E57DBC800F34F90 /* JSSiteBoundCredential.cpp */; };
+               57B5F7E11E57DBC800F34F90 /* JSSiteBoundCredential.h in Headers */ = {isa = PBXBuildFile; fileRef = 57B5F7DD1E57DBC800F34F90 /* JSSiteBoundCredential.h */; };
+               57B5F7E21E57DBC800F34F90 /* JSSiteBoundCredentialData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57B5F7DE1E57DBC800F34F90 /* JSSiteBoundCredentialData.cpp */; };
+               57B5F7E31E57DBC800F34F90 /* JSSiteBoundCredentialData.h in Headers */ = {isa = PBXBuildFile; fileRef = 57B5F7DF1E57DBC800F34F90 /* JSSiteBoundCredentialData.h */; };
+               57B5F7E61E57DBE000F34F90 /* JSCredentialData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57B5F7E41E57DBE000F34F90 /* JSCredentialData.cpp */; };
+               57B5F7E71E57DBE000F34F90 /* JSCredentialData.h in Headers */ = {isa = PBXBuildFile; fileRef = 57B5F7E51E57DBE000F34F90 /* JSCredentialData.h */; };
+               57B5F7EC1E57F1E300F34F90 /* PasswordCredential.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57B5F7EA1E57F1E300F34F90 /* PasswordCredential.cpp */; };
+               57B5F7ED1E57F1E300F34F90 /* PasswordCredential.h in Headers */ = {isa = PBXBuildFile; fileRef = 57B5F7EB1E57F1E300F34F90 /* PasswordCredential.h */; };
+               57B5F7F01E5B8C5A00F34F90 /* JSPasswordCredential.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57B5F7EE1E5B8C5A00F34F90 /* JSPasswordCredential.cpp */; };
+               57B5F7F11E5B8C5A00F34F90 /* JSPasswordCredential.h in Headers */ = {isa = PBXBuildFile; fileRef = 57B5F7EF1E5B8C5A00F34F90 /* JSPasswordCredential.h */; };
+               57C7A68C1E56967500C67D71 /* BasicCredential.h in Headers */ = {isa = PBXBuildFile; fileRef = 57C7A68B1E56967500C67D71 /* BasicCredential.h */; };
+               57C7A6941E578ACA00C67D71 /* BasicCredential.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57C7A6931E578ACA00C67D71 /* BasicCredential.cpp */; };
+               57C7A69F1E57917800C67D71 /* JSBasicCredential.h in Headers */ = {isa = PBXBuildFile; fileRef = 57C7A69D1E57910D00C67D71 /* JSBasicCredential.h */; };
+               57C7A6A01E57919B00C67D71 /* JSBasicCredential.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57C7A69C1E57910D00C67D71 /* JSBasicCredential.cpp */; };
                57D0018D1DD5413200ED19D9 /* JSCryptoKeyUsage.h in Headers */ = {isa = PBXBuildFile; fileRef = 57D0018C1DD5413200ED19D9 /* JSCryptoKeyUsage.h */; };
                57D0018F1DD5415300ED19D9 /* JSCryptoKeyUsage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57D0018E1DD5415300ED19D9 /* JSCryptoKeyUsage.cpp */; };
                57E2335B1DC7D5E500F28D01 /* JSJsonWebKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 57E2335A1DC7D5E500F28D01 /* JSJsonWebKey.h */; };
                5778BD811DA4802C009E3009 /* SubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubtleCrypto.h; sourceTree = "<group>"; };
                5778BD831DA4817B009E3009 /* SubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubtleCrypto.cpp; sourceTree = "<group>"; };
                57A9C88D1DA70BF800BC7305 /* JSSubtleCryptoCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSubtleCryptoCustom.cpp; sourceTree = "<group>"; };
+               57B5F7D11E57CF0E00F34F90 /* SiteBoundCredential.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SiteBoundCredential.idl; sourceTree = "<group>"; };
+               57B5F7D21E57CF6800F34F90 /* SiteBoundCredential.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SiteBoundCredential.cpp; sourceTree = "<group>"; };
+               57B5F7D31E57CF6800F34F90 /* SiteBoundCredential.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SiteBoundCredential.h; sourceTree = "<group>"; };
+               57B5F7D61E57D36A00F34F90 /* CredentialData.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CredentialData.idl; sourceTree = "<group>"; };
+               57B5F7D71E57D3C900F34F90 /* CredentialData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CredentialData.h; sourceTree = "<group>"; };
+               57B5F7D91E57D44E00F34F90 /* SiteBoundCredentialData.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SiteBoundCredentialData.idl; sourceTree = "<group>"; };
+               57B5F7DA1E57D4CC00F34F90 /* SiteBoundCredentialData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SiteBoundCredentialData.h; sourceTree = "<group>"; };
+               57B5F7DC1E57DBC800F34F90 /* JSSiteBoundCredential.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSiteBoundCredential.cpp; sourceTree = "<group>"; };
+               57B5F7DD1E57DBC800F34F90 /* JSSiteBoundCredential.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSiteBoundCredential.h; sourceTree = "<group>"; };
+               57B5F7DE1E57DBC800F34F90 /* JSSiteBoundCredentialData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSiteBoundCredentialData.cpp; sourceTree = "<group>"; };
+               57B5F7DF1E57DBC800F34F90 /* JSSiteBoundCredentialData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSiteBoundCredentialData.h; sourceTree = "<group>"; };
+               57B5F7E41E57DBE000F34F90 /* JSCredentialData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCredentialData.cpp; sourceTree = "<group>"; };
+               57B5F7E51E57DBE000F34F90 /* JSCredentialData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCredentialData.h; sourceTree = "<group>"; };
+               57B5F7E91E57E00000F34F90 /* PasswordCredential.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = PasswordCredential.idl; sourceTree = "<group>"; };
+               57B5F7EA1E57F1E300F34F90 /* PasswordCredential.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PasswordCredential.cpp; sourceTree = "<group>"; };
+               57B5F7EB1E57F1E300F34F90 /* PasswordCredential.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PasswordCredential.h; sourceTree = "<group>"; };
+               57B5F7EE1E5B8C5A00F34F90 /* JSPasswordCredential.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPasswordCredential.cpp; sourceTree = "<group>"; };
+               57B5F7EF1E5B8C5A00F34F90 /* JSPasswordCredential.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPasswordCredential.h; sourceTree = "<group>"; };
+               57C7A6891E56946D00C67D71 /* BasicCredential.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BasicCredential.idl; sourceTree = "<group>"; };
+               57C7A68B1E56967500C67D71 /* BasicCredential.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BasicCredential.h; sourceTree = "<group>"; };
+               57C7A6931E578ACA00C67D71 /* BasicCredential.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BasicCredential.cpp; sourceTree = "<group>"; };
+               57C7A69C1E57910D00C67D71 /* JSBasicCredential.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBasicCredential.cpp; sourceTree = "<group>"; };
+               57C7A69D1E57910D00C67D71 /* JSBasicCredential.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBasicCredential.h; sourceTree = "<group>"; };
                57D0018B1DD3DBA400ED19D9 /* CryptoKeyUsage.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CryptoKeyUsage.idl; sourceTree = "<group>"; };
                57D0018C1DD5413200ED19D9 /* JSCryptoKeyUsage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCryptoKeyUsage.h; sourceTree = "<group>"; };
                57D0018E1DD5415300ED19D9 /* JSCryptoKeyUsage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCryptoKeyUsage.cpp; sourceTree = "<group>"; };
                                1221E0581C02B409006A1A00 /* Animation */,
                                1AE96A791D1A0A5C00B86768 /* ApplePay */,
                                A83B79100CCB001B000B0825 /* Core */,
+                               57C7A68D1E569A8400C67D71 /* Credentials */,
                                E1FF8F61180745C600132674 /* Crypto */,
                                A83B790E0CCAFF97000B0825 /* CSS */,
                                5CE5D9A61DB899A800CE7A8D /* Encoding */,
                        path = mac;
                        sourceTree = "<group>";
                };
+               57C7A6881E56946D00C67D71 /* credentials */ = {
+                       isa = PBXGroup;
+                       children = (
+                               57C7A6931E578ACA00C67D71 /* BasicCredential.cpp */,
+                               57C7A68B1E56967500C67D71 /* BasicCredential.h */,
+                               57C7A6891E56946D00C67D71 /* BasicCredential.idl */,
+                               57B5F7D71E57D3C900F34F90 /* CredentialData.h */,
+                               57B5F7D61E57D36A00F34F90 /* CredentialData.idl */,
+                               57B5F7EA1E57F1E300F34F90 /* PasswordCredential.cpp */,
+                               57B5F7EB1E57F1E300F34F90 /* PasswordCredential.h */,
+                               57B5F7E91E57E00000F34F90 /* PasswordCredential.idl */,
+                               57B5F7D21E57CF6800F34F90 /* SiteBoundCredential.cpp */,
+                               57B5F7D31E57CF6800F34F90 /* SiteBoundCredential.h */,
+                               57B5F7D11E57CF0E00F34F90 /* SiteBoundCredential.idl */,
+                               57B5F7DA1E57D4CC00F34F90 /* SiteBoundCredentialData.h */,
+                               57B5F7D91E57D44E00F34F90 /* SiteBoundCredentialData.idl */,
+                       );
+                       path = credentials;
+                       sourceTree = "<group>";
+               };
+               57C7A68D1E569A8400C67D71 /* Credentials */ = {
+                       isa = PBXGroup;
+                       children = (
+                               57C7A69C1E57910D00C67D71 /* JSBasicCredential.cpp */,
+                               57C7A69D1E57910D00C67D71 /* JSBasicCredential.h */,
+                               57B5F7E41E57DBE000F34F90 /* JSCredentialData.cpp */,
+                               57B5F7E51E57DBE000F34F90 /* JSCredentialData.h */,
+                               57B5F7EE1E5B8C5A00F34F90 /* JSPasswordCredential.cpp */,
+                               57B5F7EF1E5B8C5A00F34F90 /* JSPasswordCredential.h */,
+                               57B5F7DC1E57DBC800F34F90 /* JSSiteBoundCredential.cpp */,
+                               57B5F7DD1E57DBC800F34F90 /* JSSiteBoundCredential.h */,
+                               57B5F7DE1E57DBC800F34F90 /* JSSiteBoundCredentialData.cpp */,
+                               57B5F7DF1E57DBC800F34F90 /* JSSiteBoundCredentialData.h */,
+                       );
+                       name = Credentials;
+                       sourceTree = "<group>";
+               };
                59B5977111086556007159E8 /* jsc */ = {
                        isa = PBXGroup;
                        children = (
                        children = (
                                CE26169D187E6554007955F3 /* airplay */,
                                1A58E8611D19D37300C0EA73 /* applepay */,
+                               57C7A6881E56946D00C67D71 /* credentials */,
                                CDA98DBD16014E0800FEA3B1 /* encryptedmedia */,
                                41F54F7C1C50C4F600338488 /* fetch */,
                                518F4FE9194CA4B60081BAAE /* gamepad */,
                                49E912AB0EFAC906009D0CAF /* Animation.h in Headers */,
                                316FE1120E6E1DA700BF6088 /* AnimationBase.h in Headers */,
                                319848011A1D817B00A13318 /* AnimationEvent.h in Headers */,
+                               57B5F7D81E57D3C900F34F90 /* CredentialData.h in Headers */,
                                49E912AD0EFAC906009D0CAF /* AnimationList.h in Headers */,
                                31DCD29D1AB4FBDE0072E817 /* AnimationTrigger.h in Headers */,
                                0F580FAF149800D400FB5BD8 /* AnimationUtilities.h in Headers */,
                                93309DD7099E64920056E581 /* AppendNodeCommand.h in Headers */,
                                7C6579E31E00827000E3A27A /* ApplePayLineItem.h in Headers */,
+                               57C7A68C1E56967500C67D71 /* BasicCredential.h in Headers */,
                                7C6523011E00D03400677F22 /* ApplePayPayment.h in Headers */,
                                1A8A64521D19FCFB00D0E00F /* ApplePayPaymentAuthorizedEvent.h in Headers */,
                                7C6522FB1E00C90900677F22 /* ApplePayPaymentContact.h in Headers */,
                                E1BD331C182D8EE900C05D9F /* CryptoAlgorithmRsaSsaParamsDeprecated.h in Headers */,
                                E125F82C1822CFEC00D84CD9 /* CryptoAlgorithmSHA1.h in Headers */,
                                E19AC3EF1824DC7900349426 /* CryptoAlgorithmSHA224.h in Headers */,
+                               57B5F7F11E5B8C5A00F34F90 /* JSPasswordCredential.h in Headers */,
                                E19AC3F11824DC7900349426 /* CryptoAlgorithmSHA256.h in Headers */,
                                E19AC3F31824DC7900349426 /* CryptoAlgorithmSHA384.h in Headers */,
                                E19AC3F51824DC7900349426 /* CryptoAlgorithmSHA512.h in Headers */,
                                A7CA59630B27C1F200FA021D /* DragClient.h in Headers */,
                                A7CA595D0B27BD9E00FA021D /* DragController.h in Headers */,
                                A7B6E69F0B291A9600D0529F /* DragData.h in Headers */,
+                               57B5F7D51E57CF6800F34F90 /* SiteBoundCredential.h in Headers */,
                                A7CFB3D20B7ED10A0070C32D /* DragImage.h in Headers */,
                                81F65FF613788FAA00FF6F2D /* DragState.h in Headers */,
                                E1BA66F11742BD8600C20251 /* DynamicLinkerInterposing.h in Headers */,
                                AA4C3A770B2B1679002334A2 /* InlineStyleSheetOwner.h in Headers */,
                                BCEA485A097D93020094C9E4 /* InlineTextBox.h in Headers */,
                                1C010701192594DF008A4201 /* InlineTextBoxStyle.h in Headers */,
+                               57B5F7E31E57DBC800F34F90 /* JSSiteBoundCredentialData.h in Headers */,
                                510A58E51BAA40B100C19282 /* InProcessIDBServer.h in Headers */,
                                2EB767571DA19BDF003E23B5 /* InputEvent.h in Headers */,
                                37E3524D12450C6600BAF5D9 /* InputType.h in Headers */,
                                65DF31F809D1CC60000BE325 /* JSDOMImplementation.h in Headers */,
                                4138F8581D253F0E001CB61E /* JSDOMIterator.h in Headers */,
                                A9D248070D757E7D00FDF959 /* JSDOMMimeType.h in Headers */,
+                               57B5F7E11E57DBC800F34F90 /* JSSiteBoundCredential.h in Headers */,
                                A9D248090D757E7D00FDF959 /* JSDOMMimeTypeArray.h in Headers */,
                                52CCA9E315E3F62C0053C77F /* JSDOMNamedFlowCollection.h in Headers */,
                                1ACE53E00A8D18810022947D /* JSDOMParser.h in Headers */,
                                A80E7B0D0A19D606007FB8C5 /* JSHTMLLinkElement.h in Headers */,
                                1AE2AB280A1CE63B00B42B25 /* JSHTMLMapElement.h in Headers */,
                                BC491B790C023EFD009D6316 /* JSHTMLMarqueeElement.h in Headers */,
+                               57C7A69F1E57917800C67D71 /* JSBasicCredential.h in Headers */,
                                E446143A0CD689C800FADA75 /* JSHTMLMediaElement.h in Headers */,
                                1AE2AE5C0A1D26F200B42B25 /* JSHTMLMenuElement.h in Headers */,
                                A80E7A180A19C3D6007FB8C5 /* JSHTMLMetaElement.h in Headers */,
                                979F43D41075E44A0000F83B /* NavigationScheduler.h in Headers */,
                                A9C6E5A60D746458006442E9 /* Navigator.h in Headers */,
                                E12719C70EEEC16800F61213 /* NavigatorBase.h in Headers */,
+                               57B5F7ED1E57F1E300F34F90 /* PasswordCredential.h in Headers */,
                                9711460414EF009A00674FD9 /* NavigatorGeolocation.h in Headers */,
                                5EA725D61ACABD5700EAD17B /* NavigatorMediaDevices.h in Headers */,
                                996E59DF1DF0128D006612B9 /* NavigatorWebDriver.h in Headers */,
                                836DAA061CEAB80D00A2B707 /* RenderDescendantIterator.h in Headers */,
                                D302754A12A5FE84004BD828 /* RenderDetailsMarker.h in Headers */,
                                A76E5F7F135E0DCF00A69837 /* RenderedDocumentMarker.h in Headers */,
+                               57B5F7E71E57DBE000F34F90 /* JSCredentialData.h in Headers */,
                                9B32CDA913DF7FA900F34D13 /* RenderedPosition.h in Headers */,
                                E43A023B17EB370A004CDD25 /* RenderElement.h in Headers */,
                                0F5B7A5510F65D7A00376302 /* RenderEmbeddedObject.h in Headers */,
                                078E094317D16E1C00420AA1 /* RTCSessionDescriptionDescriptor.h in Headers */,
                                078E094417D16E1C00420AA1 /* RTCSessionDescriptionRequest.h in Headers */,
                                078E092A17D14D1C00420AA1 /* RTCStatsReport.h in Headers */,
+                               57B5F7DB1E57D4CC00F34F90 /* SiteBoundCredentialData.h in Headers */,
                                5E2C43681BCEE3770001E2BC /* RTCTrackEvent.h in Headers */,
                                078E094717D16E1C00420AA1 /* RTCVoidRequest.h in Headers */,
                                5824ABA31AE81116009074B7 /* RubyElement.h in Headers */,
                        buildActionMask = 2147483647;
                        files = (
                                570440531E5278B200356601 /* CryptoAlgorithmAES_CFB.cpp in Sources */,
+                               57C7A6A01E57919B00C67D71 /* JSBasicCredential.cpp in Sources */,
                                41E1B1D00FF5986900576B3B /* AbstractWorker.cpp in Sources */,
                                37F57AB91A50726900876F98 /* AccessibilityARIAGrid.cpp in Sources */,
                                37F57ABA1A50726F00876F98 /* AccessibilityARIAGridCell.cpp in Sources */,
                                A8C4A80E09D563270003AC8D /* Attr.cpp in Sources */,
                                E4A814D81C70E10500BF85AC /* AttributeChangeInvalidation.cpp in Sources */,
                                FD629EA4154B47160006D026 /* AudioBasicInspectorNode.cpp in Sources */,
+                               57B5F7E61E57DBE000F34F90 /* JSCredentialData.cpp in Sources */,
                                FD315FF612B0267600C1A359 /* AudioBasicProcessorNode.cpp in Sources */,
                                FD315FF812B0267600C1A359 /* AudioBuffer.cpp in Sources */,
                                FD315FFB12B0267600C1A359 /* AudioBufferSourceNode.cpp in Sources */,
                                120DE3FE1C87E18800B6D4DD /* JSAnimationEffect.cpp in Sources */,
                                3198480B1A1E6CE400A13318 /* JSAnimationEvent.cpp in Sources */,
                                1221E06C1C03D224006A1A00 /* JSAnimationTimeline.cpp in Sources */,
+                               57B5F7E21E57DBC800F34F90 /* JSSiteBoundCredentialData.cpp in Sources */,
                                1221E0731C03E4C2006A1A00 /* JSAnimationTimelineCustom.cpp in Sources */,
                                7C6579EF1E00856600E3A27A /* JSApplePayLineItem.cpp in Sources */,
                                7C65231E1E018B5A00677F22 /* JSApplePayPayment.cpp in Sources */,
                                7C77C3D41DEF178E00A50BFA /* JSBlobPropertyBag.cpp in Sources */,
                                14DCF3B21B6BE2080062D4C3 /* JSByteLengthQueuingStrategy.cpp in Sources */,
                                1449E287107D4DB400B5793F /* JSCallbackData.cpp in Sources */,
+                               57B5F7D41E57CF6800F34F90 /* SiteBoundCredential.cpp in Sources */,
                                65DF323909D1DE65000BE325 /* JSCanvasGradient.cpp in Sources */,
                                65DF323B09D1DE65000BE325 /* JSCanvasPattern.cpp in Sources */,
                                49EED1441051969400099FAB /* JSCanvasRenderingContext2D.cpp in Sources */,
                                D6E276AF14637455001D280A /* MutationObserverRegistration.cpp in Sources */,
                                C6F08FBC1430FE8F00685849 /* MutationRecord.cpp in Sources */,
                                52B6C9C515E3F4DF00690B05 /* NamedFlowCollection.cpp in Sources */,
+                               57B5F7EC1E57F1E300F34F90 /* PasswordCredential.cpp in Sources */,
                                314BE3A61B3103FB00141982 /* NamedImageGeneratedImage.cpp in Sources */,
                                BCF34A3711A231CD00C71804 /* NamedNodeMap.cpp in Sources */,
                                A81872240977D3C0005826D9 /* NameNodeList.cpp in Sources */,
                                5824ABA21AE81116009074B7 /* RubyElement.cpp in Sources */,
                                5824ABA61AE81384009074B7 /* RubyTextElement.cpp in Sources */,
                                A79BADA1161E7F3F00C2E652 /* RuleFeature.cpp in Sources */,
+                               57B5F7E01E57DBC800F34F90 /* JSSiteBoundCredential.cpp in Sources */,
                                A79BADA3161E7F3F00C2E652 /* RuleSet.cpp in Sources */,
                                2D76BB8419456F8100CFD29A /* RunLoopObserver.cpp in Sources */,
                                1A569D1E0D7E2B82007C3983 /* runtime_array.cpp in Sources */,
                                5C688AA31D3814BF000B54FA /* SocketProvider.cpp in Sources */,
                                510D4A36103165EE0049EA54 /* SocketStreamHandle.cpp in Sources */,
                                51ABAE1F103C1913008C5260 /* SocketStreamHandleImplCFNet.cpp in Sources */,
+                               57C7A6941E578ACA00C67D71 /* BasicCredential.cpp in Sources */,
                                E45390470EAFD637003695C8 /* SoundIOS.mm in Sources */,
                                4B3043C90AE0371D00A82647 /* SoundMac.mm in Sources */,
                                84A81F3D0FC7DFF000955300 /* SourceAlpha.cpp in Sources */,
                                E17B491516A9B094001C8839 /* TransitionEvent.cpp in Sources */,
                                49E911D10EF86D47009D0CAF /* TranslateTransformOperation.cpp in Sources */,
                                854FE7360A2297BE0058D7AD /* Traversal.cpp in Sources */,
+                               57B5F7F01E5B8C5A00F34F90 /* JSPasswordCredential.cpp in Sources */,
                                14D64B5C134A5B6B00E58FDA /* TreeScope.cpp in Sources */,
                                A77E1FEF14AACB6E005B7CB6 /* TreeScopeAdopter.cpp in Sources */,
                                854FE7380A2297BE0058D7AD /* TreeWalker.cpp in Sources */,