From e0c3afc4f23a3842f9b611bd1b6511f68d89dd18 Mon Sep 17 00:00:00 2001 From: Daniel Huigens Date: Tue, 20 Jun 2023 19:21:38 +0200 Subject: [PATCH 1/2] Refer to relevant realm instead of relevant global object Also, link out to WebIDL's `this` definition instead of referencing it explicitly. And finally, note that objects are created in the relevant realm of `this` by default, rather than mentioning it everywhere. --- spec/Overview.html | 253 +++++++++++---------------------------------- 1 file changed, 60 insertions(+), 193 deletions(-) diff --git a/spec/Overview.html b/spec/Overview.html index 5a8000b..a94ada5 100644 --- a/spec/Overview.html +++ b/spec/Overview.html @@ -1328,8 +1328,7 @@

Data Types

Methods and Parameters

Unless otherwise stated, objects created by the methods defined in this section shall be associated with the - [= relevant global object =] - of `this` [[HTML]]. + [= relevant realm =] of [= this =].

@@ -2062,9 +2061,6 @@

The deriveBits method

  • Let |result| be a new {{ArrayBuffer}} - associated with the - [= relevant global object =] - of `this` [[HTML]], and containing the result of performing the derive bits operation specified by |normalizedAlgorithm| using |baseKey|, |algorithm| and |length|. @@ -2724,8 +2720,7 @@

    Exceptions

    this results in termination of execution of the sub-algorithm and all ancestor algorithms until one is reached that explicitly describes procedures for catching exceptions. The error object thrown shall be associated with the - [= relevant global object =] - of `this` [[HTML]]. + [= relevant realm =] of [= this =].

    @@ -2901,6 +2896,10 @@

    Specification Conventions

    [= define an algorithm =] steps for each of the supported operations, registering their IDL parameter type as indicated.

    +

    + Unless otherwise stated, objects created by the operations defined in this specification + shall be associated with the [= relevant realm =] of [= this =]. +

    @@ -3665,10 +3664,7 @@

    Operations

  • - Return a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and containing the - bytes of |signature|. + Return a new {{ArrayBuffer}} containing |signature|.

  • @@ -3777,9 +3773,7 @@

    Operations

  • Let |publicKey| be a new {{CryptoKey}} - object, associated with the - [= relevant global object =] - of `this` [[HTML]], and representing the public key of the generated key pair. + representing the public key of the generated key pair.

  • @@ -3809,9 +3803,7 @@

    Operations

  • - Let |privateKey| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |privateKey| be a new {{CryptoKey}} representing the private key of the generated key pair.

  • @@ -3929,9 +3921,7 @@

    Operations

  • - Let |key| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |key| be a new {{CryptoKey}} that represents the RSA public key identified by |publicKey|.

    @@ -3999,9 +3989,7 @@

    Operations

  • - Let |key| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |key| be a new {{CryptoKey}} that represents the RSA private key identified by |rsaPrivateKey|.

    @@ -4377,10 +4365,7 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and containing - |data|. + Let |result| be a new {{ArrayBuffer}} containing |data|.

  • @@ -4445,10 +4430,7 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and containing - |data|. + Let |result| be a new {{ArrayBuffer}} containing |data|.

  • @@ -4715,10 +4697,7 @@

    Operations

  • - Return a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and containing the - bytes of |signature|. + Return a new {{ArrayBuffer}} containing |signature|.

  • @@ -4826,9 +4805,7 @@

    Operations

  • - Let |publicKey| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |publicKey| be a new {{CryptoKey}} representing the public key of the generated key pair.

  • @@ -4859,9 +4836,7 @@

    Operations

  • - Let |privateKey| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |privateKey| be a new {{CryptoKey}} representing the private key of the generated key pair.

  • @@ -4980,9 +4955,7 @@

    Operations

  • - Let |key| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |key| be a new {{CryptoKey}} that represents the RSA public key identified by |publicKey|.

    @@ -5048,9 +5021,7 @@

    Operations

  • - Let |key| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |key| be a new {{CryptoKey}} that represents the RSA private key identified by |rsaPrivateKey|.

    @@ -5418,10 +5389,7 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and containing - |data|. + Let |result| be a new {{ArrayBuffer}} containing |data|.

  • @@ -5486,10 +5454,7 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and containing - |data|. + Let |result| be a new {{ArrayBuffer}} containing |data|.

  • @@ -5759,10 +5724,7 @@

    Operations

  • - Return a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and - containing |ciphertext|. + Return a new {{ArrayBuffer}} containing |ciphertext|.

  • @@ -5813,10 +5775,7 @@

    Operations

  • - Return a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and - containing |plaintext|. + Return a new {{ArrayBuffer}} containing |plaintext|.

  • @@ -5890,9 +5849,7 @@

    Operations

  • - Let |publicKey| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |publicKey| be a new {{CryptoKey}} representing the public key of the generated key pair.

  • @@ -5924,9 +5881,7 @@

    Operations

  • - Let |privateKey| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |privateKey| be a new {{CryptoKey}} representing the private key of the generated key pair.

  • @@ -6047,9 +6002,7 @@

    Operations

  • - Let |key| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |key| be a new {{CryptoKey}} that represents the RSA public key identified by |publicKey|.

    @@ -6115,9 +6068,7 @@

    Operations

  • - Let |key| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |key| be a new {{CryptoKey}} that represents the RSA private key identified by |rsaPrivateKey|.

    @@ -6465,10 +6416,7 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and containing - |data|. + Let |result| be a new {{ArrayBuffer}} containing |data|.

  • @@ -6533,10 +6481,7 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and containing - |data|. + Let |result| be a new {{ArrayBuffer}} containing |data|.

  • @@ -6882,9 +6827,7 @@

    Operations

  • - Let |result| be a new empty {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]]. + Let |result| be a new empty {{ArrayBuffer}}.

  • @@ -6925,10 +6868,7 @@

    Operations

  • - Return a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and containing the - bytes of |result|. + Return a new {{ArrayBuffer}} containing |result|.

  • @@ -7088,9 +7028,7 @@

    Operations

  • - Let |publicKey| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |publicKey| be a new {{CryptoKey}} representing the public key of the generated key pair.

  • @@ -7121,9 +7059,7 @@

    Operations

  • - Let |privateKey| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |privateKey| be a new {{CryptoKey}} representing the private key of the generated key pair.

  • @@ -7313,9 +7249,7 @@

    Operations

  • - Let |key| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |key| be a new {{CryptoKey}} that represents |publicKey|.

  • @@ -7519,9 +7453,7 @@

    Operations

  • - Let |key| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |key| be a new {{CryptoKey}} that represents the Elliptic Curve private key identified by performing the conversion steps defined in Section 3 of [[RFC5915]] using |ecPrivateKey|.

    @@ -7884,10 +7816,8 @@

    Operations

  • - Let |key| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and - that represents |Q| + Let |key| be a new {{CryptoKey}} + that represents |Q|.

  • @@ -8110,10 +8040,7 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and containing - |data|. + Let |result| be a new {{ArrayBuffer}} containing |data|.

  • @@ -8268,10 +8195,7 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and containing - |data|. + Let |result| be a new {{ArrayBuffer}} containing |data|.

  • @@ -8447,10 +8371,7 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and containing - |data|. + Let |result| be a new {{ArrayBuffer}} containing |data|.

  • @@ -8621,9 +8542,7 @@

    Operations

  • - Let |publicKey| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |publicKey| be a new {{CryptoKey}} representing the public key of the generated key pair.

  • @@ -8653,9 +8572,7 @@

    Operations

  • - Let |privateKey| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |privateKey| be a new {{CryptoKey}} representing the private key of the generated key pair.

  • @@ -8965,9 +8882,7 @@

    Operations

  • - Let |key| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |key| be a new {{CryptoKey}} that represents |publicKey|.

  • @@ -9174,9 +9089,7 @@

    Operations

  • - Let |key| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |key| be a new {{CryptoKey}} that represents the Elliptic Curve private key identified by performing the conversion steps defined in Section 3 of [[RFC5915]] using |ecPrivateKey|.

    @@ -9491,9 +9404,7 @@

    Operations

  • - Let |key| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |key| be a new {{CryptoKey}} that represents |Q|.

  • @@ -10033,10 +9944,7 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and containing - |data|. + Let |result| be a new {{ArrayBuffer}} containing |data|.

  • @@ -10195,10 +10103,7 @@

    Operations

  • - Return a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and - containing |ciphertext|. + Return a new {{ArrayBuffer}} containing |ciphertext|.

  • @@ -10238,10 +10143,7 @@

    Operations

  • - Return a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and - containing |plaintext|. + Return a new {{ArrayBuffer}} containing |plaintext|.

  • @@ -10515,10 +10417,7 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and containing - |data|. + Let |result| be a new {{ArrayBuffer}} containing |data|.

  • @@ -10729,10 +10628,7 @@

    Operations

  • - Return a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and - containing |ciphertext|. + Return a new {{ArrayBuffer}} containing |ciphertext|.

  • @@ -10778,10 +10674,7 @@

    Operations

  • - Return a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and - containing |plaintext|. + Return a new {{ArrayBuffer}} containing |plaintext|.

  • @@ -11056,10 +10949,7 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and containing - |data|. + Let |result| be a new {{ArrayBuffer}} containing |data|.

  • @@ -11309,10 +11199,7 @@

    Operations

  • - Return a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and - containing |ciphertext|. + Return a new {{ArrayBuffer}} containing |ciphertext|.

  • @@ -11407,10 +11294,7 @@

    Operations

  • - Return a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and - containing |plaintext|. + Return a new {{ArrayBuffer}} containing |plaintext|.

  • @@ -11685,10 +11569,7 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and containing - |data|. + Let |result| be a new {{ArrayBuffer}} containing |data|.

  • @@ -12106,9 +11987,7 @@

    Operations

  • - Let |key| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |key| be a new {{CryptoKey}} representing an AES key with value |data|.

  • @@ -12165,10 +12044,7 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and containing - |data|. + Let |result| be a new {{ArrayBuffer}} containing |data|.

  • @@ -12384,10 +12260,7 @@

    Operations

  • - Return a new {{ArrayBuffer}} object, associated with the - [= relevant global object =] - of `this` [[HTML]], and containing the - bytes of |mac|. + Return a new {{ArrayBuffer}} containing |mac|.

  • @@ -12818,9 +12691,7 @@

    Operations

    1. - Let |result| be a new {{ArrayBuffer}} associated with the - [= relevant global object =] - of `this` [[HTML]], and containing |data|. + Let |result| be a new {{ArrayBuffer}} containing |data|.

    @@ -13253,9 +13124,7 @@

    Operations

  • - Let |key| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |key| be a new {{CryptoKey}} representing the key data provided in |keyData|.

  • @@ -13456,9 +13325,7 @@

    Operations

  • - Let |key| be a new {{CryptoKey}} associated with the - [= relevant global object =] - of `this` [[HTML]], and + Let |key| be a new {{CryptoKey}} representing |keyData|.

  • From 46aefca760738d9f4193be72e265ea29685165d7 Mon Sep 17 00:00:00 2001 From: Daniel Huigens Date: Tue, 20 Jun 2023 22:14:20 +0200 Subject: [PATCH 2/2] Refer to the "create an ArrayBuffer" algorithm of WebIDL --- spec/Overview.html | 87 ++++++++++++++++++++++++++++++---------------- 1 file changed, 57 insertions(+), 30 deletions(-) diff --git a/spec/Overview.html b/spec/Overview.html index a94ada5..ce1a1ce 100644 --- a/spec/Overview.html +++ b/spec/Overview.html @@ -2060,7 +2060,7 @@

    The deriveBits method

  • - Let |result| be a new {{ArrayBuffer}} + Let |result| be the result of [= ArrayBuffer/create | creating =] an {{ArrayBuffer}} containing the result of performing the derive bits operation specified by |normalizedAlgorithm| using |baseKey|, |algorithm| and |length|. @@ -2422,7 +2422,7 @@

    The wrapKey method

  • - Let |bytes| be the byte sequence the results from converting + Let |bytes| be the [= byte sequence =] containing the result of converting |json|, a JavaScript String comprised of UTF-16 code points, to UTF-8 code points.

    @@ -3664,7 +3664,8 @@

    Operations

  • - Return a new {{ArrayBuffer}} containing |signature|. + Return the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |signature|.

  • @@ -4365,7 +4366,8 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} containing |data|. + Let |result| be the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |data|.

  • @@ -4430,7 +4432,8 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} containing |data|. + Let |result| be the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |data|.

  • @@ -4697,7 +4700,8 @@

    Operations

  • - Return a new {{ArrayBuffer}} containing |signature|. + Return the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |signature|.

  • @@ -5389,7 +5393,8 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} containing |data|. + Let |result| be the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |data|.

  • @@ -5454,7 +5459,8 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} containing |data|. + Let |result| be the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |data|.

  • @@ -5724,7 +5730,8 @@

    Operations

  • - Return a new {{ArrayBuffer}} containing |ciphertext|. + Return the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |ciphertext|.

  • @@ -5775,7 +5782,8 @@

    Operations

  • - Return a new {{ArrayBuffer}} containing |plaintext|. + Return the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |plaintext|.

  • @@ -6416,7 +6424,8 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} containing |data|. + Let |result| be the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |data|.

  • @@ -6481,7 +6490,8 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} containing |data|. + Let |result| be the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |data|.

  • @@ -6827,7 +6837,7 @@

    Operations

  • - Let |result| be a new empty {{ArrayBuffer}}. + Let |result| be an empty [= byte sequence =].

  • @@ -6868,7 +6878,8 @@

    Operations

  • - Return a new {{ArrayBuffer}} containing |result|. + Return the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |result|.

  • @@ -8040,7 +8051,8 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} containing |data|. + Let |result| be the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |data|.

  • @@ -8195,7 +8207,8 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} containing |data|. + Let |result| be the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |data|.

  • @@ -8371,7 +8384,8 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} containing |data|. + Let |result| be the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |data|.

  • @@ -9944,7 +9958,8 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} containing |data|. + Let |result| be the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |data|.

  • @@ -10103,7 +10118,8 @@

    Operations

  • - Return a new {{ArrayBuffer}} containing |ciphertext|. + Return the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |ciphertext|.

  • @@ -10143,7 +10159,8 @@

    Operations

  • - Return a new {{ArrayBuffer}} containing |plaintext|. + Return the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |plaintext|.

  • @@ -10417,7 +10434,8 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} containing |data|. + Let |result| be the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |data|.

  • @@ -10628,7 +10646,8 @@

    Operations

  • - Return a new {{ArrayBuffer}} containing |ciphertext|. + Return the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |ciphertext|.

  • @@ -10674,7 +10693,8 @@

    Operations

  • - Return a new {{ArrayBuffer}} containing |plaintext|. + Return the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |plaintext|.

  • @@ -10949,7 +10969,8 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} containing |data|. + Let |result| be the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |data|.

  • @@ -11199,7 +11220,8 @@

    Operations

  • - Return a new {{ArrayBuffer}} containing |ciphertext|. + Return the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |ciphertext|.

  • @@ -11294,7 +11316,8 @@

    Operations

  • - Return a new {{ArrayBuffer}} containing |plaintext|. + Return the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |plaintext|.

  • @@ -11569,7 +11592,8 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} containing |data|. + Let |result| be the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |data|.

  • @@ -12044,7 +12068,8 @@

    Operations

  • - Let |result| be a new {{ArrayBuffer}} containing |data|. + Let |result| be the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |data|.

  • @@ -12260,7 +12285,8 @@

    Operations

  • - Return a new {{ArrayBuffer}} containing |mac|. + Return the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |mac|.

  • @@ -12691,7 +12717,8 @@

    Operations

    1. - Let |result| be a new {{ArrayBuffer}} containing |data|. + Let |result| be the result of [= ArrayBuffer/create | creating =] + an {{ArrayBuffer}} containing |data|.