Use internal mutability for Document::{quirks_mode, encoding_name}.

This commit is contained in:
Ms2ger 2014-06-10 17:48:42 +02:00
parent e9b64dc361
commit 23a6b6823b
2 changed files with 16 additions and 16 deletions

View file

@ -1284,8 +1284,8 @@ impl Node {
match node.type_id() {
DocumentNodeTypeId => {
let node_doc: &JSRef<Document> = DocumentCast::to_ref(node).unwrap();
let copy_doc: &mut JSRef<Document> = DocumentCast::to_mut_ref(&mut *copy).unwrap();
copy_doc.set_encoding_name(node_doc.encoding_name.clone());
let copy_doc: &JSRef<Document> = DocumentCast::to_ref(&*copy).unwrap();
copy_doc.set_encoding_name(node_doc.encoding_name.deref().borrow().clone());
copy_doc.set_quirks_mode(node_doc.quirks_mode());
},
ElementNodeTypeId(..) => {