From 72ecd2c815edc39f54ce5ea3bca5a43c273fb49f Mon Sep 17 00:00:00 2001 From: Krzysztof Kotowicz Date: Tue, 5 Nov 2024 09:00:45 +0100 Subject: [PATCH] Replace 'has type' with less confusing 'is an instance of'. (#559) See https://github.com/w3c/trusted-types/issues/534. --- spec/index.bs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/index.bs b/spec/index.bs index 3d453f0..f093390 100644 --- a/spec/index.bs +++ b/spec/index.bs @@ -398,7 +398,7 @@ TrustedHTML objects have an associated string data The value is set when the object is created, and will never change during its lifetime. toJSON() method steps and the -stringification behavior steps of a +stringification behavior steps of a TrustedHTML object are to return the associated [=TrustedHTML/data=] value. ### TrustedScript ### {#trusted-script} @@ -1028,7 +1028,7 @@ It will ensure that the Trusted Type [=enforcement=] rules were respected. Given a {{TrustedType}} type (|expectedType|), a [=realm/global object=] (|global|), {{TrustedType}} or a string (|input|), a string (|sink|) and a string (|sinkGroup|), run these steps: -1. If |input| has type |expectedType|, return stringified +1. If |input| is an instance of |expectedType|, return stringified |input| and abort these steps. 1. Let |requireTrustedTypes| be the result of executing [$Does sink type require trusted types?$] algorithm, passing |global|, and |sinkGroup|. @@ -1042,7 +1042,7 @@ Given a {{TrustedType}} type (|expectedType|), a [=realm/global object=] (|globa Note: This step assures that the default policy rejection will be reported, but ignored in a report-only mode. 1. Throw a TypeError and abort further steps. -1. Assert: |convertedInput| has type |expectedType|. +1. Assert: |convertedInput| is an instance of |expectedType|. 1. Return stringified |convertedInput|. ## Process value with a default policy ## {#process-value-with-a-default-policy-algorithm}