You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: Step 3 is a special case for <a href=https://html.spec.whatwg.org/#event-handler-name>event handler names</a>, as they always start with "on".
1. Set |localName| to |tagName| in [=ASCII lowercase=].
700
716
1. Set |attribute| to |attribute| in [=ASCII lowercase=].
717
+
1. If |attribute| starts with "on", then return {{TrustedScript}}.
701
718
1. If |elementNs| is an empty string, set |elementNs| to [=HTML namespace=].
702
719
1. If |attrNs| is an empty string, set |attrNs| to null.
703
720
1. Let |interface| be the [=element interface=] for |localName| and |elementNs|.
704
-
1. If |interface| does not have an IDL <a spec="webidl">attribute</a> that [=reflects=] a content attribute with
705
-
|localName| local name and |attrNs| namespace,
706
-
return undefined and abort further steps. Otherwise, let |idlAttribute| be that IDL <a spec="webidl">attribute</a>.
707
-
1. If {{StringContext}} IDL extended attribute appears on |idlAttribute|, return
708
-
stringified {{StringContext}}'s identifier and abort further steps.
709
-
1. Return null.
721
+
1. Let |expectedType| be null.
722
+
1. Set |attributeData| to the result of [$Get Trusted Type data for attribute$] algorithm, with the following arguments:
723
+
* |interface| as |element|
724
+
* |attribute|
725
+
* |attrNs|
726
+
1. If |attributeData| is not null, then set |expectedType| to the value of the third member of |attributeData|.
727
+
1. Return |expectedType|.
728
+
729
+
Note: Step 3 is a special case for <a href=https://html.spec.whatwg.org/#event-handler-name>event handler names</a>, as they always start with "on".
@@ -1083,10 +1103,32 @@ Given an {{HTMLScriptElement}} (|script|), this algorithm performs the following
1083
1103
## Get Trusted Types-compliant attribute value ## {#validate-attribute-mutation}
1084
1104
To <dfn abstract-op export>get Trusted Types-compliant attribute value</dfn> on {{Attr}} |attribute| with {{Element}} |element| and {{TrustedType}} or a string |newValue|, perform the following steps:
1085
1105
1086
-
1. Let |expectedType| be null.
1087
-
1. Let |sink| be null.
1088
-
1. Find the row in the following table, where |element| is in the first column, and |attribute|'s <a for="Attr">namespace</a> and <a for="Attr">local name</a> match the values in the second and third column, respectively.
1089
-
If a matching row is found, set |expectedType| and |sink| to the value of the fourth, and fifth column in that row, respectively.
1106
+
1. Set |attributeData| to the result of [$Get Trusted Type data for attribute$] algorithm, with the following arguments:
1107
+
* |element|
1108
+
* |attribute|'s <a for="Attr">local name</a> as |attribute|
1109
+
* |attribute|'s <a for="Attr">namespace</a> as |attributeNs|
1110
+
1. If |attributeData| is null, then:
1111
+
1. If |newValue| is a string, return |newValue|.
1112
+
1. <a>Assert</a>: |newValue| is {{TrustedHTML}} or {{TrustedScript}} or {{TrustedScriptURL}}.
0 commit comments