Title: [267988] trunk
Revision
267988
Author
akeer...@apple.com
Date
2020-10-05 11:56:12 -0700 (Mon, 05 Oct 2020)

Log Message

[Contact Picker API] Introduce bindings for the Contact Picker API
https://bugs.webkit.org/show_bug.cgi?id=216793
<rdar://problem/69317957>

Reviewed by Wenson Hsieh.

Source/WebCore:

Added IDL for the Contact Picker API, with the exception of the address
and icon contact properties (which will be added after an initial
implemention is complete). See: https://wicg.github.io/contact-api/spec/
for more information.

Test: contact-picker/contacts-interfaces.html

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/contact-picker/ContactInfo.h: Added.
* Modules/contact-picker/ContactInfo.idl: Added.
* Modules/contact-picker/ContactProperty.h: Added.
* Modules/contact-picker/ContactProperty.idl: Added.
* Modules/contact-picker/ContactsManager.cpp: Added.
(WebCore::ContactsManager::create):
(WebCore::ContactsManager::ContactsManager):
(WebCore::ContactsManager::navigator):
(WebCore::ContactsManager::getProperties):
(WebCore::ContactsManager::select):

Stub out these API calls for now by immediately rejecting the given promise.

* Modules/contact-picker/ContactsManager.h: Added.
* Modules/contact-picker/ContactsManager.idl: Added.
* Modules/contact-picker/ContactsSelectOptions.h: Added.
* Modules/contact-picker/ContactsSelectOptions.idl: Added.
* Modules/contact-picker/NavigatorContacts.cpp: Added.
(WebCore::NavigatorContacts::NavigatorContacts):
(WebCore::NavigatorContacts::contacts):
(WebCore::NavigatorContacts::from):
(WebCore::NavigatorContacts::supplementName):
* Modules/contact-picker/NavigatorContacts.h: Added.
* Modules/contact-picker/Navigator+Contacts.idl: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* page/Settings.yaml:

Source/WebKit:

Added a new experimental feature flag. See WebCore Changelog for more details.

* Shared/WebPreferencesExperimental.yaml:

Source/WebKitLegacy/mac:

Added plumbing to support the associated experimental test option.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences contactPickerAPIEnabled]):
(-[WebPreferences setContactPickerAPIEnabled:]):
* WebView/WebPreferencesPrivate.h:

Source/WebKitLegacy/win:

Added plumbing to support the associated experimental test option.

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings):
(WebPreferences::contactPickerAPIEnabled):
(WebPreferences::setContactPickerAPIEnabled):
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml:

Add experimental preference for the Contact Picker API.

Tools:

Added plumbing to support the associated experimental test option.

* DumpRenderTree/TestOptions.cpp:
(TestOptions::TestOptions):
* DumpRenderTree/TestOptions.h:
* DumpRenderTree/mac/DumpRenderTree.mm:
(setWebPreferencesForTestOptions):
* DumpRenderTree/win/DumpRenderTree.cpp:
(setWebPreferencesForTestOptions):

LayoutTests:

* contact-picker/contacts-interfaces-expected.txt: Added.
* contact-picker/contacts-interfaces.html: Added.

Added a new test to verify the new API interfaces.

* fast/dom/navigator-detached-no-crash-expected.txt:
* platform/gtk/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/mac/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/win/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/wincairo/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/wpe/fast/dom/navigator-detached-no-crash-expected.txt:

Updated an existing test to include "navigator.contacts".

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (267987 => 267988)


--- trunk/LayoutTests/ChangeLog	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/LayoutTests/ChangeLog	2020-10-05 18:56:12 UTC (rev 267988)
@@ -1,3 +1,26 @@
+2020-10-05  Aditya Keerthi  <akeer...@apple.com>
+
+        [Contact Picker API] Introduce bindings for the Contact Picker API
+        https://bugs.webkit.org/show_bug.cgi?id=216793
+        <rdar://problem/69317957>
+
+        Reviewed by Wenson Hsieh.
+
+        * contact-picker/contacts-interfaces-expected.txt: Added.
+        * contact-picker/contacts-interfaces.html: Added.
+
+        Added a new test to verify the new API interfaces.
+
+        * fast/dom/navigator-detached-no-crash-expected.txt:
+        * platform/gtk/fast/dom/navigator-detached-no-crash-expected.txt:
+        * platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt:
+        * platform/mac/fast/dom/navigator-detached-no-crash-expected.txt:
+        * platform/win/fast/dom/navigator-detached-no-crash-expected.txt:
+        * platform/wincairo/fast/dom/navigator-detached-no-crash-expected.txt:
+        * platform/wpe/fast/dom/navigator-detached-no-crash-expected.txt:
+
+        Updated an existing test to include "navigator.contacts".
+
 2020-10-05  Youenn Fablet  <you...@apple.com>
 
         MediaRecorder should respect enabled and muted tracks

Added: trunk/LayoutTests/contact-picker/contacts-interfaces-expected.txt (0 => 267988)


--- trunk/LayoutTests/contact-picker/contacts-interfaces-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/contact-picker/contacts-interfaces-expected.txt	2020-10-05 18:56:12 UTC (rev 267988)
@@ -0,0 +1,21 @@
+Tests the interfaces of the Contact Picker API, which include ContactsManager and extensions to Navigator.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS ContactsManager instanceof Function is true
+PASS typeof ContactsManager is "function"
+PASS navigator.contacts instanceof ContactsManager is true
+PASS Object.getPrototypeOf(navigator.contacts) === ContactsManager.prototype is true
+PASS ContactsManager.prototype.getProperties instanceof Function is true
+PASS ContactsManager.prototype.select instanceof Function is true
+PASS ContactsManager() threw exception TypeError: Illegal constructor.
+PASS new ContactsManager() threw exception TypeError: Illegal constructor.
+PASS ContactsManager.toString() is "function ContactsManager() {\n    [native code]\n}"
+PASS navigator.contacts.toString() is "[object ContactsManager]"
+PASS navigator.contacts.getProperties() instanceof Promise is true
+PASS navigator.contacts.select(['name', 'email'], {multiple: true}) instanceof Promise is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/contact-picker/contacts-interfaces.html (0 => 267988)


--- trunk/LayoutTests/contact-picker/contacts-interfaces.html	                        (rev 0)
+++ trunk/LayoutTests/contact-picker/contacts-interfaces.html	2020-10-05 18:56:12 UTC (rev 267988)
@@ -0,0 +1,26 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ experimental:ContactPickerAPIEnabled=true ] -->
+<html>
+    <head>
+        <script src=""
+    </head>
+    <script>
+        function runTest()
+        {
+            description("Tests the interfaces of the Contact Picker API, which include ContactsManager and extensions to Navigator.");
+
+            shouldBeTrue("ContactsManager instanceof Function");
+            shouldBeEqualToString("typeof ContactsManager", "function");
+            shouldBeTrue("navigator.contacts instanceof ContactsManager");
+            shouldBeTrue("Object.getPrototypeOf(navigator.contacts) === ContactsManager.prototype");
+            shouldBeTrue("ContactsManager.prototype.getProperties instanceof Function");
+            shouldBeTrue("ContactsManager.prototype.select instanceof Function");
+            shouldThrow("ContactsManager()");
+            shouldThrow("new ContactsManager()");
+            shouldBeEqualToString("ContactsManager.toString()", "function ContactsManager() {\n    [native code]\n}");
+            shouldBeEqualToString("navigator.contacts.toString()", "[object ContactsManager]");
+            shouldBeTrue("navigator.contacts.getProperties() instanceof Promise");
+            shouldBeTrue("navigator.contacts.select(['name', 'email'], {multiple: true}) instanceof Promise");
+        }
+    </script>
+    <body _onload_=runTest()></body>
+</html>

Modified: trunk/LayoutTests/fast/dom/navigator-detached-no-crash-expected.txt (267987 => 267988)


--- trunk/LayoutTests/fast/dom/navigator-detached-no-crash-expected.txt	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/LayoutTests/fast/dom/navigator-detached-no-crash-expected.txt	2020-10-05 18:56:12 UTC (rev 267988)
@@ -6,6 +6,7 @@
 navigator.appName is OK
 navigator.appVersion is OK
 navigator.clipboard is OK
+navigator.contacts is OK
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK
@@ -33,6 +34,7 @@
 navigator.appName is OK
 navigator.appVersion is OK
 navigator.clipboard is OK
+navigator.contacts is OK
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK

Modified: trunk/LayoutTests/platform/gtk/fast/dom/navigator-detached-no-crash-expected.txt (267987 => 267988)


--- trunk/LayoutTests/platform/gtk/fast/dom/navigator-detached-no-crash-expected.txt	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/LayoutTests/platform/gtk/fast/dom/navigator-detached-no-crash-expected.txt	2020-10-05 18:56:12 UTC (rev 267988)
@@ -4,6 +4,7 @@
 navigator.appName is OK
 navigator.appVersion is OK
 navigator.clipboard is OK
+navigator.contacts is OK
 navigator.cookieEnabled is OK
 navigator.getStorageUpdates() is OK
 navigator.javaEnabled() is OK
@@ -28,6 +29,7 @@
 navigator.appName is OK
 navigator.appVersion is OK
 navigator.clipboard is OK
+navigator.contacts is OK
 navigator.cookieEnabled is OK
 navigator.getStorageUpdates() is OK
 navigator.javaEnabled() is OK

Modified: trunk/LayoutTests/platform/mac/fast/dom/navigator-detached-no-crash-expected.txt (267987 => 267988)


--- trunk/LayoutTests/platform/mac/fast/dom/navigator-detached-no-crash-expected.txt	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/LayoutTests/platform/mac/fast/dom/navigator-detached-no-crash-expected.txt	2020-10-05 18:56:12 UTC (rev 267988)
@@ -5,6 +5,7 @@
 navigator.appName is OK
 navigator.appVersion is OK
 navigator.clipboard is OK
+navigator.contacts is OK
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK
@@ -29,6 +30,7 @@
 navigator.appName is OK
 navigator.appVersion is OK
 navigator.clipboard is OK
+navigator.contacts is OK
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK

Modified: trunk/LayoutTests/platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt (267987 => 267988)


--- trunk/LayoutTests/platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/LayoutTests/platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt	2020-10-05 18:56:12 UTC (rev 267988)
@@ -5,6 +5,7 @@
 navigator.appVersion is OK
 navigator.canShare() is OK
 navigator.clipboard is OK
+navigator.contacts is OK
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK
@@ -36,6 +37,7 @@
 navigator.appVersion is OK
 navigator.canShare() is OK
 navigator.clipboard is OK
+navigator.contacts is OK
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK

Modified: trunk/LayoutTests/platform/win/fast/dom/navigator-detached-no-crash-expected.txt (267987 => 267988)


--- trunk/LayoutTests/platform/win/fast/dom/navigator-detached-no-crash-expected.txt	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/LayoutTests/platform/win/fast/dom/navigator-detached-no-crash-expected.txt	2020-10-05 18:56:12 UTC (rev 267988)
@@ -5,6 +5,7 @@
 navigator.appName is OK
 navigator.appVersion is OK
 navigator.clipboard is OK
+navigator.contacts is OK
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK
@@ -26,6 +27,7 @@
 navigator.appName is OK
 navigator.appVersion is OK
 navigator.clipboard is OK
+navigator.contacts is OK
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK

Modified: trunk/LayoutTests/platform/wincairo/fast/dom/navigator-detached-no-crash-expected.txt (267987 => 267988)


--- trunk/LayoutTests/platform/wincairo/fast/dom/navigator-detached-no-crash-expected.txt	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/LayoutTests/platform/wincairo/fast/dom/navigator-detached-no-crash-expected.txt	2020-10-05 18:56:12 UTC (rev 267988)
@@ -4,6 +4,7 @@
 navigator.appName is OK
 navigator.appVersion is OK
 navigator.clipboard is OK
+navigator.contacts is OK
 navigator.cookieEnabled is OK
 navigator.getStorageUpdates() is OK
 navigator.javaEnabled() is OK
@@ -23,6 +24,7 @@
 navigator.appName is OK
 navigator.appVersion is OK
 navigator.clipboard is OK
+navigator.contacts is OK
 navigator.cookieEnabled is OK
 navigator.getStorageUpdates() is OK
 navigator.javaEnabled() is OK

Modified: trunk/LayoutTests/platform/wpe/fast/dom/navigator-detached-no-crash-expected.txt (267987 => 267988)


--- trunk/LayoutTests/platform/wpe/fast/dom/navigator-detached-no-crash-expected.txt	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/LayoutTests/platform/wpe/fast/dom/navigator-detached-no-crash-expected.txt	2020-10-05 18:56:12 UTC (rev 267988)
@@ -4,6 +4,7 @@
 navigator.appName is OK
 navigator.appVersion is OK
 navigator.clipboard is OK
+navigator.contacts is OK
 navigator.cookieEnabled is OK
 navigator.getStorageUpdates() is OK
 navigator.javaEnabled() is OK
@@ -29,6 +30,7 @@
 navigator.appName is OK
 navigator.appVersion is OK
 navigator.clipboard is OK
+navigator.contacts is OK
 navigator.cookieEnabled is OK
 navigator.getStorageUpdates() is OK
 navigator.javaEnabled() is OK

Modified: trunk/Source/WTF/ChangeLog (267987 => 267988)


--- trunk/Source/WTF/ChangeLog	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WTF/ChangeLog	2020-10-05 18:56:12 UTC (rev 267988)
@@ -1,3 +1,15 @@
+2020-10-05  Aditya Keerthi  <akeer...@apple.com>
+
+        [Contact Picker API] Introduce bindings for the Contact Picker API
+        https://bugs.webkit.org/show_bug.cgi?id=216793
+        <rdar://problem/69317957>
+
+        Reviewed by Wenson Hsieh.
+
+        * Scripts/Preferences/WebPreferencesExperimental.yaml:
+
+        Add experimental preference for the Contact Picker API.
+
 2020-10-05  Sam Weinig  <wei...@apple.com>
 
         Remove support for enabling subpixel CSSOM values, it's off by default everywhere and known to be not-compatible with the web

Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml (267987 => 267988)


--- trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml	2020-10-05 18:56:12 UTC (rev 267988)
@@ -160,6 +160,16 @@
       "ENABLE(EXPERIMENTAL_FEATURES) && (PLATFORM(GTK) || PLATFORM(WPE))": true
       default: false
 
+ContactPickerAPIEnabled:
+  type: bool
+  humanReadableName: "Contact Picker API"
+  humanReadableDescription: "Enable the Contact Picker API"
+  defaultValue:
+    WebKitLegacy:
+      default: false
+    WebKit:
+      default: false
+
 CoreImageAcceleratedFilterRenderEnabled:
   type: bool
   humanReadableName: "CoreImage-Accelerated Filter Rendering"

Modified: trunk/Source/WebCore/CMakeLists.txt (267987 => 267988)


--- trunk/Source/WebCore/CMakeLists.txt	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WebCore/CMakeLists.txt	2020-10-05 18:56:12 UTC (rev 267988)
@@ -29,6 +29,7 @@
     "${WEBCORE_DIR}/Modules/async-clipboard"
     "${WEBCORE_DIR}/Modules/beacon"
     "${WEBCORE_DIR}/Modules/cache"
+    "${WEBCORE_DIR}/Modules/contact-picker"
     "${WEBCORE_DIR}/Modules/credentialmanagement"
     "${WEBCORE_DIR}/Modules/encryptedmedia"
     "${WEBCORE_DIR}/Modules/encryptedmedia/legacy"
@@ -233,6 +234,12 @@
     Modules/cache/DOMWindow+Caches.idl
     Modules/cache/WorkerGlobalScope+Caches.idl
 
+    Modules/contact-picker/ContactInfo.idl
+    Modules/contact-picker/ContactProperty.idl
+    Modules/contact-picker/ContactsManager.idl
+    Modules/contact-picker/ContactsSelectOptions.idl
+    Modules/contact-picker/Navigator+Contacts.idl
+
     Modules/credentialmanagement/BasicCredential.idl
     Modules/credentialmanagement/CredentialCreationOptions.idl
     Modules/credentialmanagement/CredentialRequestOptions.idl

Modified: trunk/Source/WebCore/ChangeLog (267987 => 267988)


--- trunk/Source/WebCore/ChangeLog	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WebCore/ChangeLog	2020-10-05 18:56:12 UTC (rev 267988)
@@ -1,3 +1,51 @@
+2020-10-05  Aditya Keerthi  <akeer...@apple.com>
+
+        [Contact Picker API] Introduce bindings for the Contact Picker API
+        https://bugs.webkit.org/show_bug.cgi?id=216793
+        <rdar://problem/69317957>
+
+        Reviewed by Wenson Hsieh.
+
+        Added IDL for the Contact Picker API, with the exception of the address
+        and icon contact properties (which will be added after an initial
+        implemention is complete). See: https://wicg.github.io/contact-api/spec/
+        for more information.
+
+        Test: contact-picker/contacts-interfaces.html
+
+        * CMakeLists.txt:
+        * DerivedSources-input.xcfilelist:
+        * DerivedSources-output.xcfilelist:
+        * DerivedSources.make:
+        * Modules/contact-picker/ContactInfo.h: Added.
+        * Modules/contact-picker/ContactInfo.idl: Added.
+        * Modules/contact-picker/ContactProperty.h: Added.
+        * Modules/contact-picker/ContactProperty.idl: Added.
+        * Modules/contact-picker/ContactsManager.cpp: Added.
+        (WebCore::ContactsManager::create):
+        (WebCore::ContactsManager::ContactsManager):
+        (WebCore::ContactsManager::navigator):
+        (WebCore::ContactsManager::getProperties):
+        (WebCore::ContactsManager::select):
+
+        Stub out these API calls for now by immediately rejecting the given promise.
+
+        * Modules/contact-picker/ContactsManager.h: Added.
+        * Modules/contact-picker/ContactsManager.idl: Added.
+        * Modules/contact-picker/ContactsSelectOptions.h: Added.
+        * Modules/contact-picker/ContactsSelectOptions.idl: Added.
+        * Modules/contact-picker/NavigatorContacts.cpp: Added.
+        (WebCore::NavigatorContacts::NavigatorContacts):
+        (WebCore::NavigatorContacts::contacts):
+        (WebCore::NavigatorContacts::from):
+        (WebCore::NavigatorContacts::supplementName):
+        * Modules/contact-picker/NavigatorContacts.h: Added.
+        * Modules/contact-picker/Navigator+Contacts.idl: Added.
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/WebCoreBuiltinNames.h:
+        * page/Settings.yaml:
+
 2020-10-05  Youenn Fablet  <you...@apple.com>
 
         MediaRecorder should respect enabled and muted tracks

Modified: trunk/Source/WebCore/DerivedSources-input.xcfilelist (267987 => 267988)


--- trunk/Source/WebCore/DerivedSources-input.xcfilelist	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WebCore/DerivedSources-input.xcfilelist	2020-10-05 18:56:12 UTC (rev 267988)
@@ -64,6 +64,11 @@
 $(PROJECT_DIR)/Modules/cache/DOMCacheStorage.idl
 $(PROJECT_DIR)/Modules/cache/DOMWindow+Caches.idl
 $(PROJECT_DIR)/Modules/cache/WorkerGlobalScope+Caches.idl
+$(PROJECT_DIR)/Modules/contact-picker/ContactInfo.idl
+$(PROJECT_DIR)/Modules/contact-picker/ContactProperty.idl
+$(PROJECT_DIR)/Modules/contact-picker/ContactsManager.idl
+$(PROJECT_DIR)/Modules/contact-picker/ContactsSelectOptions.idl
+$(PROJECT_DIR)/Modules/contact-picker/Navigator+Contacts.idl
 $(PROJECT_DIR)/Modules/credentialmanagement/BasicCredential.idl
 $(PROJECT_DIR)/Modules/credentialmanagement/CredentialCreationOptions.idl
 $(PROJECT_DIR)/Modules/credentialmanagement/CredentialRequestOptions.idl

Modified: trunk/Source/WebCore/DerivedSources-output.xcfilelist (267987 => 267988)


--- trunk/Source/WebCore/DerivedSources-output.xcfilelist	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WebCore/DerivedSources-output.xcfilelist	2020-10-05 18:56:12 UTC (rev 267988)
@@ -394,6 +394,14 @@
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSConstantSourceNode.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSConstantSourceOptions.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSConstantSourceOptions.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSContactInfo.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSContactInfo.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSContactProperty.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSContactProperty.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSContactsManager.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSContactsManager.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSContactsSelectOptions.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSContactsSelectOptions.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSConvolverNode.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSConvolverNode.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSConvolverOptions.cpp
@@ -1327,6 +1335,8 @@
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigator+Beacon.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigator+Clipboard.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigator+Clipboard.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigator+Contacts.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigator+Contacts.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigator+Credentials.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigator+Credentials.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigator+EME.cpp

Modified: trunk/Source/WebCore/DerivedSources.make (267987 => 267988)


--- trunk/Source/WebCore/DerivedSources.make	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WebCore/DerivedSources.make	2020-10-05 18:56:12 UTC (rev 267988)
@@ -57,6 +57,7 @@
     $(WebCore)/Modules/async-clipboard \
     $(WebCore)/Modules/beacon \
     $(WebCore)/Modules/cache \
+    $(WebCore)/Modules/contact-picker \
     $(WebCore)/Modules/credentialmanagement \
     $(WebCore)/Modules/encryptedmedia \
     $(WebCore)/Modules/encryptedmedia/legacy \
@@ -166,6 +167,11 @@
     $(WebCore)/Modules/cache/DOMCacheStorage.idl \
     $(WebCore)/Modules/cache/DOMWindow+Caches.idl \
     $(WebCore)/Modules/cache/WorkerGlobalScope+Caches.idl \
+    $(WebCore)/Modules/contact-picker/ContactInfo.idl \
+    $(WebCore)/Modules/contact-picker/ContactProperty.idl \
+    $(WebCore)/Modules/contact-picker/ContactsManager.idl \
+    $(WebCore)/Modules/contact-picker/ContactsSelectOptions.idl \
+    $(WebCore)/Modules/contact-picker/Navigator+Contacts.idl \
     $(WebCore)/Modules/credentialmanagement/BasicCredential.idl \
     $(WebCore)/Modules/credentialmanagement/CredentialCreationOptions.idl \
     $(WebCore)/Modules/credentialmanagement/CredentialRequestOptions.idl \

Added: trunk/Source/WebCore/Modules/contact-picker/ContactInfo.h (0 => 267988)


--- trunk/Source/WebCore/Modules/contact-picker/ContactInfo.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/contact-picker/ContactInfo.h	2020-10-05 18:56:12 UTC (rev 267988)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2020 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
+
+namespace WebCore {
+
+struct ContactInfo {
+    Vector<String> name;
+    Vector<String> email;
+    Vector<String> tel;
+};
+
+}

Added: trunk/Source/WebCore/Modules/contact-picker/ContactInfo.idl (0 => 267988)


--- trunk/Source/WebCore/Modules/contact-picker/ContactInfo.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/contact-picker/ContactInfo.idl	2020-10-05 18:56:12 UTC (rev 267988)
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2020 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.
+ */
+
+// https://wicg.github.io/contact-api/
+
+dictionary ContactInfo {
+    sequence<USVString> name;
+    sequence<USVString> email;
+    sequence<USVString> tel;
+};

Added: trunk/Source/WebCore/Modules/contact-picker/ContactProperty.h (0 => 267988)


--- trunk/Source/WebCore/Modules/contact-picker/ContactProperty.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/contact-picker/ContactProperty.h	2020-10-05 18:56:12 UTC (rev 267988)
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2020 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
+
+namespace WebCore {
+
+enum class ContactProperty : uint8_t { Email, Name, Tel };
+
+}

Added: trunk/Source/WebCore/Modules/contact-picker/ContactProperty.idl (0 => 267988)


--- trunk/Source/WebCore/Modules/contact-picker/ContactProperty.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/contact-picker/ContactProperty.idl	2020-10-05 18:56:12 UTC (rev 267988)
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2020 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.
+ */
+
+// https://wicg.github.io/contact-api/
+
+enum ContactProperty { "email", "name", "tel" };

Added: trunk/Source/WebCore/Modules/contact-picker/ContactsManager.cpp (0 => 267988)


--- trunk/Source/WebCore/Modules/contact-picker/ContactsManager.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/contact-picker/ContactsManager.cpp	2020-10-05 18:56:12 UTC (rev 267988)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2020 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 "ContactsManager.h"
+
+#include "ContactInfo.h"
+#include "ContactProperty.h"
+#include "ContactsSelectOptions.h"
+#include "JSDOMPromiseDeferred.h"
+#include "Navigator.h"
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(ContactsManager);
+
+Ref<ContactsManager> ContactsManager::create(Navigator& navigator)
+{
+    return adoptRef(*new ContactsManager(navigator));
+}
+
+ContactsManager::ContactsManager(Navigator& navigator)
+    : m_navigator(makeWeakPtr(navigator))
+{
+}
+
+ContactsManager::~ContactsManager() = default;
+
+Navigator* ContactsManager::navigator()
+{
+    return m_navigator.get();
+}
+
+void ContactsManager::getProperties(Ref<DeferredPromise>&& promise)
+{
+    promise->reject(NotSupportedError);
+}
+
+void ContactsManager::select(const Vector<ContactProperty>& properties, const ContactsSelectOptions& options, Ref<DeferredPromise>&& promise)
+{
+    UNUSED_PARAM(properties);
+    UNUSED_PARAM(options);
+    promise->reject(NotSupportedError);
+}
+
+} // namespace WebCore

Added: trunk/Source/WebCore/Modules/contact-picker/ContactsManager.h (0 => 267988)


--- trunk/Source/WebCore/Modules/contact-picker/ContactsManager.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/contact-picker/ContactsManager.h	2020-10-05 18:56:12 UTC (rev 267988)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2020 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/IsoMalloc.h>
+#include <wtf/Vector.h>
+#include <wtf/WeakPtr.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class DeferredPromise;
+class Navigator;
+
+enum class ContactProperty : uint8_t;
+
+struct ContactsSelectOptions;
+
+class ContactsManager final : public RefCounted<ContactsManager> {
+    WTF_MAKE_ISO_ALLOCATED(ContactsManager);
+public:
+    static Ref<ContactsManager> create(Navigator&);
+    ~ContactsManager();
+
+    Navigator* navigator();
+
+    void getProperties(Ref<DeferredPromise>&&);
+    void select(const Vector<ContactProperty>&, const ContactsSelectOptions&, Ref<DeferredPromise>&&);
+
+private:
+    ContactsManager(Navigator&);
+
+    WeakPtr<Navigator> m_navigator;
+};
+
+} // namespace WebCore

Added: trunk/Source/WebCore/Modules/contact-picker/ContactsManager.idl (0 => 267988)


--- trunk/Source/WebCore/Modules/contact-picker/ContactsManager.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/contact-picker/ContactsManager.idl	2020-10-05 18:56:12 UTC (rev 267988)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2020 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.
+ */
+
+// https://wicg.github.io/contact-api/
+
+[
+    EnabledBySetting=ContactPickerAPI,
+    Exposed=Window,
+    GenerateIsReachable=ReachableFromNavigator,
+    ImplementationLacksVTable,
+    SecureContext
+] interface ContactsManager {
+    Promise<sequence<ContactProperty>> getProperties();
+    Promise<sequence<ContactInfo>> select(sequence<ContactProperty> properties, optional ContactsSelectOptions options);
+};

Added: trunk/Source/WebCore/Modules/contact-picker/ContactsSelectOptions.h (0 => 267988)


--- trunk/Source/WebCore/Modules/contact-picker/ContactsSelectOptions.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/contact-picker/ContactsSelectOptions.h	2020-10-05 18:56:12 UTC (rev 267988)
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2020 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
+
+namespace WebCore {
+
+struct ContactsSelectOptions {
+    bool multiple { false };
+};
+
+}

Added: trunk/Source/WebCore/Modules/contact-picker/ContactsSelectOptions.idl (0 => 267988)


--- trunk/Source/WebCore/Modules/contact-picker/ContactsSelectOptions.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/contact-picker/ContactsSelectOptions.idl	2020-10-05 18:56:12 UTC (rev 267988)
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2020 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.
+ */
+
+// https://wicg.github.io/contact-api/
+
+dictionary ContactsSelectOptions {
+    boolean multiple = false;
+};

Added: trunk/Source/WebCore/Modules/contact-picker/Navigator+Contacts.idl (0 => 267988)


--- trunk/Source/WebCore/Modules/contact-picker/Navigator+Contacts.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/contact-picker/Navigator+Contacts.idl	2020-10-05 18:56:12 UTC (rev 267988)
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2020 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.
+ */
+
+// https://wicg.github.io/contact-api/
+
+[
+    EnabledBySetting=ContactPickerAPI,
+    Exposed=Window,
+    ImplementedBy=NavigatorContacts
+] partial interface Navigator {
+    [SecureContext, SameObject] readonly attribute ContactsManager contacts;
+};

Added: trunk/Source/WebCore/Modules/contact-picker/NavigatorContacts.cpp (0 => 267988)


--- trunk/Source/WebCore/Modules/contact-picker/NavigatorContacts.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/contact-picker/NavigatorContacts.cpp	2020-10-05 18:56:12 UTC (rev 267988)
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2020 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 "NavigatorContacts.h"
+
+#include "ContactsManager.h"
+#include "Navigator.h"
+#include <wtf/StdLibExtras.h>
+
+namespace WebCore {
+
+NavigatorContacts::NavigatorContacts(Navigator& navigator)
+    : m_navigator(navigator)
+{
+}
+
+NavigatorContacts::~NavigatorContacts() = default;
+
+RefPtr<ContactsManager> NavigatorContacts::contacts(Navigator& navigator)
+{
+    return NavigatorContacts::from(navigator)->contacts();
+}
+
+RefPtr<ContactsManager> NavigatorContacts::contacts()
+{
+    if (!m_contactsManager)
+        m_contactsManager = ContactsManager::create(m_navigator);
+    return m_contactsManager;
+}
+
+NavigatorContacts* NavigatorContacts::from(Navigator& navigator)
+{
+    auto* supplement = static_cast<NavigatorContacts*>(Supplement<Navigator>::from(&navigator, supplementName()));
+    if (!supplement) {
+        auto newSupplement = makeUnique<NavigatorContacts>(navigator);
+        supplement = newSupplement.get();
+        provideTo(&navigator, supplementName(), WTFMove(newSupplement));
+    }
+    return supplement;
+}
+
+const char* NavigatorContacts::supplementName()
+{
+    return "NavigatorContacts";
+}
+
+}

Added: trunk/Source/WebCore/Modules/contact-picker/NavigatorContacts.h (0 => 267988)


--- trunk/Source/WebCore/Modules/contact-picker/NavigatorContacts.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/contact-picker/NavigatorContacts.h	2020-10-05 18:56:12 UTC (rev 267988)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2020 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 "Supplementable.h"
+#include <wtf/Forward.h>
+
+namespace WebCore {
+
+class ContactsManager;
+class Navigator;
+
+class NavigatorContacts final : public Supplement<Navigator> {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    explicit NavigatorContacts(Navigator&);
+    ~NavigatorContacts();
+
+    static RefPtr<ContactsManager> contacts(Navigator&);
+    RefPtr<ContactsManager> contacts();
+
+private:
+    static NavigatorContacts* from(Navigator&);
+    static const char* supplementName();
+
+    RefPtr<ContactsManager> m_contactsManager;
+    Navigator& m_navigator;
+};
+
+}

Modified: trunk/Source/WebCore/Sources.txt (267987 => 267988)


--- trunk/Source/WebCore/Sources.txt	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WebCore/Sources.txt	2020-10-05 18:56:12 UTC (rev 267988)
@@ -37,6 +37,8 @@
 Modules/cache/DOMWindowCaches.cpp
 Modules/cache/WorkerCacheStorageConnection.cpp
 Modules/cache/WorkerGlobalScopeCaches.cpp
+Modules/contact-picker/ContactsManager.cpp
+Modules/contact-picker/NavigatorContacts.cpp
 Modules/credentialmanagement/BasicCredential.cpp
 Modules/credentialmanagement/CredentialsContainer.cpp
 Modules/credentialmanagement/NavigatorCredentials.cpp
@@ -2779,6 +2781,10 @@
 JSComputedEffectTiming.cpp
 JSConstantSourceNode.cpp
 JSConstantSourceOptions.cpp
+JSContactInfo.cpp
+JSContactProperty.cpp
+JSContactsManager.cpp
+JSContactsSelectOptions.cpp
 JSConvolverNode.cpp
 JSConvolverOptions.cpp
 JSCountQueuingStrategy.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (267987 => 267988)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2020-10-05 18:56:12 UTC (rev 267988)
@@ -5098,6 +5098,11 @@
 		E52CF54F20A35A2800DADA27 /* DataListSuggestionPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = E52CF54E20A35A2800DADA27 /* DataListSuggestionPicker.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		E52EFDF42112875A00AD282A /* InputMode.h in Headers */ = {isa = PBXBuildFile; fileRef = E52EFDF22112875A00AD282A /* InputMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		E58B45BA20AD07DD00991025 /* DataListButtonElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E58B45B820AD07DD00991025 /* DataListButtonElement.h */; };
+		E596DD29251903D200C275A7 /* NavigatorContacts.h in Headers */ = {isa = PBXBuildFile; fileRef = E596DD26251903D100C275A7 /* NavigatorContacts.h */; };
+		E596DD30251903EF00C275A7 /* ContactsManager.h in Headers */ = {isa = PBXBuildFile; fileRef = E596DD2D251903EF00C275A7 /* ContactsManager.h */; };
+		E596DD352519041400C275A7 /* ContactsSelectOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = E596DD332519041400C275A7 /* ContactsSelectOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		E596DD58251BAC4A00C275A7 /* ContactProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = E596DD56251BAC4A00C275A7 /* ContactProperty.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		E596DD5D251BB08200C275A7 /* ContactInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = E596DD5B251BB08200C275A7 /* ContactInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		E59DD4B821098287003C8B47 /* ListButtonArrow.png in Resources */ = {isa = PBXBuildFile; fileRef = E59DD4B721098285003C8B47 /* ListButtonArrow.png */; };
 		E5BA7D63151437CA00FE1E3F /* LengthFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = E5BA7D62151437CA00FE1E3F /* LengthFunctions.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		E5C59A9A24D0E1AA003B86E1 /* DateTimeChooserParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = E5C59A9924D0E1AA003B86E1 /* DateTimeChooserParameters.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -16097,6 +16102,18 @@
 		E52EFDF32112875A00AD282A /* InputMode.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InputMode.cpp; sourceTree = "<group>"; };
 		E55F4979151B888000BB67DB /* LengthFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LengthFunctions.cpp; sourceTree = "<group>"; };
 		E58B45B820AD07DD00991025 /* DataListButtonElement.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DataListButtonElement.h; sourceTree = "<group>"; };
+		E596DD26251903D100C275A7 /* NavigatorContacts.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NavigatorContacts.h; sourceTree = "<group>"; };
+		E596DD27251903D200C275A7 /* NavigatorContacts.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = NavigatorContacts.cpp; sourceTree = "<group>"; };
+		E596DD28251903D200C275A7 /* Navigator+Contacts.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Navigator+Contacts.idl"; sourceTree = "<group>"; };
+		E596DD2D251903EF00C275A7 /* ContactsManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContactsManager.h; sourceTree = "<group>"; };
+		E596DD2E251903EF00C275A7 /* ContactsManager.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ContactsManager.cpp; sourceTree = "<group>"; };
+		E596DD2F251903EF00C275A7 /* ContactsManager.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ContactsManager.idl; sourceTree = "<group>"; };
+		E596DD332519041400C275A7 /* ContactsSelectOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContactsSelectOptions.h; sourceTree = "<group>"; };
+		E596DD342519041400C275A7 /* ContactsSelectOptions.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ContactsSelectOptions.idl; sourceTree = "<group>"; };
+		E596DD56251BAC4A00C275A7 /* ContactProperty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContactProperty.h; sourceTree = "<group>"; };
+		E596DD57251BAC4A00C275A7 /* ContactProperty.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ContactProperty.idl; sourceTree = "<group>"; };
+		E596DD5B251BB08200C275A7 /* ContactInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContactInfo.h; sourceTree = "<group>"; };
+		E596DD5C251BB08200C275A7 /* ContactInfo.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ContactInfo.idl; sourceTree = "<group>"; };
 		E59DD4B721098285003C8B47 /* ListButtonArrow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ListButtonArrow.png; sourceTree = "<group>"; };
 		E5BA7D62151437CA00FE1E3F /* LengthFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LengthFunctions.h; sourceTree = "<group>"; };
 		E5C59A9924D0E1AA003B86E1 /* DateTimeChooserParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateTimeChooserParameters.h; sourceTree = "<group>"; };
@@ -23332,6 +23349,7 @@
 				F440E76A233D93C80063F9AB /* async-clipboard */,
 				832150791F27E96B0095B136 /* beacon */,
 				41380C1E1F34366000155FDA /* cache */,
+				E596DD23251902D600C275A7 /* contact-picker */,
 				57C7A6881E56946D00C67D71 /* credentialmanagement */,
 				CDA98DBD16014E0800FEA3B1 /* encryptedmedia */,
 				83FB33651F508A1700986E54 /* entriesapi */,
@@ -28546,6 +28564,25 @@
 			path = integration;
 			sourceTree = "<group>";
 		};
+		E596DD23251902D600C275A7 /* contact-picker */ = {
+			isa = PBXGroup;
+			children = (
+				E596DD5B251BB08200C275A7 /* ContactInfo.h */,
+				E596DD5C251BB08200C275A7 /* ContactInfo.idl */,
+				E596DD56251BAC4A00C275A7 /* ContactProperty.h */,
+				E596DD57251BAC4A00C275A7 /* ContactProperty.idl */,
+				E596DD2E251903EF00C275A7 /* ContactsManager.cpp */,
+				E596DD2D251903EF00C275A7 /* ContactsManager.h */,
+				E596DD2F251903EF00C275A7 /* ContactsManager.idl */,
+				E596DD332519041400C275A7 /* ContactsSelectOptions.h */,
+				E596DD342519041400C275A7 /* ContactsSelectOptions.idl */,
+				E596DD28251903D200C275A7 /* Navigator+Contacts.idl */,
+				E596DD27251903D200C275A7 /* NavigatorContacts.cpp */,
+				E596DD26251903D100C275A7 /* NavigatorContacts.h */,
+			);
+			path = "contact-picker";
+			sourceTree = "<group>";
+		};
 		ED501DC90B249F3900AE18D9 /* mac */ = {
 			isa = PBXGroup;
 			children = (
@@ -30834,6 +30871,10 @@
 				2DAF343D1EA7E0F100382CD3 /* ConstantPropertyMap.h in Headers */,
 				E7C8E13B24E2FE7E0027A27F /* ConstantSourceNode.h in Headers */,
 				E7C8E13724E2FBCE0027A27F /* ConstantSourceOptions.h in Headers */,
+				E596DD5D251BB08200C275A7 /* ContactInfo.h in Headers */,
+				E596DD58251BAC4A00C275A7 /* ContactProperty.h in Headers */,
+				E596DD30251903EF00C275A7 /* ContactsManager.h in Headers */,
+				E596DD352519041400C275A7 /* ContactsSelectOptions.h in Headers */,
 				A818721C0977D3C0005826D9 /* ContainerNode.h in Headers */,
 				E1A1470811102B1500EEC0F3 /* ContainerNodeAlgorithms.h in Headers */,
 				6FB5E214221F2453003989CF /* ContentChangeObserver.h in Headers */,
@@ -33126,6 +33167,7 @@
 				E12719C70EEEC16800F61213 /* NavigatorBase.h in Headers */,
 				8321507E1F27EA1B0095B136 /* NavigatorBeacon.h in Headers */,
 				F440E77A233D94D70063F9AB /* NavigatorClipboard.h in Headers */,
+				E596DD29251903D200C275A7 /* NavigatorContacts.h in Headers */,
 				372D3E57216578AE00C5E021 /* NavigatorCredentials.h in Headers */,
 				9711460414EF009A00674FD9 /* NavigatorGeolocation.h in Headers */,
 				6B507A24234BF34100BE7C62 /* NavigatorIsLoggedIn.h in Headers */,

Modified: trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h (267987 => 267988)


--- trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2020-10-05 18:56:12 UTC (rev 267988)
@@ -70,6 +70,7 @@
     macro(Clipboard) \
     macro(ClipboardItem) \
     macro(ConstantSourceNode) \
+    macro(ContactsManager) \
     macro(Credential) \
     macro(CredentialsContainer) \
     macro(CSSAnimation) \

Modified: trunk/Source/WebCore/page/Settings.yaml (267987 => 267988)


--- trunk/Source/WebCore/page/Settings.yaml	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WebCore/page/Settings.yaml	2020-10-05 18:56:12 UTC (rev 267988)
@@ -1049,6 +1049,9 @@
 undoManagerAPIEnabled:
   initial: false
 
+contactPickerAPIEnabled:
+  initial: false
+
 intersectionObserverEnabled:
   initial: false
   conditional: ENABLE(INTERSECTION_OBSERVER)

Modified: trunk/Source/WebKit/ChangeLog (267987 => 267988)


--- trunk/Source/WebKit/ChangeLog	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WebKit/ChangeLog	2020-10-05 18:56:12 UTC (rev 267988)
@@ -1,3 +1,15 @@
+2020-10-05  Aditya Keerthi  <akeer...@apple.com>
+
+        [Contact Picker API] Introduce bindings for the Contact Picker API
+        https://bugs.webkit.org/show_bug.cgi?id=216793
+        <rdar://problem/69317957>
+
+        Reviewed by Wenson Hsieh.
+
+        Added a new experimental feature flag. See WebCore Changelog for more details.
+
+        * Shared/WebPreferencesExperimental.yaml:
+
 2020-10-05  Per Arne Vollan  <pvol...@apple.com>
 
         [Cocoa] Reduce time waiting for Launch Services database

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (267987 => 267988)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2020-10-05 18:56:12 UTC (rev 267988)
@@ -1,3 +1,19 @@
+2020-10-05  Aditya Keerthi  <akeer...@apple.com>
+
+        [Contact Picker API] Introduce bindings for the Contact Picker API
+        https://bugs.webkit.org/show_bug.cgi?id=216793
+        <rdar://problem/69317957>
+
+        Reviewed by Wenson Hsieh.
+
+        Added plumbing to support the associated experimental test option.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (-[WebPreferences contactPickerAPIEnabled]):
+        (-[WebPreferences setContactPickerAPIEnabled:]):
+        * WebView/WebPreferencesPrivate.h:
+
 2020-10-05  Sam Weinig  <wei...@apple.com>
 
         Remove support for enabling subpixel CSSOM values, it's off by default everywhere and known to be not-compatible with the web

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h (267987 => 267988)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h	2020-10-05 18:56:12 UTC (rev 267988)
@@ -288,6 +288,7 @@
 #define WebKitTransformStreamAPIEnabledPreferenceKey @"WebKitTransformStreamAPIEnabled"
 #define WebKitMediaRecorderEnabledPreferenceKey @"WebKitMediaRecorderEnabled"
 #define WebKitCSSIndividualTransformPropertiesEnabledPreferenceKey @"WebKitCSSIndividualTransformPropertiesEnabled"
+#define WebKitContactPickerAPIEnabledPreferenceKey @"WebKitContactPickerAPIEnabled"
 
 // The preference keys below this point are deprecated and have no effect. They should
 // be removed when it is considered safe to do so.

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm (267987 => 267988)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm	2020-10-05 18:56:12 UTC (rev 267988)
@@ -3075,6 +3075,16 @@
     [self _setBoolValue:flag forKey:WebKitAsyncClipboardAPIEnabledPreferenceKey];
 }
 
+- (BOOL)contactPickerAPIEnabled
+{
+    return [self _boolValueForKey:WebKitContactPickerAPIEnabledPreferenceKey];
+}
+
+- (void)setContactPickerAPIEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitContactPickerAPIEnabledPreferenceKey];
+}
+
 - (BOOL)intersectionObserverEnabled
 {
     return [self _boolValueForKey:WebKitIntersectionObserverEnabledPreferenceKey];

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h (267987 => 267988)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h	2020-10-05 18:56:12 UTC (rev 267988)
@@ -642,6 +642,7 @@
 @property (nonatomic) BOOL mediaRecorderEnabled;
 @property (nonatomic, setter=_setMediaRecorderEnabled:) BOOL _mediaRecorderEnabled;
 @property (nonatomic) BOOL CSSIndividualTransformPropertiesEnabled;
+@property (nonatomic) BOOL contactPickerAPIEnabled;
 @end
 
 @interface WebPreferences (WebPrivateDeprecated)

Modified: trunk/Source/WebKitLegacy/win/ChangeLog (267987 => 267988)


--- trunk/Source/WebKitLegacy/win/ChangeLog	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WebKitLegacy/win/ChangeLog	2020-10-05 18:56:12 UTC (rev 267988)
@@ -1,3 +1,23 @@
+2020-10-05  Aditya Keerthi  <akeer...@apple.com>
+
+        [Contact Picker API] Introduce bindings for the Contact Picker API
+        https://bugs.webkit.org/show_bug.cgi?id=216793
+        <rdar://problem/69317957>
+
+        Reviewed by Wenson Hsieh.
+
+        Added plumbing to support the associated experimental test option.
+
+        * Interfaces/IWebPreferencesPrivate.idl:
+        * WebPreferenceKeysPrivate.h:
+        * WebPreferences.cpp:
+        (WebPreferences::initializeDefaultSettings):
+        (WebPreferences::contactPickerAPIEnabled):
+        (WebPreferences::setContactPickerAPIEnabled):
+        * WebPreferences.h:
+        * WebView.cpp:
+        (WebView::notifyPreferencesChanged):
+
 2020-10-03  Yusuke Suzuki  <ysuz...@apple.com>
 
         [JSC] Introduce JITOperationList to validate JIT-caged pointers

Modified: trunk/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl (267987 => 267988)


--- trunk/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl	2020-10-05 18:56:12 UTC (rev 267988)
@@ -267,4 +267,6 @@
     HRESULT setAllowTopNavigationToDataURLs([in] BOOL enabled);
     HRESULT modernUnprefixedWebAudioEnabled([out, retval] BOOL* enabled);
     HRESULT setModernUnprefixedWebAudioEnabled([in] BOOL enabled);
+    HRESULT contactPickerAPIEnabled([out, retval] BOOL* enabled);
+    HRESULT setContactPickerAPIEnabled([in] BOOL enabled);
 }

Modified: trunk/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h (267987 => 267988)


--- trunk/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h	2020-10-05 18:56:12 UTC (rev 267988)
@@ -224,6 +224,8 @@
 
 #define WebKitAsyncClipboardAPIEnabledPreferenceKey "WebKitAsyncClipboardAPIEnabled"
 
+#define WebKitContactPickerAPIEnabledPreferenceKey "WebKitContactPickerAPIEnabled"
+
 #define WebKitAspectRatioOfImgFromWidthAndHeightEnabledPreferenceKey "WebKitAspectRatioOfImgFromWidthAndHeightEnabled"
 
 #define WebKitWebSQLEnabledPreferenceKey "WebKitWebSQLEnabled"

Modified: trunk/Source/WebKitLegacy/win/WebPreferences.cpp (267987 => 267988)


--- trunk/Source/WebKitLegacy/win/WebPreferences.cpp	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WebKitLegacy/win/WebPreferences.cpp	2020-10-05 18:56:12 UTC (rev 267988)
@@ -339,6 +339,8 @@
 
     CFDictionaryAddValue(defaults, CFSTR(WebKitAsyncClipboardAPIEnabledPreferenceKey), kCFBooleanFalse);
 
+    CFDictionaryAddValue(defaults, CFSTR(WebKitContactPickerAPIEnabledPreferenceKey), kCFBooleanFalse);
+
     CFDictionaryAddValue(defaults, CFSTR(WebKitAspectRatioOfImgFromWidthAndHeightEnabledPreferenceKey), kCFBooleanFalse);
 
     CFDictionaryAddValue(defaults, CFSTR(WebKitWebSQLEnabledPreferenceKey), kCFBooleanFalse);
@@ -2309,6 +2311,20 @@
     return S_OK;
 }
 
+HRESULT WebPreferences::contactPickerAPIEnabled(_Out_ BOOL* enabled)
+{
+    if (!enabled)
+        return E_POINTER;
+    *enabled = boolValueForKey(WebKitContactPickerAPIEnabledPreferenceKey);
+    return S_OK;
+}
+
+HRESULT WebPreferences::setContactPickerAPIEnabled(BOOL enabled)
+{
+    setBoolValue(WebKitContactPickerAPIEnabledPreferenceKey, enabled);
+    return S_OK;
+}
+
 HRESULT WebPreferences::setApplicationId(BSTR applicationId)
 {
 #if USE(CF)

Modified: trunk/Source/WebKitLegacy/win/WebPreferences.h (267987 => 267988)


--- trunk/Source/WebKitLegacy/win/WebPreferences.h	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WebKitLegacy/win/WebPreferences.h	2020-10-05 18:56:12 UTC (rev 267988)
@@ -305,6 +305,8 @@
     virtual HRESULT STDMETHODCALLTYPE setAllowTopNavigationToDataURLs(BOOL);
     virtual HRESULT STDMETHODCALLTYPE modernUnprefixedWebAudioEnabled(_Out_ BOOL*);
     virtual HRESULT STDMETHODCALLTYPE setModernUnprefixedWebAudioEnabled(BOOL);
+    virtual HRESULT STDMETHODCALLTYPE contactPickerAPIEnabled(_Out_ BOOL*);
+    virtual HRESULT STDMETHODCALLTYPE setContactPickerAPIEnabled(BOOL);
 
     // WebPreferences
 

Modified: trunk/Source/WebKitLegacy/win/WebView.cpp (267987 => 267988)


--- trunk/Source/WebKitLegacy/win/WebView.cpp	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Source/WebKitLegacy/win/WebView.cpp	2020-10-05 18:56:12 UTC (rev 267988)
@@ -5642,6 +5642,11 @@
         return hr;
     settings.setAsyncClipboardAPIEnabled(!!enabled);
 
+    hr = prefsPrivate->contactPickerAPIEnabled(&enabled);
+    if (FAILED(hr))
+        return hr;
+    settings.setContactPickerAPIEnabled(!!enabled);
+
     hr = prefsPrivate->aspectRatioOfImgFromWidthAndHeightEnabled(&enabled);
     if (FAILED(hr))
         return hr;

Modified: trunk/Tools/ChangeLog (267987 => 267988)


--- trunk/Tools/ChangeLog	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Tools/ChangeLog	2020-10-05 18:56:12 UTC (rev 267988)
@@ -1,3 +1,21 @@
+2020-10-05  Aditya Keerthi  <akeer...@apple.com>
+
+        [Contact Picker API] Introduce bindings for the Contact Picker API
+        https://bugs.webkit.org/show_bug.cgi?id=216793
+        <rdar://problem/69317957>
+
+        Reviewed by Wenson Hsieh.
+
+        Added plumbing to support the associated experimental test option.
+
+        * DumpRenderTree/TestOptions.cpp:
+        (TestOptions::TestOptions):
+        * DumpRenderTree/TestOptions.h:
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (setWebPreferencesForTestOptions):
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (setWebPreferencesForTestOptions):
+
 2020-10-05  Sam Weinig  <wei...@apple.com>
 
         Remove support for enabling subpixel CSSOM values, it's off by default everywhere and known to be not-compatible with the web

Modified: trunk/Tools/DumpRenderTree/TestOptions.cpp (267987 => 267988)


--- trunk/Tools/DumpRenderTree/TestOptions.cpp	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Tools/DumpRenderTree/TestOptions.cpp	2020-10-05 18:56:12 UTC (rev 267988)
@@ -156,6 +156,8 @@
             enableAspectRatioOfImgFromWidthAndHeight = parseBooleanTestHeaderValue(value);
         else if (key == "allowTopNavigationToDataURLs")
             allowTopNavigationToDataURLs = parseBooleanTestHeaderValue(value);
+        else if (key == "experimental:ContactPickerAPIEnabled")
+            enableContactPickerAPI = parseBooleanTestHeaderValue(value);
         pairStart = pairEnd + 1;
     }
 }

Modified: trunk/Tools/DumpRenderTree/TestOptions.h (267987 => 267988)


--- trunk/Tools/DumpRenderTree/TestOptions.h	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Tools/DumpRenderTree/TestOptions.h	2020-10-05 18:56:12 UTC (rev 267988)
@@ -53,6 +53,7 @@
     bool enableCoreMathML { false };
     bool enableRequestIdleCallback { false };
     bool enableAsyncClipboardAPI { false };
+    bool enableContactPickerAPI { false };
     bool layoutFormattingContextIntegrationEnabled { true };
     bool enableAspectRatioOfImgFromWidthAndHeight { false };
     bool enableWebSQL { true };

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (267987 => 267988)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2020-10-05 18:56:12 UTC (rev 267988)
@@ -992,6 +992,7 @@
     preferences.layoutFormattingContextIntegrationEnabled = options.layoutFormattingContextIntegrationEnabled;
     preferences.aspectRatioOfImgFromWidthAndHeightEnabled = options.enableAspectRatioOfImgFromWidthAndHeight;
     preferences.allowTopNavigationToDataURLs = options.allowTopNavigationToDataURLs;
+    preferences.contactPickerAPIEnabled = options.enableContactPickerAPI;
 }
 
 // Called once on DumpRenderTree startup.

Modified: trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp (267987 => 267988)


--- trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp	2020-10-05 18:52:32 UTC (rev 267987)
+++ trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp	2020-10-05 18:56:12 UTC (rev 267988)
@@ -920,6 +920,7 @@
     prefsPrivate->setInspectorAdditionsEnabled(options.enableInspectorAdditions);
     prefsPrivate->setRequestIdleCallbackEnabled(options.enableRequestIdleCallback);
     prefsPrivate->setAsyncClipboardAPIEnabled(options.enableAsyncClipboardAPI);
+    prefsPrivate->setContactPickerAPIEnabled(options.enableContactPickerAPI);
     prefsPrivate->setWebSQLEnabled(options.enableWebSQL);
     prefsPrivate->setAllowTopNavigationToDataURLs(options.allowTopNavigationToDataURLs);
     preferences->setPrivateBrowsingEnabled(options.useEphemeralSession);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to