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

saschanaz created an issue (whatwg/webidl#1511)

### What is the issue with the Web IDL Standard?

A version of #602 for dictionary members. Consider:

```webidl
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`] not passing `{}` means disabling the feature.

Might want to do the same work as #620 so that such dictionary would set an explicit non-`{}` default value, and otherwise explicitly get `{}`.

Context: https://github.com/gpuweb/gpuweb/issues/5249

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

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

Received on Wednesday, 30 July 2025 18:14:26 UTC