wip: cleanup
This commit is contained in:
1 parent
6051b0ec86
commit
1745a44d94
8 files changed
+105
-30
No files matched your search
@@ -17,7 +17,6 @@ wasm-bindgen-futures = "0.4.20"
|
||||
wasm-logger = "0.2.0"
|
||||
log = "0.4.14"
|
||||
fxhash = "0.2.1"
|
||||
pretty_env_logger = "0.4.0"
|
||||
console_error_panic_hook = "0.1.6"
|
||||
generational-arena = "0.2.8"
|
||||
wasm-bindgen-test = "0.3.21"
|
||||
@@ -60,6 +59,8 @@ features = [
|
||||
"CompositionEvent",
|
||||
"DocumentType",
|
||||
"CharacterData",
|
||||
"SvgElement",
|
||||
"SvgAnimatedString",
|
||||
"HtmlOptionElement",
|
||||
]
|
||||
|
||||
|
||||
+14
-2
@@ -294,8 +294,20 @@ impl WebsysDom {
|
||||
|
||||
fn set_attribute(&mut self, name: &str, value: &str, ns: Option<&str>) {
|
||||
if name == "class" {
|
||||
if let Some(el) = self.stack.top().dyn_ref::<Element>() {
|
||||
el.set_class_name(value);
|
||||
match ns {
|
||||
Some("http://www.w3.org/2000/svg") => {
|
||||
//
|
||||
if let Some(el) = self.stack.top().dyn_ref::<web_sys::SvgElement>() {
|
||||
let r: web_sys::SvgAnimatedString = el.class_name();
|
||||
r.set_base_val(value);
|
||||
// el.set_class_name(value);
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
if let Some(el) = self.stack.top().dyn_ref::<Element>() {
|
||||
el.set_class_name(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if let Some(el) = self.stack.top().dyn_ref::<Element>() {
|
||||
|
||||
Reference in new issue
Block a user