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

Disable problematic debug assert #5

Merged
merged 2 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/platform_impl/web/web_sys/media_query_handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ impl MediaQueryListHandle {
Self { mql, closure }
}

#[allow(dead_code)]
pub fn mql(&self) -> &MediaQueryList {
&self.mql
}
Expand Down
13 changes: 8 additions & 5 deletions src/platform_impl/web/web_sys/resize_scaling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,14 @@ impl ResizeScaleInternal {
(-webkit-device-pixel-ratio: {current_scale})",
);
let mql = MediaQueryListHandle::new(window, &media_query, closure);
debug_assert!(
mql.mql().matches(),
"created media query doesn't match, {current_scale} != {}",
super::scale_factor(window)
);
// TODO(PLAT-806): There's a winit/browser bug that causes this debug_assert
// to trigger when the print dialog is open. To prevent debug builds from
// panicking, we disable the debug_assert for now.
// debug_assert!(
// mql.mql().matches(),
// "created media query doesn't match, {current_scale} != {}",
// super::scale_factor(window)
// );
mql
}

Expand Down
Loading