aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/attr.rs
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2015-01-01 12:21:08 +0100
committerMs2ger <ms2ger@gmail.com>2015-01-01 20:36:44 +0100
commita094c0a7f3be56c1d510e861562a8b4c08d92c47 (patch)
tree49bbd39d8833ac94c86ceea7a59df605a76af842 /components/script/dom/attr.rs
parent1dad710063e601d3560b0cf89c602d16a0a48657 (diff)
downloadservo-a094c0a7f3be56c1d510e861562a8b4c08d92c47.tar.gz
servo-a094c0a7f3be56c1d510e861562a8b4c08d92c47.zip
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.
Diffstat (limited to 'components/script/dom/attr.rs')
-rw-r--r--components/script/dom/attr.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/components/script/dom/attr.rs b/components/script/dom/attr.rs
index 028a91ea422..9a062679a4f 100644
--- a/components/script/dom/attr.rs
+++ b/components/script/dom/attr.rs
@@ -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!("");