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

web-sys: set_fill_style_str and similar functions don't work #4169

Closed
0HyperCube opened this issue Oct 10, 2024 · 0 comments · Fixed by #4170
Closed

web-sys: set_fill_style_str and similar functions don't work #4169

0HyperCube opened this issue Oct 10, 2024 · 0 comments · Fixed by #4170
Labels

Comments

@0HyperCube
Copy link
Contributor

Thanks for all of your hard work on this great tooling.

Describe the Bug

The new set_fill_style_str function on the canvas rendering context doesn't work. However the depricated set_fill_style works fine.

Steps to Reproduce

  1. Use web-sys 0.3.71
  2. Call the new set_fill_style_str function
  3. The fill style is not updated.

invalid-fns-repo.zip

Expected Behavior

The set_fill_style_str should update the fill style.

Actual Behavior

The generated JS code appears to be incorrect:

  imports.wbg.__wbg_setfillStyleStr_c0046ed6f7a4a4e0 = function (
    arg0,
    arg1,
    arg2
  ) {
    arg0.fillStyleStr = getStringFromWasm0(arg1, arg2);
  };

Since fillStyleStr is not valid in the js API, it is ignored.

This change was introduced by #4156.

Tangentially, the MDN link shown in the doc comments for the set_fill_style_str is broken: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyleStr.

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

Successfully merging a pull request may close this issue.

1 participant