Update minimum version of wasm-bindgen (#3860)
This commit is contained in:
parent
92e9bfe0fc
commit
d96fd02f33
6 changed files with 14 additions and 35 deletions
|
|
@ -542,8 +542,8 @@ fn from_rgba(
|
|||
//
|
||||
// We call `createImageBitmap()` before spawning the future,
|
||||
// to not have to clone the image buffer.
|
||||
let mut options = ImageBitmapOptions::new();
|
||||
options.premultiply_alpha(PremultiplyAlpha::None);
|
||||
let options = ImageBitmapOptions::new();
|
||||
options.set_premultiply_alpha(PremultiplyAlpha::None);
|
||||
let bitmap = JsFuture::from(
|
||||
window
|
||||
.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::rc::{Rc, Weak};
|
||||
|
||||
use js_sys::Function;
|
||||
use wasm_bindgen::prelude::{wasm_bindgen, Closure};
|
||||
use wasm_bindgen::prelude::Closure;
|
||||
use wasm_bindgen::JsCast;
|
||||
use web_sys::{Document, KeyboardEvent, Navigator, PageTransitionEvent, PointerEvent, WheelEvent};
|
||||
use web_time::{Duration, Instant};
|
||||
|
|
@ -495,14 +494,8 @@ impl Shared {
|
|||
if let Ok(RunnerEnum::Running(_)) =
|
||||
self.0.runner.try_borrow().as_ref().map(Deref::deref)
|
||||
{
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
#[wasm_bindgen(js_name = queueMicrotask)]
|
||||
fn queue_microtask(task: Function);
|
||||
}
|
||||
|
||||
queue_microtask(
|
||||
Closure::once_into_js({
|
||||
self.window().queue_microtask(
|
||||
&Closure::once_into_js({
|
||||
let this = Rc::downgrade(&self.0);
|
||||
move || {
|
||||
if let Some(shared) = this.upgrade() {
|
||||
|
|
|
|||
|
|
@ -138,10 +138,9 @@ impl ResizeScaleInternal {
|
|||
|
||||
// Safari doesn't support `devicePixelContentBoxSize`
|
||||
if has_device_pixel_support() {
|
||||
observer.observe_with_options(
|
||||
canvas,
|
||||
ResizeObserverOptions::new().box_(ResizeObserverBoxOptions::DevicePixelContentBox),
|
||||
);
|
||||
let options = ResizeObserverOptions::new();
|
||||
options.set_box(ResizeObserverBoxOptions::DevicePixelContentBox);
|
||||
observer.observe_with_options(canvas, &options);
|
||||
} else {
|
||||
observer.observe(canvas);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -275,8 +275,8 @@ struct ScriptUrl(String);
|
|||
impl ScriptUrl {
|
||||
fn new(script: &str) -> Self {
|
||||
let sequence = Array::of1(&script.into());
|
||||
let mut property = BlobPropertyBag::new();
|
||||
property.type_("text/javascript");
|
||||
let property = BlobPropertyBag::new();
|
||||
property.set_type("text/javascript");
|
||||
let blob = Blob::new_with_str_sequence_and_options(&sequence, &property)
|
||||
.expect("`new Blob()` should never throw");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue