From 5f5206f4a6407a08e9cedfd3625baee12ffde836 Mon Sep 17 00:00:00 2001 From: Rayan Kanso Date: Tue, 29 Oct 2019 15:09:53 +0000 Subject: [PATCH 1/2] Add support for selecting icons, resolves #13 --- README.md | 3 +- spec/index.bs | 32 ++++++++----- spec/index.html | 125 +++++++++++++++++++++++++++++++++++++----------- 3 files changed, 119 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index f340cd9..c34580f 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ selectRecipientsButton.addEventListener('click', async () => { ## Proposed WebIDL ```WebIDL -enum ContactProperty { "address", "email", "name", "tel" }; +enum ContactProperty { "address", "email", "icon", "name", "tel" }; interface ContactAddress : PaymentAddress {}; @@ -45,6 +45,7 @@ dictionary ContactInfo { sequence email; sequence tel; sequence address; + sequence icon; }; dictionary ContactsSelectOptions { diff --git a/spec/index.bs b/spec/index.bs index 3de9692..69a61c5 100644 --- a/spec/index.bs +++ b/spec/index.bs @@ -128,20 +128,24 @@ The contact picker task source is a [=task source=]. A user contact consists of:
-* names, a [=list=] of {{DOMString}}s, initially empty, each [=list/item=] representing - a unique name corresponding to the user. -* emails, a [=list=] of {{DOMString}}s, initially empty, each [=list/item=] representing - a unique [=valid e-mail address=] of the user. -* numbers, a [=list=] of {{DOMString}}s, initially empty, each [=list/item=] - representing a unique phone number of the user. -* addresses, a [=list=] of {{ContactAddress}}es, initially empty, each [=list/item=] - representing a unique [=physical address=] of the user. +* names, a [=list=] of {{DOMString}}s, each [=list/item=] representing a unique name + corresponding to the user. +* emails, a [=list=] of {{DOMString}}s, each [=list/item=] representing a unique + [=valid e-mail address=] of the user. +* numbers, a [=list=] of {{DOMString}}s, each [=list/item=] representing a unique phone + number of the user. +* addresses, a [=list=] of {{ContactAddress}}es, each [=list/item=] representing a + unique [=physical address=] of the user. +* icons, a [=list=] of {{Blob}}s, each [=list/item=] representing a unique image of the + user. + + NOTE: An icon {{Blob}} is image decodable and the {{Blob/type}} is an [=image mime type=]. + +A [=user contact=] contains data relating to a single user. Note: The lists can be of different sizes, and entries with the same index don't need to correspond to each other. -A [=user contact=] contains data relating to a single user. - ## Contacts source ## {#infrastructure-contacts-source} The contacts source is a service that provides the user's contact information to @@ -183,7 +187,7 @@ The [=browsing context=] has a contact picker is showing flag, initia ## {{ContactProperty}} ## {#contact-property} A {{ContactProperty}} is considered to be available if its associated [=user contact=] @@ -193,6 +197,8 @@ field can be accessed by the user agent. :: Associated with [=user contact=]'s [=user contact/addresses=]. : "email" :: Associated with [=user contact=]'s [=user contact/emails=]. +: "icon" +:: Associated with [=user contact=]'s [=user contact/icons=]. : "name" :: Associated with [=user contact=]'s [=user contact/names=]. : "tel" @@ -208,6 +214,7 @@ dictionary ContactInfo { sequence email; sequence tel; sequence address; + sequence icon; }; dictionary ContactsSelectOptions { @@ -277,6 +284,9 @@ interface ContactsManager { : {{ContactInfo/address}} :: |selectedContact|'s [=user contact/addresses=] if |properties| [=list/contains=] "`address`", otherwise undefined. + : {{ContactInfo/icon}} + :: |selectedContact|'s [=user contact/icons=] if |properties| [=list/contains=] + "`icon`", otherwise undefined. 1. [=list/Append=] |contact| to |contacts|. 1. Resolve |promise| with |contacts|. 1. Return |promise|. diff --git a/spec/index.html b/spec/index.html index 7f2ec10..a58280e 100644 --- a/spec/index.html +++ b/spec/index.html @@ -1213,9 +1213,9 @@ } - + - + - + - +