Skip to content

Commit

Permalink
xilem_web: Update dependencies, and support style for `MathMlElemen…
Browse files Browse the repository at this point in the history
…t`s (#765)

As noted in
#621 (comment),
rustwasm/wasm-bindgen#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`.
  • Loading branch information
Philipp-M authored Dec 1, 2024
1 parent e9edd38 commit 1eaff8f
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 34 deletions.
34 changes: 18 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions xilem_web/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -44,6 +44,7 @@ features = [
"ResizeObserver",
"ResizeObserverEntry",
"DomRectReadOnly",
"MathMlElement",
"SvgElement",
"SvgaElement",
"SvgAnimateElement",
Expand Down
4 changes: 4 additions & 0 deletions xilem_web/src/modifiers/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<web_sys::SvgElement>() {
el.style().set_property(name, value).unwrap_throw();
} else if let Some(el) = element.dyn_ref::<web_sys::MathMlElement>() {
el.style().set_property(name, value).unwrap_throw();
}
}

Expand All @@ -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::<web_sys::SvgElement>() {
el.style().remove_property(name).unwrap_throw();
} else if let Some(el) = element.dyn_ref::<web_sys::MathMlElement>() {
el.style().remove_property(name).unwrap_throw();
}
}

Expand Down
4 changes: 2 additions & 2 deletions xilem_web/web_examples/counter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "../.." }
4 changes: 2 additions & 2 deletions xilem_web/web_examples/counter_custom_element/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "../.." }
4 changes: 2 additions & 2 deletions xilem_web/web_examples/fetch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "../.." }
4 changes: 2 additions & 2 deletions xilem_web/web_examples/mathml_svg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "../.." }
2 changes: 1 addition & 1 deletion xilem_web/web_examples/raw_dom_access/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "../.." }
4 changes: 2 additions & 2 deletions xilem_web/web_examples/svgdraw/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "../.." }
4 changes: 2 additions & 2 deletions xilem_web/web_examples/svgtoy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "../.." }
4 changes: 2 additions & 2 deletions xilem_web/web_examples/todomvc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "../.." }

0 comments on commit 1eaff8f

Please sign in to comment.