Skip to content

Imply [Reflect] when [ReflectRange] or [ReflectDefault] are used. #11518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 22 additions & 16 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -8864,17 +8864,20 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

<hr>

<p>To supplement the above <span data-x="extended attribute">extended attributes</span> we also
introduce <dfn extended-attribute data-lt="ReflectRange"
<p>To supplement the above <span data-x="extended attribute">extended attributes</span> <dfn
extended-attribute data-lt="ReflectRange"
data-x="xattr-ReflectRange"><code>[ReflectRange]</code></dfn>, and <dfn extended-attribute
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop the comma here as there's only two alternatives.

data-lt="ReflectDefault" data-x="xattr-ReflectDefault"><code>[ReflectDefault]</code></dfn>. These
augment how <span data-x="reflect">reflection</span> works and also must only appear on interface
member attributes.</p>
data-lt="ReflectDefault" data-x="xattr-ReflectDefault"><code>[ReflectDefault]</code></dfn> can be
used. These augment how <span data-x="reflect">reflection</span> works and also must only appear
on interface member attributes.</p>

<p>The <code data-x="xattr-ReflectRange">[ReflectRange]</code> <span>extended attribute</span>
must take an integer list limited to two values. It must only be used on attributes with a type of
<code data-x="idl-unsigned-long">unsigned long</code>. Additionally, it must also only appear
alongside <code data-x="xattr-Reflect">[Reflect]</code>.</p>
<code data-x="idl-unsigned-long">unsigned long</code>. Additionally, it must not appear alongside
any primary <span data-x="reflect">reflection</span> <span>extended attribute</span> except <code
data-x="xattr-Reflect">[Reflect]</code>. If there is no primary <span
data-x="reflect">reflection</span> <span>extended attribute</span> then, <code
data-x="xattr-Reflect">[Reflect]</code> with no argument is implied.</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can constrain it even further to only allow Reflect when its identifier is present?


<p>IDL attributes with the <code data-x="xattr-ReflectRange">[ReflectRange]</code> <span>extended
attribute</span> are <span>clamped to the range</span> [<var>clampedMin</var>,
Expand All @@ -8886,11 +8889,14 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
must only be used on attributes with a type of <code data-x="idl-double">double</code>, <code
data-x="idl-long">long</code>, or <code data-x="idl-unsigned-long">unsigned long</code>. When used
on an attribute of type <code data-x="idl-double">double</code>, it must take a decimal; otherwise
it must take an integer. Additionally, it must also only appear alongside <code
it must take an integer. Additionally, it must not appear alongside any primary <span
data-x="reflect">reflection</span> <span>extended attribute</span> except <code
data-x="xattr-Reflect">[Reflect]</code>, <code
data-x="xattr-ReflectNonNegative">[ReflectNonNegative]</code>, <code
data-x="xattr-ReflectPositive">[ReflectPositive]</code>, or <code
data-x="xattr-ReflectPositiveWithFallback">[ReflectPositiveWithFallback]</code>.</p>
data-x="xattr-ReflectPositiveWithFallback">[ReflectPositiveWithFallback]</code>. If there is no
primary <span data-x="reflect">reflection</span> <span>extended attribute</span> then, <code
data-x="xattr-Reflect">[Reflect]</code> with no argument is implied.</p>

<p>IDL attributes with the <code data-x="xattr-ReflectDefault">[ReflectDefault]</code>
<span>extended attribute</span> have a <span>default value</span> provided by the argument
Expand Down Expand Up @@ -20524,7 +20530,7 @@ interface <dfn interface>HTMLOListElement</dfn> : <span>HTMLElement</span> {
[<span>HTMLConstructor</span>] constructor();

[<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>] attribute boolean <dfn attribute for="HTMLOListElement" data-x="dom-ol-reversed">reversed</dfn>;
[<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>, <span data-x="xattr-ReflectDefault">ReflectDefault=1</span>] attribute long <dfn attribute for="HTMLOListElement" data-x="dom-ol-start">start</dfn>;
[<span>CEReactions</span>, <span data-x="xattr-ReflectDefault">ReflectDefault=1</span>] attribute long <dfn attribute for="HTMLOListElement" data-x="dom-ol-start">start</dfn>;
[<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>] attribute DOMString <dfn attribute for="HTMLOListElement" data-x="dom-ol-type">type</dfn>;

// <a href="#HTMLOListElement-partial">also has obsolete members</a>
Expand Down Expand Up @@ -43429,7 +43435,7 @@ the cell that corresponds to the values of the two dice.
interface <dfn interface>HTMLTableColElement</dfn> : <span>HTMLElement</span> {
[<span>HTMLConstructor</span>] constructor();

[<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>, <span data-x="xattr-ReflectDefault">ReflectDefault=1</span>, <span data-x="xattr-ReflectRange">ReflectRange=(1, 1000)</span>] attribute unsigned long <dfn attribute for="HTMLTableColElement" data-x="dom-colgroup-span">span</dfn>;
[<span>CEReactions</span>, <span data-x="xattr-ReflectDefault">ReflectDefault=1</span>, <span data-x="xattr-ReflectRange">ReflectRange=(1, 1000)</span>] attribute unsigned long <dfn attribute for="HTMLTableColElement" data-x="dom-colgroup-span">span</dfn>;

// <a href="#HTMLTableColElement-partial">also has obsolete members</a>
};</code></pre>
Expand Down Expand Up @@ -43931,8 +43937,8 @@ interface <dfn interface>HTMLTableRowElement</dfn> : <span>HTMLElement</span> {
interface <dfn interface>HTMLTableCellElement</dfn> : <span>HTMLElement</span> {
[<span>HTMLConstructor</span>] constructor();

[<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>, <span data-x="xattr-ReflectDefault">ReflectDefault=1</span>, <span data-x="xattr-ReflectRange">ReflectRange=(1, 1000)</span>] attribute unsigned long <dfn attribute for="HTMLTableCellElement" data-x="dom-tdth-colSpan">colSpan</dfn>;
[<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>, <span data-x="xattr-ReflectDefault">ReflectDefault=1</span>, <span data-x="xattr-ReflectRange">ReflectRange=(0, 65534)</span>] attribute unsigned long <dfn attribute for="HTMLTableCellElement" data-x="dom-tdth-rowSpan">rowSpan</dfn>;
[<span>CEReactions</span>, <span data-x="xattr-ReflectDefault">ReflectDefault=1</span>, <span data-x="xattr-ReflectRange">ReflectRange=(1, 1000)</span>] attribute unsigned long <dfn attribute for="HTMLTableCellElement" data-x="dom-tdth-colSpan">colSpan</dfn>;
[<span>CEReactions</span>, <span data-x="xattr-ReflectDefault">ReflectDefault=1</span>, <span data-x="xattr-ReflectRange">ReflectRange=(0, 65534)</span>] attribute unsigned long <dfn attribute for="HTMLTableCellElement" data-x="dom-tdth-rowSpan">rowSpan</dfn>;
[<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>] attribute DOMString <dfn data-x="dom-tdth-headers">headers</dfn>;
readonly attribute long <span data-x="dom-tdth-cellIndex">cellIndex</span>;

Expand Down Expand Up @@ -53906,7 +53912,7 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
[<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>] attribute boolean <dfn attribute for="HTMLSelectElement" data-x="dom-select-multiple">multiple</dfn>;
[<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>] attribute DOMString <dfn attribute for="HTMLSelectElement" data-x="dom-select-name">name</dfn>;
[<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>] attribute boolean <dfn attribute for="HTMLSelectElement" data-x="dom-select-required">required</dfn>;
[<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>, <span data-x="xattr-ReflectDefault">ReflectDefault=0</span>] attribute unsigned long <dfn attribute for="HTMLSelectElement" data-x="dom-select-size">size</dfn>;
[<span>CEReactions</span>, <span data-x="xattr-ReflectDefault">ReflectDefault=0</span>] attribute unsigned long <dfn attribute for="HTMLSelectElement" data-x="dom-select-size">size</dfn>;
<!-- see https://www.w3.org/Bugs/Public/show_bug.cgi?id=12288 for compat reasons why .size allows
0 (it's not limited to values greater than zero) even though that value really makes no sense
-->
Expand Down Expand Up @@ -140835,8 +140841,8 @@ interface <dfn interface>HTMLMarqueeElement</dfn> : <span>HTMLElement</span> {
[<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>] attribute DOMString <dfn attribute for="HTMLMarqueeElement" data-x="dom-marquee-height">height</dfn>;
[<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>] attribute unsigned long <dfn attribute for="HTMLMarqueeElement" data-x="dom-marquee-hspace">hspace</dfn>;
[<span>CEReactions</span>] attribute long <span data-x="dom-marquee-loop">loop</span>;
[<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>, <span data-x="xattr-ReflectDefault">ReflectDefault=6</span>] attribute unsigned long <dfn attribute for="HTMLMarqueeElement" data-x="dom-marquee-scrollamount">scrollAmount</dfn>;
[<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>, <span data-x="xattr-ReflectDefault">ReflectDefault=85</span>] attribute unsigned long <dfn attribute for="HTMLMarqueeElement" data-x="dom-marquee-scrollDelay">scrollDelay</dfn>;
[<span>CEReactions</span>, <span data-x="xattr-ReflectDefault">ReflectDefault=6</span>] attribute unsigned long <dfn attribute for="HTMLMarqueeElement" data-x="dom-marquee-scrollamount">scrollAmount</dfn>;
[<span>CEReactions</span>, <span data-x="xattr-ReflectDefault">ReflectDefault=85</span>] attribute unsigned long <dfn attribute for="HTMLMarqueeElement" data-x="dom-marquee-scrollDelay">scrollDelay</dfn>;
[<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>] attribute boolean <dfn attribute for="HTMLMarqueeElement" data-x="dom-marquee-trueSpeed">trueSpeed</dfn>;
[<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>] attribute unsigned long <dfn attribute for="HTMLMarqueeElement" data-x="dom-marquee-vspace">vspace</dfn>;
[<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>] attribute DOMString <dfn attribute for="HTMLMarqueeElement" data-x="dom-marquee-width">width</dfn>;
Expand Down