Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGL create*() methods return nullable objects, but most are not nullable in the IDL and specification #314

Open
denniskaselow opened this issue Oct 2, 2024 · 2 comments

Comments

@denniskaselow
Copy link

For example createBuffer():

external WebGLBuffer? createBuffer();

vs IDL

https://github.com/w3c/webref/blob/15065116311262f763dc57d5bd0b2f1f5356fc20/ed/idl/webgl1.idl#L564

and specification: https://registry.khronos.org/webgl/specs/latest/1.0/#5.14.5

Only createShader() should return a nullable object.

@denniskaselow
Copy link
Author

denniskaselow commented Oct 2, 2024

I just realized that the change in the IDL is rather recent. It was introduced a few months ago with version 3.52.1 (package:web is on 3.49.0 if the readme is correct) but they weren't nullable in dart:web_gl and that's why I was surprised.

EDIT: looking at the spec, it was changed to nullable in 2014, and now in July 2024 back to not nullable

@srujzs
Copy link
Contributor

srujzs commented Oct 2, 2024

Yup, looks like this is a matter of updating the Web IDL version we use. I believe there are other breaking changes that would get pulled in with this, so we may wait a little while before we release a 2.0.0 in case we want to get other breaking changes in at the same time (and also remove some deprecations!).

dart:web_gl and the other dart: web libraries were based on stale Chrome IDL files that were last synced ~2017. Looking at the definitions in third_party/WebCore in the Dart SDK, createBuffer was non-nullable then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants