@@ -7117,6 +7117,15 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
7117
7117
value of this element's <span>[[CryptographicNonce]]</span>; and on setting, set this element's
7118
7118
<span>[[CryptographicNonce]]</span> to the given value.</p>
7119
7119
7120
+ <p class="note" id="nonce-does-not-update-dom">Note how the setter for the <code
7121
+ data-x="dom-HTMLOrSVGElement-nonce">nonce</code> IDL attribute does not update the corresponding
7122
+ content attribute. This, as well as the below setting of the <code
7123
+ data-x="attr-nonce">nonce</code> content attribute to the empty string when an element
7124
+ <span>becomes browsing-context connected</span>, is meant to prevent exfiltration of the nonce
7125
+ value through mechanisms that can easily read content attributes, such as selectors. Learn more in
7126
+ <a href="https://github.com/whatwg/html/issues/2369">issue #2369</a>, where this behavior was
7127
+ introduced.</p>
7128
+
7120
7129
<p>Whenever an element including <code>HTMLOrSVGElement</code> has its <code
7121
7130
data-x="attr-nonce">nonce</code> attribute is set or changed, set this element's
7122
7131
<span>[[CryptographicNonce]]</span> to the given value.</p>
@@ -10236,7 +10245,7 @@ interface <dfn>HTMLUnknownElement</dfn> : <span>HTMLElement</span> { };</code></
10236
10245
10237
10246
<pre><code class="idl" data-x="">interface mixin <dfn>HTMLOrSVGElement</dfn> {
10238
10247
[SameObject] readonly attribute <span>DOMStringMap</span> <span data-x="dom-dataset">dataset</span>;
10239
- attribute DOMString <span data-x="dom-HTMLOrSVGElement-nonce">nonce</span>;
10248
+ attribute DOMString <span data-x="dom-HTMLOrSVGElement-nonce">nonce</span>; // <a href="#nonce-does-not-update-dom">intentionally no [CEReactions]</a>
10240
10249
10241
10250
[<span>CEReactions</span>] attribute long <span data-x="dom-tabindex">tabIndex</span>;
10242
10251
void <span data-x="dom-focus">focus</span>(optional <span>FocusOptions</span> options);
@@ -50828,7 +50837,7 @@ interface <dfn>HTMLTextAreaElement</dfn> : <span>HTMLElement</span> {
50828
50837
50829
50838
readonly attribute DOMString <span data-x="dom-textarea-type">type</span>;
50830
50839
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-textarea-defaultValue">defaultValue</span>;
50831
- [<span>CEReactions</span>] attribute [TreatNullAs=EmptyString] DOMString <span data-x="dom-textarea-value">value</span>;
50840
+ attribute [TreatNullAs=EmptyString] DOMString <span data-x="dom-textarea-value">value</span>;
50832
50841
readonly attribute unsigned long <span data-x="dom-textarea-textLength">textLength</span>;
50833
50842
50834
50843
readonly attribute boolean <span data-x="dom-cva-willValidate">willValidate</span>;
0 commit comments