From f055705c734eb6ba4991db2fd6c366cfbc961447 Mon Sep 17 00:00:00 2001 From: Reilly Grant Date: Mon, 30 Sep 2019 12:25:18 -0700 Subject: [PATCH] Migrate to references exported from the WebIDL spec Algorithms for working with Promises have moved from [promises-guide] to [WebIDL]. This change also creates an anchor for the "initializing the Document object" algorithm in the HTML specification. This may not be the right way of extending this algorithm with additional steps. --- index.bs | 41 +++++++++++++++++++++-------------------- scanning.bs | 2 +- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/index.bs b/index.bs index ccb069c..66887f0 100644 --- a/index.bs +++ b/index.bs @@ -105,6 +105,10 @@ spec: fingerprinting-guidance; urlPrefix: https://w3c.github.io/fingerprinting-g type: dfn text: fingerprinting surface; url: dfn-fingerprinting-surface +spec: html; urlPrefix: https://html.spec.whatwg.org/# + type: dfn + text: initializing the Document object; url: initialise-the-document-object + spec: WebIDL; urlPrefix: https://heycam.github.io/webidl/# type: dfn text: a copy of the bytes held; url: dfn-get-buffer-source-copy @@ -121,7 +125,7 @@ spec: html type: dfn text: browsing context; for: / text: global object; for: / -spec: promises-guide-1 +spec: webidl type: dfn text: resolve @@ -1073,7 +1077,7 @@ spec: promises-guide-1 `null` - Set to a {{BluetoothDevice}} while initializing a new `Document` object + Set to a {{BluetoothDevice}} while initializing the `Document` object if the `Document` was opened from the device. @@ -1096,7 +1100,7 @@ spec: promises-guide-1 advertises a URL, the UA may allow the user to navigate to this URL. - If this happens, then as part of initializing a new `Document` object, + If this happens, then as part of initializing the `Document` object, the UA MUST run the following steps:

    @@ -3114,15 +3118,15 @@ spec: promises-guide-1 Let promise be the result.
  1. - Return the result of - transforming promise with a fulfillment handler that: + Upon fulfillment of promise with |result|, run the + following steps:
      -
    • If its argument is empty, throws a {{NotFoundError}},
    • +
    • If |result| is empty, throw a {{NotFoundError}},
    • Otherwise, if the single flag is set, - returns the first (only) element of its argument. + returns the first (only) element of |result|.
    • -
    • Otherwise, returns its argument.
    • +
    • Otherwise, return |result|.
@@ -3430,16 +3434,14 @@ spec: promises-guide-1 gattServer.{{BluetoothRemoteGATTServer/[[activeAlgorithms]]}}.
  • - Return the result of transforming promise - with fulfillment and rejection handlers that perform the following steps: -
    -
    fulfillment handler
    -
    + React to promise: +
      +
    • If |promise| was fulfilled with value |result|, then:
      1. If promise is in gattServer.{{BluetoothRemoteGATTServer/[[activeAlgorithms]]}}, - remove it and return the first argument. + remove it and return |result|.
      2. Otherwise, throw a {{NetworkError}}. @@ -3449,14 +3451,13 @@ spec: promises-guide-1
      -
    -
    rejection handler
    -
    +
  • +
  • If |promise| was rejected with reason |error|, then:
    1. If promise is in gattServer.{{BluetoothRemoteGATTServer/[[activeAlgorithms]]}}, - remove it and throw the first argument. + remove it and throw |error|.
    2. Otherwise, throw a {{NetworkError}}. @@ -3466,8 +3467,8 @@ spec: promises-guide-1
    - - +
  • + diff --git a/scanning.bs b/scanning.bs index 511fce7..36c3ffd 100644 --- a/scanning.bs +++ b/scanning.bs @@ -51,7 +51,7 @@ spec: web-bluetooth; urlPrefix: index.html# text: BluetoothDevice