mirror of
https://github.com/rust-windowing/winit.git
synced 2026-09-02 06:40:06 -04:00
Update minimum version of wasm-bindgen (#3860)
This commit is contained in:
@@ -270,12 +270,12 @@ redox_syscall = "0.4.1"
|
|||||||
|
|
||||||
# Web
|
# Web
|
||||||
[target.'cfg(target_family = "wasm")'.dependencies]
|
[target.'cfg(target_family = "wasm")'.dependencies]
|
||||||
js-sys = "0.3.64"
|
js-sys = "0.3.70"
|
||||||
pin-project = "1"
|
pin-project = "1"
|
||||||
wasm-bindgen = "0.2"
|
wasm-bindgen = "0.2.93"
|
||||||
wasm-bindgen-futures = "0.4"
|
wasm-bindgen-futures = "0.4.43"
|
||||||
web-time = "1"
|
web-time = "1"
|
||||||
web_sys = { package = "web-sys", version = "0.3.64", features = [
|
web_sys = { package = "web-sys", version = "0.3.70", features = [
|
||||||
"AbortController",
|
"AbortController",
|
||||||
"AbortSignal",
|
"AbortSignal",
|
||||||
"Blob",
|
"Blob",
|
||||||
|
|||||||
13
deny.toml
13
deny.toml
@@ -54,19 +54,6 @@ crate = "android-activity"
|
|||||||
allow-globs = ["freetype2/*"]
|
allow-globs = ["freetype2/*"]
|
||||||
crate = "freetype-sys"
|
crate = "freetype-sys"
|
||||||
|
|
||||||
[[bans.build.bypass]]
|
|
||||||
allow = [
|
|
||||||
{ path = "releases/friends.sh", checksum = "f896ccdcb8445d29ed6dd0d9a360f94d4f33af2f1cc9965e7bb38b156c45949d" },
|
|
||||||
]
|
|
||||||
crate = "wasm-bindgen"
|
|
||||||
|
|
||||||
[[bans.build.bypass]]
|
|
||||||
allow = [
|
|
||||||
{ path = "ui-tests/update-all-references.sh", checksum = "8b8dbf31e7ada1314956db7a20ab14b13af3ae246a6295afdc7dc96af8ec3773" },
|
|
||||||
{ path = "ui-tests/update-references.sh", checksum = "65375c25981646e08e8589449a06be4505b1a2c9e10d35f650be4b1b495dff22" },
|
|
||||||
]
|
|
||||||
crate = "wasm-bindgen-macro"
|
|
||||||
|
|
||||||
[[bans.build.bypass]]
|
[[bans.build.bypass]]
|
||||||
allow-globs = ["lib/*.a"]
|
allow-globs = ["lib/*.a"]
|
||||||
crate = "windows_i686_gnu"
|
crate = "windows_i686_gnu"
|
||||||
|
|||||||
@@ -542,8 +542,8 @@ fn from_rgba(
|
|||||||
//
|
//
|
||||||
// We call `createImageBitmap()` before spawning the future,
|
// We call `createImageBitmap()` before spawning the future,
|
||||||
// to not have to clone the image buffer.
|
// to not have to clone the image buffer.
|
||||||
let mut options = ImageBitmapOptions::new();
|
let options = ImageBitmapOptions::new();
|
||||||
options.premultiply_alpha(PremultiplyAlpha::None);
|
options.set_premultiply_alpha(PremultiplyAlpha::None);
|
||||||
let bitmap = JsFuture::from(
|
let bitmap = JsFuture::from(
|
||||||
window
|
window
|
||||||
.create_image_bitmap_with_image_data_and_image_bitmap_options(&image_data, &options)
|
.create_image_bitmap_with_image_data_and_image_bitmap_options(&image_data, &options)
|
||||||
|
|||||||
@@ -4,8 +4,7 @@ use std::iter;
|
|||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
use std::rc::{Rc, Weak};
|
use std::rc::{Rc, Weak};
|
||||||
|
|
||||||
use js_sys::Function;
|
use wasm_bindgen::prelude::Closure;
|
||||||
use wasm_bindgen::prelude::{wasm_bindgen, Closure};
|
|
||||||
use wasm_bindgen::JsCast;
|
use wasm_bindgen::JsCast;
|
||||||
use web_sys::{Document, KeyboardEvent, Navigator, PageTransitionEvent, PointerEvent, WheelEvent};
|
use web_sys::{Document, KeyboardEvent, Navigator, PageTransitionEvent, PointerEvent, WheelEvent};
|
||||||
use web_time::{Duration, Instant};
|
use web_time::{Duration, Instant};
|
||||||
@@ -495,14 +494,8 @@ impl Shared {
|
|||||||
if let Ok(RunnerEnum::Running(_)) =
|
if let Ok(RunnerEnum::Running(_)) =
|
||||||
self.0.runner.try_borrow().as_ref().map(Deref::deref)
|
self.0.runner.try_borrow().as_ref().map(Deref::deref)
|
||||||
{
|
{
|
||||||
#[wasm_bindgen]
|
self.window().queue_microtask(
|
||||||
extern "C" {
|
&Closure::once_into_js({
|
||||||
#[wasm_bindgen(js_name = queueMicrotask)]
|
|
||||||
fn queue_microtask(task: Function);
|
|
||||||
}
|
|
||||||
|
|
||||||
queue_microtask(
|
|
||||||
Closure::once_into_js({
|
|
||||||
let this = Rc::downgrade(&self.0);
|
let this = Rc::downgrade(&self.0);
|
||||||
move || {
|
move || {
|
||||||
if let Some(shared) = this.upgrade() {
|
if let Some(shared) = this.upgrade() {
|
||||||
|
|||||||
@@ -138,10 +138,9 @@ impl ResizeScaleInternal {
|
|||||||
|
|
||||||
// Safari doesn't support `devicePixelContentBoxSize`
|
// Safari doesn't support `devicePixelContentBoxSize`
|
||||||
if has_device_pixel_support() {
|
if has_device_pixel_support() {
|
||||||
observer.observe_with_options(
|
let options = ResizeObserverOptions::new();
|
||||||
canvas,
|
options.set_box(ResizeObserverBoxOptions::DevicePixelContentBox);
|
||||||
ResizeObserverOptions::new().box_(ResizeObserverBoxOptions::DevicePixelContentBox),
|
observer.observe_with_options(canvas, &options);
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
observer.observe(canvas);
|
observer.observe(canvas);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -275,8 +275,8 @@ struct ScriptUrl(String);
|
|||||||
impl ScriptUrl {
|
impl ScriptUrl {
|
||||||
fn new(script: &str) -> Self {
|
fn new(script: &str) -> Self {
|
||||||
let sequence = Array::of1(&script.into());
|
let sequence = Array::of1(&script.into());
|
||||||
let mut property = BlobPropertyBag::new();
|
let property = BlobPropertyBag::new();
|
||||||
property.type_("text/javascript");
|
property.set_type("text/javascript");
|
||||||
let blob = Blob::new_with_str_sequence_and_options(&sequence, &property)
|
let blob = Blob::new_with_str_sequence_and_options(&sequence, &property)
|
||||||
.expect("`new Blob()` should never throw");
|
.expect("`new Blob()` should never throw");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user