Skip to content

Commit d1b143b

Browse files
authored
Add dfn for [[Data]] internal slot (#478)
1 parent 2f7de8e commit d1b143b

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

spec/index.bs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -384,14 +384,14 @@ interface TrustedHTML {
384384
};
385385
</pre>
386386

387-
TrustedHTML objects have a `[[Data]]` internal slot which holds a
387+
TrustedHTML objects have a <dfn for="TrustedHTML">\[[Data]]</dfn> internal slot which holds a
388388
DOMString. The slot's value is set when the object is created, and
389389
will never change during its lifetime.
390390

391391
<dfn method for="TrustedHTML">toJSON()</dfn> method steps and the
392392
<dfn for="TrustedHTML">stringification behavior</dfn> steps of a
393393
TrustedHTML object are to return the value from its
394-
`[[Data]]` internal slot.
394+
[=TrustedHTML/[[Data]]=] internal slot.
395395

396396
### <dfn interface>TrustedScript</dfn> ### {#trusted-script}
397397

@@ -410,14 +410,14 @@ interface TrustedScript {
410410
};
411411
</pre>
412412

413-
TrustedScript objects have a `[[Data]]` internal slot which holds a
413+
TrustedScript objects have a <dfn for="TrustedScript">\[[Data]]</dfn> internal slot which holds a
414414
DOMString. The slot's value is set when the object is created, and
415415
will never change during its lifetime.
416416

417417
<dfn method for="TrustedScript">toJSON()</dfn> method steps and the
418418
<dfn for="TrustedScript">stringification behavior</dfn> steps of a
419419
TrustedScript object are to return the value from its
420-
`[[Data]]` internal slot.
420+
[=TrustedScript/[[Data]]=] internal slot.
421421

422422
### <dfn interface>TrustedScriptURL</dfn> ### {#trused-script-url}
423423

@@ -436,14 +436,14 @@ interface TrustedScriptURL {
436436
};
437437
</pre>
438438

439-
TrustedScriptURL objects have a `[[Data]]` internal slot which holds a
439+
TrustedScriptURL objects have a <dfn for="TrustedScriptURL">\[[Data]]</dfn> internal slot which holds a
440440
USVString. The slot's value is set when the object is created, and
441441
will never change during its lifetime.
442442

443443
<dfn method for="TrustedScriptURL">toJSON()</dfn> method steps and the
444444
<dfn for="TrustedScriptURL">stringification behavior</dfn> steps of a
445445
TrustedScriptURL object are to return the value from its
446-
`[[Data]]` internal slot.
446+
[=TrustedScriptURL/[[Data]]=] internal slot.
447447

448448
## <dfn>Policies</dfn> ## {#policies-hdr}
449449

@@ -636,7 +636,7 @@ initially empty.
636636

637637

638638
: <dfn>isHTML(value)</dfn>
639-
:: Returns true if value is an instance of {{TrustedHTML}} and has its `[[Data]]` internal slot set, false otherwise.
639+
:: Returns true if value is an instance of {{TrustedHTML}} and has its [=TrustedHTML/[[Data]]=] internal slot set, false otherwise.
640640

641641
Note: `is*` functions are used to check if a given object is truly a legitimate
642642
[=Trusted Type=] object (i.e. it was created via one of the configured
@@ -658,10 +658,10 @@ initially empty.
658658

659659

660660
: <dfn>isScript(value)</dfn>
661-
:: Returns true if value is an instance of {{TrustedScript}} and has its `[[Data]]` internal slot set, false otherwise.
661+
:: Returns true if value is an instance of {{TrustedScript}} and has its [=TrustedScript/[[Data]]=] internal slot set, false otherwise.
662662

663663
: <dfn>isScriptURL(value)</dfn>
664-
:: Returns true if value is an instance of {{TrustedScriptURL}} and has its `[[Data]]` internal slot set, false otherwise.
664+
:: Returns true if value is an instance of {{TrustedScriptURL}} and has its [=TrustedScriptURL/[[Data]]=] internal slot set, false otherwise.
665665

666666
: <dfn>getPropertyType(tagName, property, elementNs)</dfn>
667667
:: Allows the authors to check if a Trusted Type is required for a given {{Element}}'s
@@ -720,7 +720,7 @@ initially empty.
720720
<div dfn-type="attribute" dfn-for="TrustedTypePolicyFactory">
721721

722722
: <dfn>emptyHTML</dfn>
723-
:: is a {{TrustedHTML}} object with its `[[Data]]` internal slot value set to an empty string.
723+
:: is a {{TrustedHTML}} object with its [=TrustedHTML/[[Data]]=] internal slot value set to an empty string.
724724

725725
<div class="example" id="empty-html-example">
726726
<xmp highlight="js">
@@ -729,7 +729,7 @@ anElement.innerHTML = trustedTypes.emptyHTML; // no need to create a policy
729729
</div>
730730

731731
: <dfn>emptyScript</dfn>
732-
:: is a {{TrustedScript}} object with its `[[Data]]` internal slot value set to an empty string.
732+
:: is a {{TrustedScript}} object with its [=TrustedScript/[[Data]]=] internal slot value set to an empty string.
733733

734734
Note: This object can be used to detect if the runtime environment has [[#csp-eval]]. While native Trusted Types implementation can
735735
support `eval(TrustedScript)`, it is impossible for a polyfill to emulate that, as
@@ -1756,15 +1756,15 @@ throws an "`EvalError`" if not:
17561756
1. <ins>Let |isTrusted| be `true`.</ins>
17571757
1. <ins>If |bodyArg| is not a {{TrustedScript}} object, set |isTrusted| to `false`.</ins>
17581758
1. <ins>If |isTrusted| is `true` then:
1759-
1. <ins>If |bodyString| is not equal to |bodyArg|'s `[[Data]]` internal slot, set |isTrusted| to `false`.</ins>
1759+
1. <ins>If |bodyString| is not equal to |bodyArg|'s [=TrustedScript/[[Data]]=] internal slot, set |isTrusted| to `false`.</ins>
17601760
1. <ins>If |isTrusted| is `true`, then:</ins>
17611761
1. <ins> For each |arg| in |parameterArgs|:</ins>
17621762
1. <ins>Let |index| be the index of |arg| in |parameterArgs|.</ins>
17631763
1. <ins>If |arg| is not a {{TrustedScript}} object, set |isTrusted| to `false`.</ins>
17641764
1. <ins>If |isTrusted| is `true`, then:</ins>
1765-
1. <ins>if |parameterStrings|[|index|] is not equal to |arg|'s `[[Data]]` internal slot, set |isTrusted| to `false`.</ins>
1765+
1. <ins>if |parameterStrings|[|index|] is not equal to |arg|'s [=TrustedScript/[[Data]]=] internal slot, set |isTrusted| to `false`.</ins>
17661766
1. <ins>If |isTrusted| is `true`, let |sourceToValidate| be a new instance of
1767-
the {{TrustedScript}} interface, with its `[[Data]]` internal slot value
1767+
the {{TrustedScript}} interface, with its [=TrustedScript/[[Data]]=] internal slot value
17681768
set to |source|. Otherwise, let |sourceToValidate| be |source|.</ins>
17691769

17701770
1. <ins>Let |sourceString| be the result of executing the

0 commit comments

Comments
 (0)