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

The published web examples panic when opening Print dialog #12434

Open
Maximetinu opened this issue Mar 12, 2024 · 2 comments
Open

The published web examples panic when opening Print dialog #12434

Maximetinu opened this issue Mar 12, 2024 · 2 comments
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior O-Web Specific to web (WASM) builds

Comments

@Maximetinu
Copy link
Contributor

Bevy version

ATOW, if I'm not mistaken, the web examples are using latest Bevy 0.13

What you did

What went wrong

The print dialog opens successfully, and even shows a picture of the canvas at the time of opening the dialog:

image

However, Bevy panics at wasm_example.js:494 panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/web/web_sys/resize_scaling.rs:129:9: created media query doesn't match, 2 != 2

image

Additional information

@Maximetinu Maximetinu added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Mar 12, 2024
@james7132 james7132 added A-Windowing Platform-agnostic interface layer to run your app in O-Web Specific to web (WASM) builds and removed S-Needs-Triage This issue needs to be labelled labels Mar 13, 2024
@james7132
Copy link
Member

Potentially related to #12126, according to the winit issue.

@daxpedda
Copy link
Contributor

I previously downgraded this from an assert! to a debug_assert! in Winit because we have encountered issues before. But the fact that this assert is triggered, means that the ScaleFactorChanged event will not function properly.

I'm almost a 100% certain that this is a browser bug, e.g. the code that fails is this:

const mql = window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`)
if (!mql.matches)
    throw '`window.devicePixelRatio` doesn\'t match the current `MediaQueryList` state' 

I'm not an expert in the spec, but MediaQueryList should be in sync with the actual current state of any property, otherwise this would introduce a myriad of unintended behavior.

The best way forward is to boil this down to a bug we can actually report to Chrome and Safari, or at least to something we can implement a workaround for in Winit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior O-Web Specific to web (WASM) builds
Projects
None yet
Development

No branches or pull requests

3 participants