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

MDN Documentation link for WebGl2RenderingContext::get_parameter 404's #4381

Open
josephcsible opened this issue Dec 26, 2024 · 2 comments
Open
Labels

Comments

@josephcsible
Copy link

Describe the Bug

The "MDN Documentation" link for WebGl2RenderingContext::get_parameter goes to a 404 page.

Steps to Reproduce

  1. Go to https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.WebGl2RenderingContext.html#method.get_parameter
  2. Click on 'MDN Documentation'
  3. See error

Expected Behavior

I expect the link to go to https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getParameter#webgl_2

Actual Behavior

The link goes to https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/getParameter, which doesn't exist.

Additional Context

https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext says:

Note: WebGL 2 is an extension to WebGL 1. The WebGL2RenderingContext interface implements all members of the WebGLRenderingContext interface. Some methods of the WebGL 1 context can accept additional values when used in a WebGL 2 context. You will find this info noted on the WebGL 1 reference pages.

It looks like for all methods that both WebGL 1 and 2 have, a single doc page under WebGLRenderingContext covers both versions, and doc pages under WebGL2RenderingContext don't exist at all except for things that are WebGL 2-specific.

@daxpedda
Copy link
Collaborator

daxpedda commented Jan 4, 2025

The problem seems to be the WebIDL includes statement, which specifically doesn't inherit. But apparently MDN doesn't create a separate link to the non-inherited method.

To fix this we would have to continue tracking the original class and use it when we generate the MDN link.

@daxpedda
Copy link
Collaborator

daxpedda commented Jan 4, 2025

So I did briefly try fixing this, but it seems that MDN is inconsistent about this.
E.g. the WindowOrWorkerGlobalScope mixing exists, see: https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/atob. But AnimationFrameProvider does not, see https://developer.mozilla.org/en-US/docs/Web/API/AnimationFrameProvider/cancelAnimationFrame.

So either MDN is inconsistent here, or we have to dig into the algorithm they use to generate these pages (if that's how it works and its not manual). Worst case scenario we have to fix it manually by adding some exceptions while parsing the WebIDL, as we already do with many other things.

EDIT: For historic reference, f21a5dc is my incomplete attempt.

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

No branches or pull requests

2 participants