Skip to content

Conversation

lukewarlow
Copy link
Member

@lukewarlow lukewarlow commented Jul 31, 2025

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

This allows reducing noise in the IDL for the common case that no argument needs passing to [Reflect].


Based on suggestion in #11455 (comment)

  • At least two implementers are interested (and none opposed):
  • Tests are written and can be reviewed and commented upon at:
  • Implementation bugs are filed:
    • Chromium: …
    • Gecko: …
    • WebKit: …
    • Deno (only for timers, structured clone, base64 utils, channel messaging, module resolution, web workers, and web storage): …
    • Node.js (only for timers, structured clone, base64 utils, channel messaging, and module resolution): …
  • Corresponding HTML AAM & ARIA in HTML issues & PRs:
  • MDN issue is filed: …
  • The top of this comment includes a clear commit message to use.

(See WHATWG Working Mode: Changes for more details.)

This allows reducing noise in the IDL for the common case that no argument needs passing to [Reflect].
<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.

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?

@annevk
Copy link
Member

annevk commented Aug 15, 2025

Note that #11086 adds another instance to remove.

@lukewarlow
Copy link
Member Author

Apologies for the delay on this I didn't managed to fix it up before annual leave but it's on my to-do list for when I'm back.

@annevk
Copy link
Member

annevk commented Aug 15, 2025

No apology needed. Hope you have a good break!

@domenic
Copy link
Member

domenic commented Aug 19, 2025

I'm somewhat negative on this. I still prefer the hierarchy of there being a "primary" reflection xattr, which takes the name when necessary and establishes the reflection, and then additional reflection metadata xattrs, which support the primary one. Saying that you can omit the primary one in the specific case where the IDL and content attribute names lowercase to the same thing, and there happens to be additional reflection metadata, is a hard rule to understand, IMO.

@lukewarlow
Copy link
Member Author

I'm not particularly fussed either way, it does cut down on some noise to do this but equally its effectively editorial so I'll leave it to the spec editors to decide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants