- From: Ms2ger <notifications@github.com>
- Date: Thu, 14 Mar 2024 03:42:13 -0700
- To: whatwg/webidl <webidl@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/webidl/pull/1392/review/1936295715@github.com>
@Ms2ger commented on this pull request.
> @@ -10259,6 +10261,36 @@ that does specify [{{SecureContext}}].
</pre>
</div>
+<h4 id="StringContext" extended-attribute lt="StringContext">[StringContext]</h4>
+
+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 "<code>TrustedHTML</code>", "<code>TrustedScript</code>", and "<code>TrustedScriptURL</code>".
+
+[{{StringContext}}] extended attribute may only annotate a type of a [=regular attribute=] or
```suggestion
The [{{StringContext}}] extended attribute may only annotate a type of a [=regular attribute=] or
```
> @@ -11292,8 +11347,16 @@ Note: The HTML Standard defines how a security check 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 performing
+ [=validate the string in context=], passing [=this=], |V|, the {{StringContext}}
+ extended attribute [=identifier=], and the [=identifier=]
+ of |callable|.
+
+ Note: That algorithm may [=JavaScript/throw=] a <l spec=ecmascript>{{TypeError}}</l>.
```suggestion
Note: That algorithm can [=JavaScript/throw=] a <l spec=ecmascript>{{TypeError}}</l>.
```
> @@ -11982,8 +12045,14 @@ in which case they are exposed on every object that [=implements=] the interface
<dt>Otherwise</dt>
<dd>
- |idlValue| is the result of [=converted to an IDL value|converting=] |V| to an
- IDL value of |attribute|'s type.
+ 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 |id|.
+
+ Note: That algorithm may [=JavaScript/throw=] a <l spec=ecmascript>{{TypeError}}</l>.
```suggestion
Note: That algorithm can [=JavaScript/throw=] a <l spec=ecmascript>{{TypeError}}</l>.
```
> @@ -11092,8 +11139,16 @@ Note: The HTML Standard defines how a security check 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 performing
+ [=validate the string in context=], passing [=this=], |V|, the {{StringContext}}
+ 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 <l spec=ecmascript>{{TypeError}}</l>.
```suggestion
Note: That algorithm can [=JavaScript/throw=] a <l spec=ecmascript>{{TypeError}}</l>.
```
--
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/pull/1392#pullrequestreview-1936295715
You are receiving this because you are subscribed to this thread.
Message ID: <whatwg/webidl/pull/1392/review/1936295715@github.com>
Received on Thursday, 14 March 2024 10:42:17 UTC