Re: [whatwg/webidl] Propagate a type's extended attributes to a nullable inner type (PR #1624)

@annevk commented on this pull request.

This seems like the right direction, WebGL already relies on it (it has `[AllowShared] ArrayBufferView?`), and engines already behave this way.

Unless @saschanaz is prepared to drive the alternative approach and get the world to adopt that, I think we should go ahead with the direction this PR proposes. It's also not clear the alternative is better as it would allow types such as `(long)` potentially.

AI found a couple of issues:

- For each of the four attributes there are two kinds of sentence: a "must not be associated with" restriction, and an "appears on X, it creates a new IDL type…" definition. The PR edits only the former. The clean fix is to change "appears on" → "is associated with" in those six sentences, which also repairs the same staleness for the existing union propagation.
- There is no NullableType production. Null : "?" | ε (index.bs:5845) hangs off DistinguishableType : PrimitiveType Null (index.bs:5770). So in long?, the only type node is the whole DistinguishableType; the inner long is a PrimitiveType
  — not a Type, SingleType, or DistinguishableType. It exists only as the §6187 concept.
- UnionMemberType : ExtendedAttributeList DistinguishableType (index.bs:5758) is not a TypeWithExtendedAttributes production, and no step consumes it. Step 3 only pushes down from the union. So [AllowShared] ArrayBufferView written as a
  union member has nothing associating the attribute with it — which is what Web IDL's own AllowSharedBufferSource typedef does at index.bs:15087. That's a hole in the standard today, in the algorithm this PR edits.



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

Message ID: <whatwg/webidl/pull/1624/review/4994378162@github.com>

Received on Friday, 21 August 2026 14:32:08 UTC