- From: Marcos Cáceres <notifications@github.com>
- Date: Tue, 01 Mar 2022 18:24:33 -0800
- To: whatwg/webidl <webidl@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 2 March 2022 02:24:46 UTC
Over on WebGPU, there is the following [IDL fragment](https://www.w3.org/TR/webgpu/#webgpu-interfaces) specified:
```WebIDL
interface mixin GPUObjectBase {
attribute (USVString or undefined) label;
};
```
Leaving aside the issues with this `label` attribute itself, I'm wondering if we should outright ban `undefined` as an attribute type?
I personally can't think of any strong reason for an attribute to be declared `undefined` (unless it was settable to `any`). But I might be missing something obvious. It would be extremely confusing if an attribute was present and yet `undefined` (instead of null or "", in the case above for instance).
For the case above, Gecko, for instance, willfully violates the spec by null'ing the label attribute:
https://searchfox.org/mozilla-central/source/dom/webidl/WebGPU.webidl#51
A quick grep of WPT's IDLs and also Gecko's IDLs, I can't find any place in the Platform the where there is a `attribute undefined` specified or a union that is includes `undefined` for an attribute type.
Thoughts?
--
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/issues/1112
You are receiving this because you are subscribed to this thread.
Message ID: <whatwg/webidl/issues/1112@github.com>
Received on Wednesday, 2 March 2022 02:24:46 UTC