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

Setting HTMLCanvasElement.width also resets context properties #38339

Open
rafern opened this issue Feb 26, 2025 · 0 comments
Open

Setting HTMLCanvasElement.width also resets context properties #38339

rafern opened this issue Feb 26, 2025 · 0 comments
Labels
Content:WebAPI Web API docs help wanted If you know something about this topic, we would love your help!

Comments

@rafern
Copy link

rafern commented Feb 26, 2025

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/width

What specific section or headline is this issue about?

Second paragraph

What information was incorrect, unhelpful, or incomplete?

The text states that the drawing buffer is reset after setting the width (or height, that article is also affected). However, all of the properties in the context are also reset to their default value, not just the drawing buffer. When I read this, I assumed that the canvas would be blanked, but properties like fontKerning would not be reset to auto

What did you expect to see?

It should be clear that the whole context is reset, not just the drawing buffer.

Do you have any supporting links, references, or citations?

https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-set-bitmap-dimensions

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@rafern rafern added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Feb 26, 2025
@github-actions github-actions bot added the Content:WebAPI Web API docs label Feb 26, 2025
@Josh-Cena Josh-Cena added help wanted If you know something about this topic, we would love your help! and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs help wanted If you know something about this topic, we would love your help!
Projects
None yet
Development

No branches or pull requests

2 participants