From 1eaff8f0fd75cb42436b4265a2262023a94fffdd Mon Sep 17 00:00:00 2001 From: Philipp Mildenberger Date: Sun, 1 Dec 2024 21:35:11 +0100 Subject: [PATCH] xilem_web: Update dependencies, and support `style` for `MathMlElement`s (#765) As noted in https://github.com/linebender/xilem/pull/621#issuecomment-2405688142, https://github.com/rustwasm/wasm-bindgen/pull/4143 is now added in wasm_bindgen 0.2.96. This PR updates all the dependencies of xilem_web and finally correctly supports `style` for `MathMlElement`. --- Cargo.lock | 34 ++++++++++--------- xilem_web/Cargo.toml | 7 ++-- xilem_web/src/modifiers/style.rs | 4 +++ xilem_web/web_examples/counter/Cargo.toml | 4 +-- .../counter_custom_element/Cargo.toml | 4 +-- xilem_web/web_examples/fetch/Cargo.toml | 4 +-- xilem_web/web_examples/mathml_svg/Cargo.toml | 4 +-- .../web_examples/raw_dom_access/Cargo.toml | 2 +- xilem_web/web_examples/svgdraw/Cargo.toml | 4 +-- xilem_web/web_examples/svgtoy/Cargo.toml | 4 +-- xilem_web/web_examples/todomvc/Cargo.toml | 4 +-- 11 files changed, 41 insertions(+), 34 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 874bd41fc..01c15046b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1821,10 +1821,11 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.72" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" +checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -3889,9 +3890,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c" dependencies = [ "cfg-if", "once_cell", @@ -3900,9 +3901,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd" dependencies = [ "bumpalo", "log", @@ -3915,21 +3916,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.45" +version = "0.4.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" +checksum = "9dfaf8f50e5f293737ee323940c7d8b08a66a95a419223d9f41610ca08b0833d" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3937,9 +3939,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d" dependencies = [ "proc-macro2", "quote", @@ -3950,9 +3952,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" +checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49" [[package]] name = "wayland-backend" @@ -4065,9 +4067,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.72" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +checksum = "a98bc3c33f0fe7e59ad7cd041b89034fa82a7c2d4365ca538dda6cdaf513863c" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/xilem_web/Cargo.toml b/xilem_web/Cargo.toml index 3d813e712..54b21a116 100644 --- a/xilem_web/Cargo.toml +++ b/xilem_web/Cargo.toml @@ -21,10 +21,10 @@ targets = [] workspace = true [dependencies] -futures = "0.3.30" +futures = "0.3.31" peniko.workspace = true -wasm-bindgen = "0.2.92" -wasm-bindgen-futures = "0.4.42" +wasm-bindgen = "0.2.97" +wasm-bindgen-futures = "0.4.47" xilem_core = { workspace = true, features = ["kurbo"] } [dependencies.web-sys] @@ -44,6 +44,7 @@ features = [ "ResizeObserver", "ResizeObserverEntry", "DomRectReadOnly", + "MathMlElement", "SvgElement", "SvgaElement", "SvgAnimateElement", diff --git a/xilem_web/src/modifiers/style.rs b/xilem_web/src/modifiers/style.rs index 5290c50f4..3e3555ede 100644 --- a/xilem_web/src/modifiers/style.rs +++ b/xilem_web/src/modifiers/style.rs @@ -154,6 +154,8 @@ fn set_style(element: &web_sys::Element, name: &str, value: &str) { el.style().set_property(name, value).unwrap_throw(); } else if let Some(el) = element.dyn_ref::() { el.style().set_property(name, value).unwrap_throw(); + } else if let Some(el) = element.dyn_ref::() { + el.style().set_property(name, value).unwrap_throw(); } } @@ -162,6 +164,8 @@ fn remove_style(element: &web_sys::Element, name: &str) { el.style().remove_property(name).unwrap_throw(); } else if let Some(el) = element.dyn_ref::() { el.style().remove_property(name).unwrap_throw(); + } else if let Some(el) = element.dyn_ref::() { + el.style().remove_property(name).unwrap_throw(); } } diff --git a/xilem_web/web_examples/counter/Cargo.toml b/xilem_web/web_examples/counter/Cargo.toml index ad7f81103..69a044247 100644 --- a/xilem_web/web_examples/counter/Cargo.toml +++ b/xilem_web/web_examples/counter/Cargo.toml @@ -11,6 +11,6 @@ workspace = true [dependencies] console_error_panic_hook = "0.1" -wasm-bindgen = "0.2.92" -web-sys = "0.3.72" +wasm-bindgen = "0.2.97" +web-sys = "0.3.74" xilem_web = { path = "../.." } diff --git a/xilem_web/web_examples/counter_custom_element/Cargo.toml b/xilem_web/web_examples/counter_custom_element/Cargo.toml index 1e9bbbbb2..3135e94ad 100644 --- a/xilem_web/web_examples/counter_custom_element/Cargo.toml +++ b/xilem_web/web_examples/counter_custom_element/Cargo.toml @@ -11,6 +11,6 @@ workspace = true [dependencies] console_error_panic_hook = "0.1" -wasm-bindgen = "0.2.92" -web-sys = "0.3.69" +wasm-bindgen = "0.2.97" +web-sys = "0.3.74" xilem_web = { path = "../.." } diff --git a/xilem_web/web_examples/fetch/Cargo.toml b/xilem_web/web_examples/fetch/Cargo.toml index a56c22d8c..446694b7d 100644 --- a/xilem_web/web_examples/fetch/Cargo.toml +++ b/xilem_web/web_examples/fetch/Cargo.toml @@ -15,6 +15,6 @@ console_log = "1" gloo-net = { version = "0.6.0", default-features = false, features = ["http", "json", "serde"] } log = "0.4" serde = { version = "1", features = ["derive"] } -web-sys = { version = "0.3.69", features = ["Event", "HtmlInputElement"] } -wasm-bindgen = "0.2.92" +web-sys = { version = "0.3.74", features = ["Event", "HtmlInputElement"] } +wasm-bindgen = "0.2.97" xilem_web = { path = "../.." } diff --git a/xilem_web/web_examples/mathml_svg/Cargo.toml b/xilem_web/web_examples/mathml_svg/Cargo.toml index 730bb6f44..4c2c5d7e6 100644 --- a/xilem_web/web_examples/mathml_svg/Cargo.toml +++ b/xilem_web/web_examples/mathml_svg/Cargo.toml @@ -11,6 +11,6 @@ workspace = true [dependencies] console_error_panic_hook = "0.1" -wasm-bindgen = "0.2.92" -web-sys = "0.3.69" +wasm-bindgen = "0.2.97" +web-sys = "0.3.74" xilem_web = { path = "../.." } diff --git a/xilem_web/web_examples/raw_dom_access/Cargo.toml b/xilem_web/web_examples/raw_dom_access/Cargo.toml index 6f66adda9..f6c66d41b 100644 --- a/xilem_web/web_examples/raw_dom_access/Cargo.toml +++ b/xilem_web/web_examples/raw_dom_access/Cargo.toml @@ -10,5 +10,5 @@ rust-version.workspace = true console_error_panic_hook = "0.1" console_log = "1.0.0" log = "0.4.22" -web-sys = "0.3.69" +web-sys = "0.3.74" xilem_web = { path = "../.." } diff --git a/xilem_web/web_examples/svgdraw/Cargo.toml b/xilem_web/web_examples/svgdraw/Cargo.toml index ec83c941f..a08cc97ec 100644 --- a/xilem_web/web_examples/svgdraw/Cargo.toml +++ b/xilem_web/web_examples/svgdraw/Cargo.toml @@ -11,6 +11,6 @@ workspace = true [dependencies] console_error_panic_hook = "0.1" -wasm-bindgen = "0.2.92" -web-sys = "0.3.69" +wasm-bindgen = "0.2.97" +web-sys = "0.3.74" xilem_web = { path = "../.." } diff --git a/xilem_web/web_examples/svgtoy/Cargo.toml b/xilem_web/web_examples/svgtoy/Cargo.toml index 2c336e919..847a20e3c 100644 --- a/xilem_web/web_examples/svgtoy/Cargo.toml +++ b/xilem_web/web_examples/svgtoy/Cargo.toml @@ -11,6 +11,6 @@ workspace = true [dependencies] console_error_panic_hook = "0.1" -wasm-bindgen = "0.2.92" -web-sys = "0.3.69" +wasm-bindgen = "0.2.97" +web-sys = "0.3.74" xilem_web = { path = "../.." } diff --git a/xilem_web/web_examples/todomvc/Cargo.toml b/xilem_web/web_examples/todomvc/Cargo.toml index 196b6e162..99235cee0 100644 --- a/xilem_web/web_examples/todomvc/Cargo.toml +++ b/xilem_web/web_examples/todomvc/Cargo.toml @@ -15,6 +15,6 @@ serde = { version = "1.0.204", features = ["derive"] } serde_json = "1.0.120" tracing = "0.1.40" tracing-wasm = "0.2.1" -wasm-bindgen = "0.2.92" -web-sys = { version = "0.3.69", features = ["Storage", "Window"] } +wasm-bindgen = "0.2.97" +web-sys = { version = "0.3.74", features = ["Storage", "Window"] } xilem_web = { path = "../.." }