Re: [whatwg/webidl] Require a default value for optional dictionary member of another dictionary? (Issue #1511)

musaakalid1-ai left a comment (whatwg/webidl#1511)

> ### What is the issue with the Web IDL Standard?
> A version of [#602](https://github.com/whatwg/webidl/issues/602) for dictionary members. Consider:
> 
> dictionary Foo {
>   Bar bar;
> };
> 
> dictionary Bar {};
> Given we treat an empty dictionary as nothing-is-passed in arguments, one can expect the same for dictionary; not passing `bar` would be same as passing `{}`. But it's not always the case - e.g. in [`DisplayMediaStreamOptions.video`](https://w3c.github.io/mediacapture-screen-share/#displaymediastreamoptions) not passing a value may also mean `true`, or in [`GPUBindGroupLayoutEntry`](https://gpuweb.github.io/gpuweb/#dictdef-gpubindgrouplayoutentry) not passing `{}` means disabling the feature.
> 
> Might want to do the same work as [#620](https://github.com/whatwg/webidl/pull/620) so that such dictionary would set an explicit non-`{}` default value, and otherwise explicitly get `{}`.
> 
> Context: [gpuweb/gpuweb#5249](https://github.com/gpuweb/gpuweb/issues/5249)

google

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/issues/1511#issuecomment-3975788151
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/issues/1511/3975788151@github.com>

Received on Saturday, 28 February 2026 00:04:18 UTC