Open Ms2ger opened 11 months ago
It seems like a more explicit definition would be good, but "an object with no properties" seems like the obvious default initialization for a dictionary parameter?
This is a dupe of https://github.com/whatwg/dom/issues/600.
Hmm, I guess this is about the web-developer-facing interfaces, whereas https://github.com/whatwg/dom/issues/600 is about the spec interface.
But for the web developer-facing interface, this seems like a bug in the CSP spec, not the Web IDL spec.
I think there's an IDL bug here that's wider than just events if optional Dict foo = {}
is legal IDL when Dict
has required members
What is the issue with the Web IDL Standard?
CSP has this IDL code (:
which IDL doesn't, as far as I can tell, expect or handle well.
If I'm not mistaken, when handling
new SecurityPolicyViolationEvent("type")
, the overload resolution algorithm just passes "that default value" in step 15.4.1, and nothing really defines what that value is ("which represents a default-initialized (as if from ES null or an object with no properties) dictionary value").The behavior of the constructor is specified in DOM, which doesn't pay attention to the requiredness of dictionary members.
It appears to me that as currently specified, the
required
tokens are essentially ignored when the argument is omitted. This seems unexpected at least.