diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index d9f995720a8..fab5feff560 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -1084,11 +1084,13 @@ impl<'a> VirtualMethods for JSRef<'a, Element> { impl<'a> style::TElement<'a> for JSRef<'a, Element> { fn get_attr(self, namespace: &Namespace, attr: &Atom) -> Option<&'a str> { self.get_attribute(namespace.clone(), attr).root().map(|attr| { + // This transmute is used to cheat the lifetime restriction. unsafe { mem::transmute(attr.value().as_slice()) } }) } fn get_attrs(self, attr: &Atom) -> Vec<&'a str> { self.get_attributes(attr).iter().map(|attr| attr.root()).map(|attr| { + // This transmute is used to cheat the lifetime restriction. unsafe { mem::transmute(attr.value().as_slice()) } }).collect() }