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

Problem with window.devicePixelRatio example #26316

Closed
dhoulder opened this issue Apr 20, 2023 · 1 comment · Fixed by #27188
Closed

Problem with window.devicePixelRatio example #26316

dhoulder opened this issue Apr 20, 2023 · 1 comment · Fixed by #27188
Labels
Content:WebAPI Web API docs help wanted If you know something about this topic, we would love your help!

Comments

@dhoulder
Copy link

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio

What specific section or headline is this issue about?

Example code does not match description

What information was incorrect, unhelpful, or incomplete?

The page says…

The updatePixelRatio() function fetches the current value of devicePixelRatio, then sets the innerText of the element pixelRatioBox to a string which displays the ratio both as a percentage and as a raw decimal value with up to two decimal places.

No it doesn't. The innerText modification was removed in
674f685

As a result the text…

This example demonstrates the effect of zooming the page in and out (or moving it to a screen with a different scaling factor) on the value of the property Window.devicePixelRatio. Try it and watch what happens!

… is also wrong.

Thanks

What did you expect to see?

The device pixel ratio in the Result box

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

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@dhoulder dhoulder added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Apr 20, 2023
@github-actions github-actions bot added the Content:WebAPI Web API docs label Apr 20, 2023
@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 May 21, 2023
@Josh-Cena
Copy link
Member

cc @dawei-wang

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

Successfully merging a pull request may close this issue.

2 participants