Ensure that it's safe to modify the DOM node pointers before doing so. Fixes #1224.

This commit is contained in:
Josh Matthews 2013-11-14 03:54:19 +09:00
parent 7dbabdd9e4
commit f9f9c42ab7
3 changed files with 20 additions and 7 deletions

View file

@ -212,6 +212,8 @@ impl<'self> Element {
None => {}
}
self.node.wait_until_safe_to_modify_dom();
// FIXME: reduce the time of `value.clone()`.
let win = self.node.owner_doc().document().window;
let new_attr = Attr::new_ns(win, local_name.clone(), value.clone(),