Use Cell/RefCell for interior mutability of Element.

This commit is contained in:
Tetsuharu OHZEKI 2014-05-28 05:15:00 +09:00
parent 6d9dcd087a
commit b0239b5a5a
3 changed files with 31 additions and 24 deletions

View file

@ -106,7 +106,7 @@ fn serialize_doctype(doctype: &JSRef<DocumentType>, html: &mut StrBuf) {
fn serialize_elem(elem: &JSRef<Element>, open_elements: &mut Vec<~str>, html: &mut StrBuf) {
html.push_char('<');
html.push_str(elem.deref().local_name);
for attr in elem.deref().attrs.iter() {
for attr in elem.deref().attrs.borrow().iter() {
let attr = attr.root();
serialize_attr(&*attr, html);
};