on master help sign in
Fix compiler issues
f5d3d53Ryan Levick
js/change-list.js+1−3
@@ -191,12 +191,10 @@ const OP_TABLE = [
191 function setAttributeNS(changeList, mem8, mem32, i) {
191 function setAttributeNS(changeList, mem8, mem32, i) {
192 const nameId = mem32[i++];
192 const nameId = mem32[i++];
193 const valueId = mem32[i++];
193 const valueId = mem32[i++];
194− const nsId = mem32[i++];
195 const name = changeList.getString(nameId);
194 const name = changeList.getString(nameId);
196 const value = changeList.getString(valueId);
195 const value = changeList.getString(valueId);
197− const ns = changeList.getString(nsId);
198 const node = top(changeList.stack);
196 const node = top(changeList.stack);
199− node.setAttributeNS(ns, name, value);
197+ node.setAttributeNS(null, name, value);
200 return i;
198 return i;
201 }
199 }
202];
200];
src/change_list.rs+3−4
@@ -379,12 +379,11 @@ impl ChangeList {
379 self.op2(ChangeDiscriminant::SetAttribute, name_id, value_id);
379 self.op2(ChangeDiscriminant::SetAttribute, name_id, value_id);
380 }
380 }
381
381
382− pub(crate) fn emit_set_attribute_ns(&mut self, name: &str, value: &str, ns: &str) {
382+ pub(crate) fn emit_set_attribute_ns(&mut self, name: &str, value: &str) {
383− debug!("emit_set_attribute_ns({:?}, {:?})", name, value, ns);
383+ debug!("emit_set_attribute_ns({:?}, {:?}", name, value);
384− let ns_id = self.ensure_string(ns);
385 let name_id = self.ensure_string(name);
384 let name_id = self.ensure_string(name);
386 let value_id = self.ensure_string(value);
385 let value_id = self.ensure_string(value);
387− self.op3(ChangeDiscriminant::SetAttributeNS, name_id, value_id, ns_id);
386+ self.op2(ChangeDiscriminant::SetAttributeNS, name_id, value_id);
388 }
387 }
389
388
390 pub(crate) fn emit_remove_attribute(&mut self, name: &str) {
389 pub(crate) fn emit_remove_attribute(&mut self, name: &str) {
src/vdom.rs+3−6
@@ -476,12 +476,9 @@ impl VdomInnerExclusive {
476 self.change_list.emit_new_event_listener(l);
476 self.change_list.emit_new_event_listener(l);
477 }
477 }
478 for attr in attributes {
478 for attr in attributes {
479− if ["svg", "path"].contains(&tag_name) {
479+ if ["svg", "path"].contains(&tag_name) && attr.name != "xmlns" {
480− self.change_list.emit_set_attribute_ns(
480+ self.change_list
481− &attr.name,
481+ .emit_set_attribute_ns(&attr.name, &attr.value);
482− &attr.value,
483− "http://www.w3.org/2000/svg",
484− );
485 } else {
482 } else {
486 self.change_list.emit_set_attribute(&attr.name, &attr.value);
483 self.change_list.emit_set_attribute(&attr.name, &attr.value);
487 }
484 }