Remove unsound Root::deref() call in Attr::set_value.

This changes those calls whose unsoundness was not picked up by the type system
because of a lifetime constraint that cannot be expressed at this time.
This commit is contained in:
Ms2ger 2015-01-01 12:21:08 +01:00
parent 1dad710063
commit a094c0a7f3

View file

@ -8,6 +8,7 @@ use dom::bindings::codegen::Bindings::AttrBinding::AttrMethods;
use dom::bindings::codegen::InheritTypes::NodeCast;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JS, JSRef, Temporary};
use dom::bindings::js::{OptionalRootedRootable, RootedReference};
use dom::bindings::utils::{Reflector, reflect_dom_object};
use dom::element::{Element, AttributeHandlers};
use dom::node::Node;
@ -207,7 +208,7 @@ pub trait AttrHelpers<'a> {
impl<'a> AttrHelpers<'a> for JSRef<'a, Attr> {
fn set_value(self, set_type: AttrSettingType, value: AttrValue, owner: JSRef<Element>) {
assert!(Some(owner) == self.owner.map(|o| *o.root()));
assert!(Some(owner) == self.owner.root().r());
let node: JSRef<Node> = NodeCast::from_ref(owner);
let namespace_is_null = self.namespace == ns!("");