In Chrome 63, this results in null: new ClipboardEvent('paste').clipboardData - there's no code to populate the event's clipboardData with anything if it's not provided e.g. by passing {clipboardData: new DataTransfer} as the options. Firefox provides a default DataTransfer instance.
Two problems:
[ ] The spec doesn't describe how the constructor works.
[ ] The spec prose has "The clipboardData attribute is an instance of the DataTransfer interface" but the IDL has readonly attribute DataTransfer? clipboardData; - these seem to disagree on nullability.
I'd expect the constructor prose to say something like "If eventInitDict is not given, or eventInitDict's clipboardData dictionary member is null, then initialize event's clipboardData to a newly created DataTransfer object." to fix the first point.
But then the second point is weird - how do you get a null in there?
Per https://bugs.chromium.org/p/chromium/issues/detail?id=800742
In Chrome 63, this results in null:
new ClipboardEvent('paste').clipboardData
- there's no code to populate the event's clipboardData with anything if it's not provided e.g. by passing{clipboardData: new DataTransfer}
as the options. Firefox provides a default DataTransfer instance.Two problems:
readonly attribute DataTransfer? clipboardData;
- these seem to disagree on nullability.I'd expect the constructor prose to say something like "If eventInitDict is not given, or eventInitDict's clipboardData dictionary member is null, then initialize event's clipboardData to a newly created
DataTransfer
object." to fix the first point.But then the second point is weird - how do you get a null in there?