From 3a02f5eae30ce08ff97287a7c44537bd3990e54b Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Wed, 31 Jan 2024 15:37:01 +0000 Subject: [PATCH] Move early abort in Get Trusted Type compliant string to step 1 --- spec/index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/index.bs b/spec/index.bs index ee08aa6..5d1d456 100644 --- a/spec/index.bs +++ b/spec/index.bs @@ -1056,13 +1056,13 @@ 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 + |input| and abort these steps. 1. Let |cspList| be the |global|'s CSP list. 1. If |cspList| is `null` or does not contain a [=content security policy object|policy=] which [=directive set=] containing a [=directive=] with a name `"require-trusted-types-for"`, or that directive does not contain a trusted-types-sink-group which is a match for a value |sinkGroup|, return stringified |input| and abort these steps. -1. If |input| has type |expectedType|, return stringified - |input| and abort these steps. 1. Let |convertedInput| be the result of executing [$Process value with a default policy$] with the same arguments as this algorithm. 1. If the algorithm threw an error, rethrow the error and abort the following steps. 1. If |convertedInput| is `null` or `undefined`, execute the following steps: