From f9fbdc22f633f21011f9f3e1d674c01a0aa86bd6 Mon Sep 17 00:00:00 2001 From: Krzysztof Kotowicz Date: Mon, 10 Feb 2020 18:10:55 +0100 Subject: [PATCH 01/13] Added a definition of {{StringContext}} extended attribute for (DOM|USV)String. This is to hook up the Trusted Types validation during the ES->IDL type conversion to avoid funky issues with its default policy. See https://github.com/w3c/webappsec-trusted-types/issues/248, https://github.com/w3c/webappsec-trusted-types/issues/176 --- index.bs | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index 921b2ead..2e992a86 100644 --- a/index.bs +++ b/index.bs @@ -6353,8 +6353,10 @@ The following extended attributes are applicable [{{AllowResizable}}], [{{AllowShared}}], [{{Clamp}}], -[{{EnforceRange}}], and -[{{LegacyNullToEmptyString}}]. +[{{EnforceRange}}], +[{{LegacyNullToEmptyString}}] and +[{{StringContext}}]. +
The extended attributes associated with @@ -7581,6 +7583,13 @@ value when its bit pattern is interpreted as an unsigned 64-bit integer. A JavaScript value |V| is [=converted to an IDL value|converted=] to an IDL {{DOMString}} value by running the following algorithm: + 1. If the conversion is to an IDL type [=extended attribute associated with|associated with=] the + [{{StringContext}}] extended attribute, then set |V| to the result of [=validate the string in context=], passing + [=this=], |V|, the {{StringContext}} extended attribute [=identifier=], and the [=identifier=] + of the [{{StringContext}}] extended attribute [=related construct=]. + + Note: That algorithm may [=ECMAScript/throw=] a {{ECMAScript/TypeError}}. + 1. If |V| is null and the conversion is to an IDL type [=extended attribute associated with|associated with=] the [{{LegacyNullToEmptyString}}] extended attribute, then return the {{DOMString}} value that represents the empty string. @@ -10259,6 +10268,40 @@ that does specify [{{SecureContext}}].
+

[StringContext]

+ +If the [{{StringContext}}] [=extended attribute=] appears on {{DOMString}} or {{USVString}}, it +modifies how the value is converted to the IDL type, causing additional value validation to +adhere to the context the string is used in. + +The [{{StringContext}}] extended attribute must [=takes an identifier|take an identifier=]. The [=identifier=] +must be one of "html", "script-url" and "script". + +A type annotated with the [{{StringContext}}] extended attribute must not appear in a construct +that is not a [=regular attribute=] or a [=regular operation=]. A type annotated with the [{{StringContext}}] +extended attribute must not appear in a [=read only=] attribute. The construct that the type annotated with +the [{{StringContext}}] extended attribute appears in is its related construct. + +A type that is not {{DOMString}} or {{USVString}} must not be [=extended attributes associated with|associated with=] +the [{{StringContext}}] extended attribute. + +See the rules for converting ECMAScript values to the IDL types in [[#es-DOMString]] and [[#es-USVString]] +for the specific requirements that the use of [{{StringContext}}] entails. + +
+ + In the following [=IDL fragment=], + a [=variadic=] [=operation=] is declared + that uses the [{{StringContext}}] [=extended attribute=] + on all its arguments: + +
+        interface Document {
+          void write([StringContext=html] DOMString... text);
+        };
+    
+
+

[Unscopable]

@@ -11056,6 +11099,21 @@ allowed. The security check takes the following three inputs: Note: The HTML Standard defines how a security check is performed. [[!HTML]] +Certain algorithms in [[#es-type-mapping]] are defined to +validate the string in context on a given +value. This check is used to determine whether a given value +is appropriate for its {{StringContext}}. This validation takes the following four inputs: + +1. the [=platform object=] on + which the operation invocation or attribute access is being done, +1. the value to validate, +1. the {{StringContext}} [=identifier=], and +1. the [=identifier=] of the operation or attribute. + +The algorithm returns an ECMAScript String value, or [=ECMAScript/throws=] a {{ECMAScript/TypeError}}. + +Note: The HTML Standard defines how the validation is performed. [[!HTML]] +

Overload resolution algorithm

From bf5bea13ad84448df169d921a278494ee2b07c33 Mon Sep 17 00:00:00 2001 From: Krzysztof Kotowicz Date: Fri, 14 Feb 2020 13:24:51 +0100 Subject: [PATCH 02/13] Mentioned that {{StringContext}} may apply only to regular operation and regular argument types explicitly. --- index.bs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/index.bs b/index.bs index 2e992a86..edaef68b 100644 --- a/index.bs +++ b/index.bs @@ -10277,10 +10277,11 @@ adhere to the context the string is used in. The [{{StringContext}}] extended attribute must [=takes an identifier|take an identifier=]. The [=identifier=] must be one of "html", "script-url" and "script". -A type annotated with the [{{StringContext}}] extended attribute must not appear in a construct -that is not a [=regular attribute=] or a [=regular operation=]. A type annotated with the [{{StringContext}}] -extended attribute must not appear in a [=read only=] attribute. The construct that the type annotated with -the [{{StringContext}}] extended attribute appears in is its related construct. +[{{StringContext}}] extended attribute may only annotate a type of a [=regular attribute=] or +a [=regular operation=] argument. A type annotated with the [{{StringContext}}] +extended attribute must not appear in a [=read only=] attribute. The [=regular attribute=] or +a [=regular operation=] argument that the type annotated with the [{{StringContext}}] extended +attribute appears in is its related construct. A type that is not {{DOMString}} or {{USVString}} must not be [=extended attributes associated with|associated with=] the [{{StringContext}}] extended attribute. From c31e59ce9010dfade4ea733f75c204611fee9917 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Mon, 11 Mar 2024 18:14:17 +0000 Subject: [PATCH 03/13] Fix reference errors --- index.bs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.bs b/index.bs index edaef68b..2a132a95 100644 --- a/index.bs +++ b/index.bs @@ -7588,7 +7588,7 @@ value when its bit pattern is interpreted as an unsigned 64-bit integer. [=this=], |V|, the {{StringContext}} extended attribute [=identifier=], and the [=identifier=] of the [{{StringContext}}] extended attribute [=related construct=]. - Note: That algorithm may [=ECMAScript/throw=] a {{ECMAScript/TypeError}}. + Note: That algorithm may [=JavaScript/throw=] a {{TypeError}}. 1. If |V| is null and the conversion is to an IDL type [=extended attribute associated with|associated with=] the [{{LegacyNullToEmptyString}}] extended @@ -10286,10 +10286,10 @@ attribute appears in is its related construct. A type that is not {{DOMString}} or {{USVString}} must not be [=extended attributes associated with|associated with=] the [{{StringContext}}] extended attribute. -See the rules for converting ECMAScript values to the IDL types in [[#es-DOMString]] and [[#es-USVString]] +See the rules for converting ECMAScript values to the IDL types in [[#js-DOMString]] and [[#js-USVString]] for the specific requirements that the use of [{{StringContext}}] entails. -
+
In the following [=IDL fragment=], a [=variadic=] [=operation=] is declared @@ -11100,7 +11100,7 @@ allowed. The security check takes the following three inputs: Note: The HTML Standard defines how a security check is performed. [[!HTML]] -Certain algorithms in [[#es-type-mapping]] are defined to +Certain algorithms in [[#js-type-mapping]] are defined to validate the string in context on a given value. This check is used to determine whether a given value is appropriate for its {{StringContext}}. This validation takes the following four inputs: @@ -11111,7 +11111,7 @@ is appropriate for its {{StringContext}}. This validation takes the following fo 1. the {{StringContext}} [=identifier=], and 1. the [=identifier=] of the operation or attribute. -The algorithm returns an ECMAScript String value, or [=ECMAScript/throws=] a {{ECMAScript/TypeError}}. +The algorithm returns an ECMAScript String value, or [=JavaScript/throws=] a {{TypeError}}. Note: The HTML Standard defines how the validation is performed. [[!HTML]] From 550b96741db79d969637c63bac606d8b53e5bb77 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Tue, 12 Mar 2024 11:53:40 +0000 Subject: [PATCH 04/13] Copy String context handling to attribute setter steps. --- index.bs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/index.bs b/index.bs index 2a132a95..16747660 100644 --- a/index.bs +++ b/index.bs @@ -6354,7 +6354,7 @@ The following extended attributes are applicable [{{AllowShared}}], [{{Clamp}}], [{{EnforceRange}}], -[{{LegacyNullToEmptyString}}] and +[{{LegacyNullToEmptyString}}], and [{{StringContext}}]. @@ -10280,7 +10280,7 @@ must be one of "html", "script-url" and "script< [{{StringContext}}] extended attribute may only annotate a type of a [=regular attribute=] or a [=regular operation=] argument. A type annotated with the [{{StringContext}}] extended attribute must not appear in a [=read only=] attribute. The [=regular attribute=] or -a [=regular operation=] argument that the type annotated with the [{{StringContext}}] extended +[=regular operation=] argument that the type annotated with the [{{StringContext}}] extended attribute appears in is its related construct. A type that is not {{DOMString}} or {{USVString}} must not be [=extended attributes associated with|associated with=] @@ -12041,8 +12041,14 @@ in which case they are exposed on every object that [=implements=] the interface
Otherwise
- |idlValue| is the result of [=converted to an IDL value|converting=] |V| to an - IDL value of |attribute|'s type. + 1. If the conversion is to an IDL type [=extended attribute associated with|associated with=] the + [{{StringContext}}] extended attribute, then set |V| to the result of [=validate the string in context=], passing + [=this=], |V|, the {{StringContext}} extended attribute [=identifier=], and the [=identifier=] + of the [{{StringContext}}] extended attribute [=related construct=]. + + Note: That algorithm may [=JavaScript/throw=] a {{TypeError}}. + 1. |idlValue| is the result of [=converted to an IDL value|converting=] |V| to an + IDL value of |attribute|'s type.
From 331a76a330d151af05887005a165939659cbab85 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Tue, 12 Mar 2024 12:07:03 +0000 Subject: [PATCH 05/13] Copy String context handling to js overload resolution algorithm --- index.bs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/index.bs b/index.bs index 16747660..efd44854 100644 --- a/index.bs +++ b/index.bs @@ -11151,8 +11151,15 @@ Note: The HTML Standard defines how the validation is performed. [[!HTML]] 1. If the argument at index |i| is declared with a [=optional argument/default value=], then append to |values| that default value. 1. Otherwise, append to |values| the special value “missing”. - 1. Otherwise, append to |values| the result of [=converted to an IDL value|converting=] - |V| to IDL type |type|. + 1. Otherwise: + 1. If |type| is an IDL type [=extended attribute associated with|associated with=] the + [{{StringContext}}] extended attribute, then set |V| to the result of [=validate the string in context=], passing + [=this=], |V|, the {{StringContext}} extended attribute [=identifier=], and the [=identifier=] + of the [{{StringContext}}] extended attribute [=related construct=]. + + Note: That algorithm may [=JavaScript/throw=] a {{TypeError}}. + 1. Append to |values| the result of [=converted to an IDL value|converting=] + |V| to IDL type |type|. 1. Set |i| to |i| + 1. 1. If |i| = |d|, then: 1. Let |V| be |args|[|i|]. @@ -11351,8 +11358,15 @@ Note: The HTML Standard defines how the validation is performed. [[!HTML]] 1. If the argument at index |i| is declared with a [=optional argument/default value=], then append to |values| that default value. 1. Otherwise, append to |values| the special value “missing”. - 1. Otherwise, append to |values| the result of - [=converted to an IDL value|converting=] |V| to IDL type |type|. + 1. Otherwise: + 1. If |type| is an IDL type [=extended attribute associated with|associated with=] the + [{{StringContext}}] extended attribute, then set |V| to the result of [=validate the string in context=], passing + [=this=], |V|, the {{StringContext}} extended attribute [=identifier=], and the [=identifier=] + of the [{{StringContext}}] extended attribute [=related construct=]. + + Note: That algorithm may [=JavaScript/throw=] a {{TypeError}}. + 1. Append to |values| the result of [=converted to an IDL value|converting=] + |V| to IDL type |type|. 1. Set |i| to |i| + 1. 1. While |i| is less than the number of arguments |callable| is declared to take: 1. If |callable|'s argument at index |i| is declared with a [=optional argument/default value=], From 29b25b6bf7b89e1468a19b03453dc195e0dbbbec Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Tue, 12 Mar 2024 12:11:14 +0000 Subject: [PATCH 06/13] Fix attribute setter --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index efd44854..c6845541 100644 --- a/index.bs +++ b/index.bs @@ -12055,7 +12055,7 @@ in which case they are exposed on every object that [=implements=] the interface
Otherwise
- 1. If the conversion is to an IDL type [=extended attribute associated with|associated with=] the + 1. If |attribute|'s type is [=extended attribute associated with|associated with=] the [{{StringContext}}] extended attribute, then set |V| to the result of [=validate the string in context=], passing [=this=], |V|, the {{StringContext}} extended attribute [=identifier=], and the [=identifier=] of the [{{StringContext}}] extended attribute [=related construct=]. From 831c46192f0499dce92a35c17c4db090b4448afd Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Tue, 12 Mar 2024 12:18:03 +0000 Subject: [PATCH 07/13] Remove StringContext handling from DOMString conversion algorithm --- index.bs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/index.bs b/index.bs index c6845541..13f776da 100644 --- a/index.bs +++ b/index.bs @@ -7583,13 +7583,6 @@ value when its bit pattern is interpreted as an unsigned 64-bit integer. A JavaScript value |V| is [=converted to an IDL value|converted=] to an IDL {{DOMString}} value by running the following algorithm: - 1. If the conversion is to an IDL type [=extended attribute associated with|associated with=] the - [{{StringContext}}] extended attribute, then set |V| to the result of [=validate the string in context=], passing - [=this=], |V|, the {{StringContext}} extended attribute [=identifier=], and the [=identifier=] - of the [{{StringContext}}] extended attribute [=related construct=]. - - Note: That algorithm may [=JavaScript/throw=] a {{TypeError}}. - 1. If |V| is null and the conversion is to an IDL type [=extended attribute associated with|associated with=] the [{{LegacyNullToEmptyString}}] extended attribute, then return the {{DOMString}} value that represents the empty string. From 49a73616eb71edc019f4f95fcb54c172c54191ca Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Tue, 12 Mar 2024 12:33:22 +0000 Subject: [PATCH 08/13] Minor changes --- index.bs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/index.bs b/index.bs index 13f776da..ab0085e2 100644 --- a/index.bs +++ b/index.bs @@ -11093,7 +11093,7 @@ allowed. The security check takes the following three inputs: Note: The HTML Standard defines how a security check is performed. [[!HTML]] -Certain algorithms in [[#js-type-mapping]] are defined to +Certain algorithms are defined to validate the string in context on a given value. This check is used to determine whether a given value is appropriate for its {{StringContext}}. This validation takes the following four inputs: @@ -11104,7 +11104,7 @@ is appropriate for its {{StringContext}}. This validation takes the following fo 1. the {{StringContext}} [=identifier=], and 1. the [=identifier=] of the operation or attribute. -The algorithm returns an ECMAScript String value, or [=JavaScript/throws=] a {{TypeError}}. +The algorithm returns an ECMAScript value, or [=JavaScript/throws=] a {{TypeError}}. Note: The HTML Standard defines how the validation is performed. [[!HTML]] @@ -11146,8 +11146,9 @@ Note: The HTML Standard defines how the validation is performed. [[!HTML]] 1. Otherwise, append to |values| the special value “missing”. 1. Otherwise: 1. If |type| is an IDL type [=extended attribute associated with|associated with=] the - [{{StringContext}}] extended attribute, then set |V| to the result of [=validate the string in context=], passing - [=this=], |V|, the {{StringContext}} extended attribute [=identifier=], and the [=identifier=] + [{{StringContext}}] extended attribute, then set |V| to the result of performing + [=validate the string in context=], passing [=this=], |V|, the {{StringContext}} + extended attribute [=identifier=], and the [=identifier=] of the [{{StringContext}}] extended attribute [=related construct=]. Note: That algorithm may [=JavaScript/throw=] a {{TypeError}}. @@ -11353,8 +11354,9 @@ Note: The HTML Standard defines how the validation is performed. [[!HTML]] 1. Otherwise, append to |values| the special value “missing”. 1. Otherwise: 1. If |type| is an IDL type [=extended attribute associated with|associated with=] the - [{{StringContext}}] extended attribute, then set |V| to the result of [=validate the string in context=], passing - [=this=], |V|, the {{StringContext}} extended attribute [=identifier=], and the [=identifier=] + [{{StringContext}}] extended attribute, then set |V| to the result of performing + [=validate the string in context=], passing [=this=], |V|, the {{StringContext}} + extended attribute [=identifier=], and the [=identifier=] of the [{{StringContext}}] extended attribute [=related construct=]. Note: That algorithm may [=JavaScript/throw=] a {{TypeError}}. @@ -12049,8 +12051,9 @@ in which case they are exposed on every object that [=implements=] the interface
Otherwise
1. If |attribute|'s type is [=extended attribute associated with|associated with=] the - [{{StringContext}}] extended attribute, then set |V| to the result of [=validate the string in context=], passing - [=this=], |V|, the {{StringContext}} extended attribute [=identifier=], and the [=identifier=] + [{{StringContext}}] extended attribute, then set |V| to the result of performing + [=validate the string in context=], passing [=this=], |V|, the {{StringContext}} + extended attribute [=identifier=], and the [=identifier=] of the [{{StringContext}}] extended attribute [=related construct=]. Note: That algorithm may [=JavaScript/throw=] a {{TypeError}}. From 000abfeb7748cd6085770c77f400eb112b509444 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Tue, 12 Mar 2024 13:13:01 +0000 Subject: [PATCH 09/13] Change String context indentifiers --- index.bs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/index.bs b/index.bs index ab0085e2..a224235b 100644 --- a/index.bs +++ b/index.bs @@ -10268,7 +10268,7 @@ modifies how the value is converted to the IDL type, causing additional value va adhere to the context the string is used in. The [{{StringContext}}] extended attribute must [=takes an identifier|take an identifier=]. The [=identifier=] -must be one of "html", "script-url" and "script". +must be one of "TrustedHTML", "TrustedScript" and "TrustedScriptURL". [{{StringContext}}] extended attribute may only annotate a type of a [=regular attribute=] or a [=regular operation=] argument. A type annotated with the [{{StringContext}}] @@ -10279,9 +10279,6 @@ attribute appears in is its related construct. A type that is not {{DOMString}} or {{USVString}} must not be [=extended attributes associated with|associated with=] the [{{StringContext}}] extended attribute. -See the rules for converting ECMAScript values to the IDL types in [[#js-DOMString]] and [[#js-USVString]] -for the specific requirements that the use of [{{StringContext}}] entails. -
In the following [=IDL fragment=], @@ -10291,7 +10288,7 @@ for the specific requirements that the use of [{{StringContext}}] entails.
         interface Document {
-          void write([StringContext=html] DOMString... text);
+          void write([StringContext=TrustedHTML] DOMString... text);
         };
     
From 86a6e504a78c2f54d1befe64cc8b6a067c7af54c Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Tue, 12 Mar 2024 15:32:36 +0000 Subject: [PATCH 10/13] Remove related construct --- index.bs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/index.bs b/index.bs index a224235b..d0d98976 100644 --- a/index.bs +++ b/index.bs @@ -10272,9 +10272,7 @@ must be one of "TrustedHTML", "TrustedScript" and "related construct. +extended attribute must not appear in a [=read only=] attribute. A type that is not {{DOMString}} or {{USVString}} must not be [=extended attributes associated with|associated with=] the [{{StringContext}}] extended attribute. @@ -11146,7 +11144,7 @@ Note: The HTML Standard defines how the validation is performed. [[!HTML]] [{{StringContext}}] extended attribute, then set |V| to the result of performing [=validate the string in context=], passing [=this=], |V|, the {{StringContext}} extended attribute [=identifier=], and the [=identifier=] - of the [{{StringContext}}] extended attribute [=related construct=]. + of the [=operation=] or [=extended attribute=] of the first entry in |S|. Note: That algorithm may [=JavaScript/throw=] a {{TypeError}}. 1. Append to |values| the result of [=converted to an IDL value|converting=] @@ -11354,7 +11352,7 @@ Note: The HTML Standard defines how the validation is performed. [[!HTML]] [{{StringContext}}] extended attribute, then set |V| to the result of performing [=validate the string in context=], passing [=this=], |V|, the {{StringContext}} extended attribute [=identifier=], and the [=identifier=] - of the [{{StringContext}}] extended attribute [=related construct=]. + of |callable|. Note: That algorithm may [=JavaScript/throw=] a {{TypeError}}. 1. Append to |values| the result of [=converted to an IDL value|converting=] @@ -12050,8 +12048,7 @@ in which case they are exposed on every object that [=implements=] the interface 1. If |attribute|'s type is [=extended attribute associated with|associated with=] the [{{StringContext}}] extended attribute, then set |V| to the result of performing [=validate the string in context=], passing [=this=], |V|, the {{StringContext}} - extended attribute [=identifier=], and the [=identifier=] - of the [{{StringContext}}] extended attribute [=related construct=]. + extended attribute [=identifier=], and |id|. Note: That algorithm may [=JavaScript/throw=] a {{TypeError}}. 1. |idlValue| is the result of [=converted to an IDL value|converting=] |V| to an From 27d5b5eda1fc8812c96ecc99a14dc941c521eb55 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Wed, 13 Mar 2024 12:18:15 +0000 Subject: [PATCH 11/13] Add comma --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index d0d98976..92708341 100644 --- a/index.bs +++ b/index.bs @@ -10268,7 +10268,7 @@ modifies how the value is converted to the IDL type, causing additional value va adhere to the context the string is used in. The [{{StringContext}}] extended attribute must [=takes an identifier|take an identifier=]. The [=identifier=] -must be one of "TrustedHTML", "TrustedScript" and "TrustedScriptURL". +must be one of "TrustedHTML", "TrustedScript", and "TrustedScriptURL". [{{StringContext}}] extended attribute may only annotate a type of a [=regular attribute=] or a [=regular operation=] argument. A type annotated with the [{{StringContext}}] From 808cef7e7934c89932824c9ff93561ecb6bcd767 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Thu, 14 Mar 2024 12:50:18 +0000 Subject: [PATCH 12/13] Small fixups --- index.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.bs b/index.bs index 92708341..095ea8de 100644 --- a/index.bs +++ b/index.bs @@ -10270,7 +10270,7 @@ adhere to the context the string is used in. The [{{StringContext}}] extended attribute must [=takes an identifier|take an identifier=]. The [=identifier=] must be one of "TrustedHTML", "TrustedScript", and "TrustedScriptURL". -[{{StringContext}}] extended attribute may only annotate a type of a [=regular attribute=] or +The [{{StringContext}}] extended attribute may only annotate a type of a [=regular attribute=] or a [=regular operation=] argument. A type annotated with the [{{StringContext}}] extended attribute must not appear in a [=read only=] attribute. @@ -11146,7 +11146,7 @@ Note: The HTML Standard defines how the validation is performed. [[!HTML]] extended attribute [=identifier=], and the [=identifier=] of the [=operation=] or [=extended attribute=] of the first entry in |S|. - Note: That algorithm may [=JavaScript/throw=] a {{TypeError}}. + Note: That algorithm can [=JavaScript/throw=] a {{TypeError}}. 1. Append to |values| the result of [=converted to an IDL value|converting=] |V| to IDL type |type|. 1. Set |i| to |i| + 1. @@ -11354,7 +11354,7 @@ Note: The HTML Standard defines how the validation is performed. [[!HTML]] extended attribute [=identifier=], and the [=identifier=] of |callable|. - Note: That algorithm may [=JavaScript/throw=] a {{TypeError}}. + Note: That algorithm can [=JavaScript/throw=] a {{TypeError}}. 1. Append to |values| the result of [=converted to an IDL value|converting=] |V| to IDL type |type|. 1. Set |i| to |i| + 1. @@ -12050,7 +12050,7 @@ in which case they are exposed on every object that [=implements=] the interface [=validate the string in context=], passing [=this=], |V|, the {{StringContext}} extended attribute [=identifier=], and |id|. - Note: That algorithm may [=JavaScript/throw=] a {{TypeError}}. + Note: That algorithm can [=JavaScript/throw=] a {{TypeError}}. 1. |idlValue| is the result of [=converted to an IDL value|converting=] |V| to an IDL value of |attribute|'s type.
From 36ddffb69d620cc8d35107296c36d74c2b8ef6fc Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Thu, 14 Mar 2024 12:57:58 +0000 Subject: [PATCH 13/13] Add paragraph explaining that StringContext can't be used on only some overloads of an overloaded operation. --- index.bs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.bs b/index.bs index 095ea8de..e2f145b6 100644 --- a/index.bs +++ b/index.bs @@ -10277,6 +10277,9 @@ extended attribute must not appear in a [=read only=] attribute. A type that is not {{DOMString}} or {{USVString}} must not be [=extended attributes associated with|associated with=] the [{{StringContext}}] extended attribute. +The [{{StringContext}}] extended attribute must not be used on only some of the [=overloaded|overloads=] of an +[=overloaded=] [=operation=]. +
In the following [=IDL fragment=],