on master help sign in
Fix compiler issues
commitf5d3d530cc0932fa38f1283365750b52c9fbe0d4 authorRyan Levick <ryan.levick@gmail.com> dateFri 15 Mar 2019, 17:41 (8 years ago) parent036593f
3 files changed+7−13
js/change-list.js+1−3 src/change_list.rs+3−4 src/vdom.rs+3−6
js/change-list.js+1−3
@@ -191,12 +191,10 @@ const OP_TABLE = [
191191 function setAttributeNS(changeList, mem8, mem32, i) {
192192 const nameId = mem32[i++];
193193 const valueId = mem32[i++];
194− const nsId = mem32[i++];
195194 const name = changeList.getString(nameId);
196195 const value = changeList.getString(valueId);
197− const ns = changeList.getString(nsId);
198196 const node = top(changeList.stack);
199− node.setAttributeNS(ns, name, value);
197+ node.setAttributeNS(null, name, value);
200198 return i;
201199 }
202200];
src/change_list.rs+3−4
@@ -379,12 +379,11 @@ impl ChangeList {
379379 self.op2(ChangeDiscriminant::SetAttribute, name_id, value_id);
380380 }
381381
382− pub(crate) fn emit_set_attribute_ns(&mut self, name: &str, value: &str, ns: &str) {
383− debug!("emit_set_attribute_ns({:?}, {:?})", name, value, ns);
384− let ns_id = self.ensure_string(ns);
382+ pub(crate) fn emit_set_attribute_ns(&mut self, name: &str, value: &str) {
383+ debug!("emit_set_attribute_ns({:?}, {:?}", name, value);
385384 let name_id = self.ensure_string(name);
386385 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);
388387 }
389388
390389 pub(crate) fn emit_remove_attribute(&mut self, name: &str) {
src/vdom.rs+3−6
@@ -476,12 +476,9 @@ impl VdomInnerExclusive {
476476 self.change_list.emit_new_event_listener(l);
477477 }
478478 for attr in attributes {
479− if ["svg", "path"].contains(&tag_name) {
480− self.change_list.emit_set_attribute_ns(
481− &attr.name,
482− &attr.value,
483− "http://www.w3.org/2000/svg",
484− );
479+ if ["svg", "path"].contains(&tag_name) && attr.name != "xmlns" {
480+ self.change_list
481+ .emit_set_attribute_ns(&attr.name, &attr.value);
485482 } else {
486483 self.change_list.emit_set_attribute(&attr.name, &attr.value);
487484 }