Repository navigation
Make VideoColorSpace constructor argument optional - #337
Conversation
The constructor takes a `VideoColorSpaceInit` dictionary as input that does not have any required parameter. Quoting from the Web IDL spec, the input "must be specified as optional and have a default value provided. This is to encourage API designs that do not require authors to pass an empty dictionary value when they wish only to use the dictionary’s default values." https://heycam.github.io/webidl/#idl-operations
|
Hmm, not so sure about this one. The current shape comes from a previous iteration where We could do something like make There is some tension here where |
|
I see that there is an open discussion to "consider a pattern for dictionary arguments which must have at least one member" in Web IDL, see whatwg/webidl#903 Without that pattern, the constraint needs to be specified in prose, e.g. by throwing a |
|
I don't think that quite fits our case. After pondering for a while, I think we should just merge this (and also reconsider the question of nullability vs defaults). |
SHA: 7dc4e87 Reason: push, by @sandersdan Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 7dc4e87 Reason: push, by @sandersdan Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 7dc4e87 Reason: push, by @sandersdan Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 7dc4e87 Reason: push, by @sandersdan Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 7dc4e87 Reason: push, by @sandersdan Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 7dc4e87 Reason: push, by @sandersdan Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 7dc4e87 Reason: push, by @sandersdan Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 7dc4e87 Reason: push, by @sandersdan Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 7dc4e87 Reason: push, by @sandersdan Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 7dc4e87 Reason: push, by @sandersdan Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
w3c/webcodecs#337 Change-Id: I9bfa01253d159e28f3c0f262badf3ecea63a4105 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3094929 Auto-Submit: Dan Sanders <sandersd@chromium.org> Commit-Queue: Chrome Cunningham <chcunningham@chromium.org> Reviewed-by: Chrome Cunningham <chcunningham@chromium.org> Cr-Commit-Position: refs/heads/master@{#911935}
The constructor takes a
VideoColorSpaceInitdictionary as input that does not have any required parameter. Quoting from the Web IDL spec, the input "must be specified as optional and have a default value provided. This is to encourage API designs that do not require authors to pass an empty dictionary value when they wish only to use the dictionary’s default values."https://heycam.github.io/webidl/#idl-operations
Preview | Diff