From 8554a68c470d3b7e801ffcdc6ca5213670542d91 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 7 Nov 2024 14:50:47 +0100 Subject: [PATCH] Define all members and correct some minor errors --- index.html | 275 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 247 insertions(+), 28 deletions(-) diff --git a/index.html b/index.html index f59c1db..c9440a8 100644 --- a/index.html +++ b/index.html @@ -195,6 +195,19 @@

} } +
+

+ Miscellaneous +

+

+ A 64-bit unsigned integer is an integer in the range 0 to + 18446744073709551615 (264 − 1), inclusive. +

+

+ A 32-bit unsigned integer is an integer in the range 0 to 4294967295 + (232 − 1), inclusive. +

+

Members @@ -217,8 +230,10 @@

- A JSON object consisting of the following members, many being analogous to - Notifications API features. [[NOTIFICATIONS]] + A JSON object consisting of the following members, all analogous to Notifications + API features, though sometimes with a slightly stricter type. Apart from + title all members are derived from the {{NotificationOptions}} + dictionary and are expected to be maintained in tandem. [[NOTIFICATIONS]]

@@ -254,7 +269,7 @@

- url (required) + navigate (required)

@@ -269,6 +284,14 @@

A string.

+
+ image +
+
+

+ A string that holds a URL. +

+
icon
@@ -277,6 +300,38 @@

A string that holds a URL.

+
+ badge +
+
+

+ A string that holds a URL. +

+
+
+ vibrate +
+
+

+ An array of [=32-bit unsigned integers=]. +

+
+
+ timestamp +
+
+

+ A [=64-bit unsigned integer=]. +

+
+
+ renotify +
+
+

+ A boolean. +

+
silent
@@ -285,6 +340,14 @@

A boolean.

+
+ require_interaction +
+
+

+ A boolean. +

+
data
@@ -293,6 +356,49 @@

Any JSON value.

+
+ actions +
+
+

+ An array of JSON objects consisting of the following members, all derived from + the {{NotificationAction}} dictionary and to be maintained in tandem. +

+
+
+ action (required) +
+
+

+ A string. +

+
+
+ title (required) +
+
+

+ A string. +

+
+
+ navigate (required) +
+
+

+ A string that holds a URL. +

+
+
+ icon +
+
+

+ A string that holds a URL. +

+
+
+
@@ -300,7 +406,7 @@

- An integer in the range 0 to 18446744073709551615 (264 − 1), inclusive. + A [=64-bit unsigned integer=].

Platform conventions are likely to impose a lower limit with regards to what is @@ -350,12 +456,8 @@

  • - If message["`web_push`"] does not [=map/exist=], then return failure. -

    -
  • -
  • -

    - If message["`web_push`"] is not 8030, then return failure. + If message["`web_push`"] does not [=map/exist=] or is not 8030, then + return failure.

  • @@ -399,24 +501,21 @@

  • - If notificationInput["`dir`"] [=map/exists=] and - notificationInput["`dir`"] is "`auto`", "`ltr`", or "`rtl`", then set - notificationOptions["{{NotificationOptions/dir}}"] to - notificationInput["`dir`"]. + If notificationInput["`dir`"] [=map/exists=] and is "`auto`", "`ltr`", + or "`rtl`", then set notificationOptions["{{NotificationOptions/dir}}"] + to notificationInput["`dir`"].

  • - If notificationInput["`lang`"] [=map/exists=] and - notificationInput["`lang`"] is a string, then set + If notificationInput["`lang`"] [=map/exists=] and is a string, then set notificationOptions["{{NotificationOptions/lang}}"] to notificationInput["`lang`"].

  • - If notificationInput["`body`"] [=map/exists=] and - notificationInput["`body`"] is a string, then set + If notificationInput["`body`"] [=map/exists=] and is a string, then set notificationOptions["{{NotificationOptions/body}}"] to notificationInput["`body`"].

    @@ -429,28 +528,70 @@

  • - If notificationInput["`tag`"] [=map/exists=] and - notificationInput["`tag`"] is a string, then set + If notificationInput["`tag`"] [=map/exists=] and is a string, then set notificationOptions["{{NotificationOptions/tag}}"] to notificationInput["`tag`"].

  • - If notificationInput["`icon`"] [=map/exists=] and - notificationInput["`icon`"] is a string, then set + If notificationInput["`image`"] [=map/exists=] and is a string, then set + notificationOptions["{{NotificationOptions/image}}"] to + notificationInput["`image`"], [=string/converted=]. +

    +
  • +
  • +

    + If notificationInput["`icon`"] [=map/exists=] and is a string, then set notificationOptions["{{NotificationOptions/icon}}"] to notificationInput["`icon`"], [=string/converted=].

  • - If notificationInput["`silent`"] [=map/exists=] and - notificationInput["`silent`"] is a boolean, then set - notificationOptions["{{NotificationOptions/silent}}"] to + If notificationInput["`badge`"] [=map/exists=] and is a string, then set + notificationOptions["{{NotificationOptions/badge}}"] to + notificationInput["`badge`"], [=string/converted=]. +

    +
  • +
  • +

    + If notificationInput["`vibrate`"] [=map/exists=] and is a [=/list=] of + which each [=list/item=] is a [=32-bit unsigned integer=], then set + notificationOptions["{{NotificationOptions/vibrate}}"] to + notificationInput["`vibrate`"]. +

    +
  • +
  • +

    + If notificationInput["`timestamp`"] [=map/exists=] and is a [=64-bit + unsigned integer=], then set + notificationOptions["{{NotificationOptions/timestamp}}"] to + notificationInput["`timestamp`"]. +

    +
  • +
  • +

    + If notificationInput["`renotify`"] [=map/exists=] and is a boolean, then + set notificationOptions["{{NotificationOptions/renotify}}"] to + notificationInput["`renotify`"]. +

    +
  • +
  • +

    + If notificationInput["`silent`"] [=map/exists=] and is a boolean, then + set notificationOptions["{{NotificationOptions/silent}}"] to notificationInput["`silent`"].

  • +
  • +

    + If notificationInput["`require_interaction`"] [=map/exists=] and is a + boolean, then set + notificationOptions["{{NotificationOptions/requireInteraction}}"] to + notificationInput["`require_interaction`"]. +

    +
  • If notificationInput["`data`"] [=map/exists=], then set @@ -459,6 +600,79 @@

    notificationInput["`data`"].

  • +
  • +

    + If notificationInput["`actions`"] [=map/exists=] and is a [=/list=]: +

    +
      +
    1. +

      + Let notificationActions be « ». +

      +
    2. +
    3. +

      + [=list/For each=] actionInput of + notificationInput["`actions`"]: +

      +
        +
      1. +

        + If actionInput["`action`"] does not [=map/exist=] or is not a + string, then [=iteration/continue=]. +

        +
      2. +
      3. +

        + If actionInput["`title`"] does not [=map/exist=] or is not a + string, then [=iteration/continue=]. +

        +
      4. +
      5. +

        + If actionInput["`navigate`"] does not [=map/exist=] or is not a + string, then [=iteration/continue=]. +

        +
      6. + +
      7. +

        + Let actionNavigate be actionInput["`navigate`"], + [=string/converted=]. +

        +
      8. +
      9. +

        + Let notificationAction be the {{NotificationAction}} dictionary + «[ "{{NotificationAction/action}}" → actionInput["`action`"], + "{{NotificationAction/title}}" → actionInput["`title`"], + "{{NotificationAction/navigate}}" → actionNavigate ]». +

        +
      10. + +
      11. +

        + If actionInput["`icon`"] [=map/exists=] and is a string, then + set notificationAction["{{NotificationAction/icon}}"] to + actionInput["`icon`"], [=string/converted=]. +

        +
      12. +
      13. +

        + [=list/Append=] notificationAction to + notificationActions. +

        +
      14. +
      +
    4. +
    5. +

      + Set notificationOptions["{{NotificationOptions/actions}}"] to + notificationActions. +

      +
    6. +
    +
  • Let notification be the result of failure.

  • +
  • +

    + If the [=action/navigation URL=] of any [=/action=] of notification's + [=notification/actions=] is null, then return failure. +

    +
  • Let appBadge be null. @@ -482,9 +702,8 @@

  • If message["`app_badge`"] [=map/exists=] and - message["`app_badge`"] is an integer in the range 0 to - 18446744073709551615 (264 − 1), inclusive, then set appBadge - to message["`app_badge`"]. + message["`app_badge`"] is a [=64-bit unsigned integer=], then set + appBadge to message["`app_badge`"].