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

Add missing api.WebGL[2]RenderingContext.[drawingBuffer/unpack]ColorSpace feature #17675

Merged

Conversation

queengooborg
Copy link
Collaborator

This PR is a part of a project to add missing interfaces and interface features to BCD that are from an active spec (including WICG specs) and is supported in at least one browser. This particular PR adds the missing drawingBufferColorSpace and unpackColorSpace members of the WebGLRenderingContext 1 and 2 APIs, populating the results using data from the mdn-bcd-collector project (v6.1.2).

Tests Used:
https://mdn-bcd-collector.appspot.com/tests/api/WebGLRenderingContext/drawingBufferColorSpace
https://mdn-bcd-collector.appspot.com/tests/api/WebGLRenderingContext/unpackColorSpace
https://mdn-bcd-collector.appspot.com/tests/api/WebGL2RenderingContext/drawingBufferColorSpace
https://mdn-bcd-collector.appspot.com/tests/api/WebGL2RenderingContext/unpackColorSpace

Check out the collector's guide on how to review this PR.

…pace feature

This PR is a part of a project to add missing interfaces and interface features to BCD that are from an active spec (including WICG specs) and is supported in at least one browser.  This particular PR adds the missing `drawingBufferColorSpace` and `unpackColorSpace` members of the WebGLRenderingContext 1 and 2 APIs, populating the results using data from the [mdn-bcd-collector](https://mdn-bcd-collector.appspot.com) project (v6.1.2).

Tests Used:
https://mdn-bcd-collector.appspot.com/tests/api/WebGLRenderingContext/drawingBufferColorSpace
https://mdn-bcd-collector.appspot.com/tests/api/WebGLRenderingContext/unpackColorSpace
https://mdn-bcd-collector.appspot.com/tests/api/WebGL2RenderingContext/drawingBufferColorSpace
https://mdn-bcd-collector.appspot.com/tests/api/WebGL2RenderingContext/unpackColorSpace

_Check out the [collector's guide on how to review this PR](https://github.com/foolip/mdn-bcd-collector#reviewing-bcd-changes)._
@queengooborg queengooborg added the data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label Sep 4, 2022
Copy link
Collaborator

@foolip foolip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -3127,6 +3127,39 @@
}
}
},
"drawingBufferColorSpace": {
"__compat": {
"spec_url": "https://registry.khronos.org/webgl/specs/latest/1.0/#DOM-WebGLRenderingContext-drawingBufferColorSpace",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost all other spec URLs in this file are to numbered sections. Can you match that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's actually a number of spec URLs that point to places like this, and I feel that's better because it points to the exact feature. We should probably change the numbered ones accordingly.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The numbered sections style is still completely dominant. I'd suggest sticking to that, and then opening a PR to change everything to your preferred style, asking review from whoever added the current spec URLs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to look into this, and I figured out why there's a lot of numbered sections used rather than the exact method or property. It's because the link to the section is the closest available! Features like activeTexture or attachShader don't have named anchors that point directly to them, so the section header has to be used in its place.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, so it's the exception that there's a direct link. In fact, just 11 cases like this one. Array.from(document.querySelectorAll('[id]')).map(e => e.id).filter(id => id.startsWith('DOM')) gives:

DOM-WebGLActiveInfo-size
DOM-WebGLActiveInfo-type
DOM-WebGLActiveInfo-name
DOM-WebGLShaderPrecisionFormat-rangeMin
DOM-WebGLShaderPrecisionFormat-rangeMax
DOM-WebGLShaderPrecisionFormat-precision
DOM-WebGLRenderingContext-canvas
DOM-WebGLRenderingContext-drawingBufferWidth
DOM-WebGLRenderingContext-drawingBufferHeight
DOM-WebGLRenderingContext-drawingBufferColorSpace
DOM-WebGLRenderingContext-unpackColorSpace

If you want to use these IDs where available, can you submit a PR updating the rest?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just did a check, and all of the other features have the appropriate URLs!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! I already approved, I'll merge as well now then.

@@ -3127,6 +3127,39 @@
}
}
},
"drawingBufferColorSpace": {
"__compat": {
"spec_url": "https://registry.khronos.org/webgl/specs/latest/1.0/#DOM-WebGLRenderingContext-drawingBufferColorSpace",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, so it's the exception that there's a direct link. In fact, just 11 cases like this one. Array.from(document.querySelectorAll('[id]')).map(e => e.id).filter(id => id.startsWith('DOM')) gives:

DOM-WebGLActiveInfo-size
DOM-WebGLActiveInfo-type
DOM-WebGLActiveInfo-name
DOM-WebGLShaderPrecisionFormat-rangeMin
DOM-WebGLShaderPrecisionFormat-rangeMax
DOM-WebGLShaderPrecisionFormat-precision
DOM-WebGLRenderingContext-canvas
DOM-WebGLRenderingContext-drawingBufferWidth
DOM-WebGLRenderingContext-drawingBufferHeight
DOM-WebGLRenderingContext-drawingBufferColorSpace
DOM-WebGLRenderingContext-unpackColorSpace

If you want to use these IDs where available, can you submit a PR updating the rest?

@foolip foolip merged commit 0d83771 into mdn:main Sep 12, 2022
@queengooborg queengooborg deleted the api/WebGLRenderingContext/ColorSpace/additions branch September 12, 2022 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants