@@ -8802,77 +8802,80 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
8802
8802
8803
8803
<h4>Using reflect via IDL extended attributes</h4>
8804
8804
8805
- <p>To enable improved usage of <span data-x="reflect">reflection</span>, we introduce the <dfn
8806
- extended-attribute data-lt="Reflect" data-x="xattr-Reflect"><code>[Reflect]</code></dfn>, <dfn
8807
- extended-attribute data-lt="ReflectSetter"
8808
- data-x="xattr-ReflectSetter"><code>[ReflectSetter]</code></dfn>, <dfn extended-attribute
8809
- data-lt="ReflectURL" data-x="xattr-ReflectURL"><code>[ReflectURL]</code></dfn>, <dfn
8810
- extended-attribute data-lt="ReflectNonNegative"
8805
+ <p>To enable improved usage of <span data-x="reflect">reflection</span>, we introduce multiple new
8806
+ IDL <span data-x="extended attribute">extended attributes</span>. <dfn extended-attribute
8807
+ data-lt="Reflect" data-x="xattr-Reflect"><code>[Reflect]</code></dfn>, <dfn extended-attribute
8808
+ data-lt="ReflectSetter" data- x="xattr-ReflectSetter"><code>[ReflectSetter]</code></dfn>, <dfn
8809
+ extended-attribute data-lt="ReflectURL" data-x="xattr-ReflectURL"><code>[ReflectURL]</code></dfn>,
8810
+ <dfn extended-attribute data-lt="ReflectNonNegative"
8811
8811
data-x="xattr-ReflectNonNegative"><code>[ReflectNonNegative]</code></dfn>, <dfn extended-attribute
8812
- data-lt="ReflectPositive" data-x="xattr-ReflectPositive"><code>[ReflectPositive]</code></dfn>,
8812
+ data-lt="ReflectPositive" data-x="xattr-ReflectPositive"><code>[ReflectPositive]</code></dfn>, and
8813
8813
<dfn extended-attribute data-lt="ReflectPositiveWithFallback"
8814
- data-x="xattr-ReflectPositiveWithFallback"><code>[ReflectPositiveWithFallback]</code></dfn>, <dfn
8815
- extended-attribute data-lt="ReflectRange"
8816
- data-x="xattr-ReflectRange"><code>[ReflectRange]</code></dfn>, and <dfn extended-attribute
8817
- data-lt="ReflectDefault" data-x="xattr-ReflectDefault"><code>[ReflectDefault]</code></dfn> IDL
8818
- <span data-x="extended attribute">extended attributes</span>.</p>
8814
+ data-x="xattr-ReflectPositiveWithFallback"><code>[ReflectPositiveWithFallback]</code></dfn> all
8815
+ trigger <span data-x="reflect">reflection</span>. These must either take no arguments, or take a
8816
+ string; they must not appear on anything other than an interface member attribute; and only one of
8817
+ these can be used at a time.</p>
8819
8818
8820
- <p>The <code data-x="xattr-Reflect">[Reflect]</code>, <code
8821
- data-x="xattr-ReflectSetter">[ReflectSetter]</code>, <code
8822
- data-x="xattr-ReflectURL">[ReflectURL]</code>, <code
8823
- data-x="xattr-ReflectNonNegative">[ReflectNonNegative]</code>, <code
8824
- data-x="xattr-ReflectPositive">[ReflectPositive]</code>, <code
8825
- data-x="xattr-ReflectPositiveWithFallback">[ReflectPositiveWithFallback]</code> <span>extended
8826
- attribute</span>s must either take no arguments, or take a string. They must not appear on
8827
- anything other than an interface member attribute.</p>
8819
+ <p>For one of these primary reflection <span data-x="extended attribute">extended
8820
+ attributes</span>, its <span>reflected content attribute name</span> is the string value it takes,
8821
+ if one is provided, or the IDL attribute name otherwise.</p>
8828
8822
8829
8823
<p>IDL attributes with the <code data-x="xattr-Reflect">[Reflect]</code> <span>extended
8830
- attribute</span> must <span>reflect</span> the content attribute of the name provided by < code
8831
- data-x="xattr-Reflect">[Reflect]</code> or the IDL attribute name if none is provided .</p>
8824
+ attribute</span> must <span>reflect</span> <code data-x="xattr-Reflect">[Reflect]</ code>'s
8825
+ <span>reflected content attribute name</span> .</p>
8832
8826
8833
8827
<p>IDL attributes with the <code data-x="xattr-ReflectSetter">[ReflectSetter]</code>
8834
- <span>extended attribute</span> on setting must <span>reflect</span> the content attribute of the
8835
- name provided by <code data-x="xattr-ReflectSetter">[ReflectSetter]</code> or the IDL attribute
8836
- name if none is provided.</p>
8828
+ <span>extended attribute</span> on setting must <span>reflect</span> <code
8829
+ data-x="xattr-ReflectSetter">[ReflectSetter]</code>'s <span>reflected content attribute
8830
+ name</span>.</p>
8831
+
8832
+ <p>The <code data-x="xattr-ReflectURL">[ReflectURL]</code> <span>extended attribute</span> must
8833
+ only appear on attributes with a type of <code data-x="idl-USVString">USVString</code>.</p>
8837
8834
8838
8835
<p>IDL attributes with the <code data-x="xattr-ReflectURL">[ReflectURL]</code> <span>extended
8839
- attribute</span> must <span>reflect</span>, <span data-x="treated as a URL">as a URL</span>, the
8840
- content attribute of the name provided by <code data-x="xattr-ReflectURL">[ReflectURL]</code> or
8841
- the IDL attribute name if none is provided.</p>
8836
+ attribute</span> must <span>reflect</span>, <span data-x="treated as a URL">as a URL</span>, <code
8837
+ data-x="xattr-ReflectURL">[ReflectURL]</code>'s <span>reflected content attribute name</span>.</p>
8842
8838
8843
8839
<p>The <code data-x="xattr-ReflectNonNegative">[ReflectNonNegative]</code> <span>extended
8844
- attribute</span> must only appear on interface member attributes with a type of <code
8840
+ attribute</span> must only appear on attributes with a type of <code
8845
8841
data-x="idl-long">long</code>.</p>
8846
8842
8847
8843
<p>IDL attributes with the <code data-x="xattr-ReflectNonNegative">[ReflectNonNegative]</code>
8848
8844
<span>extended attribute</span> must <span>reflect</span>, <span>limited to only non-negative
8849
- numbers</span>, the content attribute of the name provided by <code
8850
- data-x="xattr-ReflectNonNegative">[ReflectNonNegative]</code> or the IDL attribute name if none is
8851
- provided.</p>
8845
+ numbers</span>, <code data-x="xattr-ReflectNonNegative">[ReflectNonNegative]</code>'s
8846
+ <span>reflected content attribute name</span>.</p>
8852
8847
8853
8848
<p>The <code data-x="xattr-ReflectPositive">[ReflectPositive]</code> and <code
8854
- data-x="xattr-ReflectPositiveWithFallback">[ReflectPositiveWithFallback]</code> <span>extended
8855
- attribute</span>s must only appear on interface member attributes with a type of <code
8856
- data-x="idl-double">double</code> or <code data-x="idl-unsigned-long">unsigned long</code>.</p>
8849
+ data-x="xattr-ReflectPositiveWithFallback">[ReflectPositiveWithFallback]</code> <span
8850
+ data-x="extended attribute">extended attributes</span> must only appear on attributes with a type
8851
+ of <code data-x="idl-double">double</code> or <code data-x="idl-unsigned-long">unsigned
8852
+ long</code>.</p>
8857
8853
8858
8854
<p>IDL attributes with the <code data-x="xattr-ReflectPositive">[ReflectPositive]</code>
8859
8855
<span>extended attribute</span> must <span>reflect</span>, <span>limited to only positive
8860
- numbers</span>, the content attribute of the name provided by <code
8861
- data-x="xattr-ReflectPositive">[ReflectPositive]</code> or the IDL attribute name if none is
8862
- provided.</p>
8856
+ numbers</span>, <code data-x="xattr-ReflectPositive">[ReflectPositive]</code>'s <span>reflected
8857
+ content attribute name</span>.</p>
8863
8858
8864
8859
<p>IDL attributes with the <code
8865
8860
data-x="xattr-ReflectPositiveWithFallback">[ReflectPositiveWithFallback]</code> <span>extended
8866
8861
attribute</span> must <span>reflect</span>, <span>limited to only positive numbers with
8867
- fallback</span>, the content attribute of the name provided by <code
8868
- data-x="xattr-ReflectPositiveWithFallback">[ReflectPositiveWithFallback]</code> or the IDL
8869
- attribute name if none is provided.</p>
8862
+ fallback</span>, <code
8863
+ data-x="xattr-ReflectPositiveWithFallback">[ReflectPositiveWithFallback]</code>'s <span>reflected
8864
+ content attribute name</span></p>
8865
+
8866
+ <hr>
8867
+
8868
+ <p>To supplement the above <span data-x="extended attribute">extended attributes</span> we also
8869
+ introduce <dfn extended-attribute data-lt="ReflectRange"
8870
+ data-x="xattr-ReflectRange"><code>[ReflectRange]</code></dfn>, and <dfn extended-attribute
8871
+ data-lt="ReflectDefault" data-x="xattr-ReflectDefault"><code>[ReflectDefault]</code></dfn>. These
8872
+ augment how <span data-x="reflect">reflection</span> works and also must only appear on interface
8873
+ member attributes.</p>
8870
8874
8871
8875
<p>The <code data-x="xattr-ReflectRange">[ReflectRange]</code> <span>extended attribute</span>
8872
- must take an integer list limited to two values. It must not appear on anything other than an
8873
- interface member attribute with a type of <code data-x="idl-unsigned-long">unsigned long</code>.
8874
- Additionally, it must also only appear alongside <code
8875
- data-x="xattr-Reflect">[Reflect]</code>.</p>
8876
+ must take an integer list limited to two values. It must only be used on attributes with a type of
8877
+ <code data-x="idl-unsigned-long">unsigned long</code>. Additionally, it must also only appear
8878
+ alongside <code data-x="xattr-Reflect">[Reflect]</code>.</p>
8876
8879
8877
8880
<p>IDL attributes with the <code data-x="xattr-ReflectRange">[ReflectRange]</code> <span>extended
8878
8881
attribute</span> are <span>clamped to the range</span> [<var>clampedMin</var>,
@@ -8881,12 +8884,12 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
8881
8884
data-x="xattr-ReflectRange">[ReflectRange]</code>.</p>
8882
8885
8883
8886
<p>The <code data-x="xattr-ReflectDefault">[ReflectDefault]</code> <span>extended attribute</span>
8884
- must not appear on anything other than an interface member attribute with a type of <code
8885
- data-x="idl-double">double </code>, <code data-x="idl-long">long</code>, or <code
8886
- data-x="idl-unsigned-long">unsigned long </code>. When used on an attribute of type <code
8887
- data-x="idl-double">double</code>, it must take a decimal, otherwise it must take an integer.
8888
- Additionally, it must also only appear alongside <code data-x="xattr-Reflect">[Reflect]</code>,
8889
- <code data-x="xattr-ReflectNonNegative">[ReflectNonNegative]</code>, <code
8887
+ must only be used on attributes with a type of <code data-x="idl-double">double</code>, <code
8888
+ data-x="idl-long">long </code>, or <code data-x="idl-unsigned- long">unsigned long</code>. When used
8889
+ on an attribute of type <code data-x="idl-double">double </code>, it must take a decimal, otherwise
8890
+ it must take an integer. Additionally, it must also only appear alongside <code
8891
+ data-x="xattr-Reflect">[Reflect]</code>, <code
8892
+ data-x="xattr-ReflectNonNegative">[ReflectNonNegative]</code>, <code
8890
8893
data-x="xattr-ReflectPositive">[ReflectPositive]</code>, or <code
8891
8894
data-x="xattr-ReflectPositiveWithFallback">[ReflectPositiveWithFallback]</code>.</p>
8892
8895
0 commit comments