Re: [whatwg/dom] Trusted types attributes (PR #1268)

@smaug---- commented on this pull request.



> - <li><p>If <var>attribute</var> is null, create an <a>attribute</a> whose
- <a for=Attr>local name</a> is <var>qualifiedName</var>, <a for=Attr>value</a> is
- <var>value</var>, and <a for=Node>node document</a> is <a>this</a>'s <a for=Node>node document</a>,
- then <a lt="append an attribute">append</a> this <a>attribute</a> to <a>this</a>, and then return.
+ <li><p>Let <var>attributeExists</var> be false if <var>attribute</var> is null; otherwise true.
+
+ <li><p>If <var>attributeExists</var> is false, then set <var>attribute</var> to an <a>attribute</a>
+ whose <a for=Attr>local name</a> is <var>qualifiedName</var>, <a for=Attr>value</a> is
+ <var>value</var>, and <a for=Node>node document</a> is <a>this</a>'s <a for=Node>node document</a>.
+
+ <li><p>Let <var>verifiedValue</var> be the result of
+ <a lt="verify attribute value">verifying an attribute value</a> given <var>value</var>,
+ <var>attribute</var>, and <a>this</a>.
+
+ <li><p>Set <var>attributeExists</var> to true if <a>this</a>
+ <a lt="has an attribute">has an attribute</a> <var>attribute</var>; otherwise false.

As I said on Matrix, I wish we wouldn't need to do identity checks on attributes. That would be a bit tricky, or at least slow in Gecko, and I think also in other engines.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/1268#pullrequestreview-2701951888
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/pull/1268/review/2701951888@github.com>

Received on Thursday, 20 March 2025 09:54:54 UTC