aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/element.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2014-04-18 00:12:52 -0400
committerJosh Matthews <josh@joshmatthews.net>2014-05-03 14:18:31 -0400
commit0f2d0b1dc3d98ef109627dda061c5a54ff06a91d (patch)
treea698b4eb0829079f09ad862c43a4eb1101c78e40 /src/components/script/dom/element.rs
parent7b3e6d1f2125faf598919722b72cc56197d0102c (diff)
downloadservo-0f2d0b1dc3d98ef109627dda061c5a54ff06a91d.tar.gz
servo-0f2d0b1dc3d98ef109627dda061c5a54ff06a91d.zip
Address review comments.
Diffstat (limited to 'src/components/script/dom/element.rs')
-rw-r--r--src/components/script/dom/element.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/components/script/dom/element.rs b/src/components/script/dom/element.rs
index f316b1765f6..0e5795a69a0 100644
--- a/src/components/script/dom/element.rs
+++ b/src/components/script/dom/element.rs
@@ -9,7 +9,7 @@ use dom::attrlist::AttrList;
use dom::bindings::codegen::BindingDeclarations::ElementBinding;
use dom::bindings::codegen::InheritTypes::{ElementDerived, NodeCast};
use dom::bindings::js::{JS, JSRef, Temporary, TemporaryPushable};
-use dom::bindings::js::{OptionalAssignable, OptionalRootable, Root};
+use dom::bindings::js::{OptionalSettable, OptionalRootable, Root};
use dom::bindings::utils::{Reflectable, Reflector};
use dom::bindings::error::{ErrorResult, Fallible, NamespaceError, InvalidCharacter};
use dom::bindings::utils::{QName, Name, InvalidXMLName, xml_name_type};
@@ -141,7 +141,7 @@ pub enum ElementTypeId {
//
impl Element {
- pub fn new_inherited(type_id: ElementTypeId, local_name: DOMString, namespace: Namespace, prefix: Option<DOMString>, document: JS<Document>) -> Element {
+ pub fn new_inherited(type_id: ElementTypeId, local_name: DOMString, namespace: Namespace, prefix: Option<DOMString>, document: &JSRef<Document>) -> Element {
Element {
node: Node::new_inherited(ElementNodeTypeId(type_id), document),
local_name: local_name,
@@ -154,7 +154,7 @@ impl Element {
}
pub fn new(local_name: DOMString, namespace: Namespace, prefix: Option<DOMString>, document: &JSRef<Document>) -> Temporary<Element> {
- let element = Element::new_inherited(ElementTypeId, local_name, namespace, prefix, document.unrooted());
+ let element = Element::new_inherited(ElementTypeId, local_name, namespace, prefix, document);
Node::reflect_node(~element, document, ElementBinding::Wrap)
}
}
@@ -230,11 +230,11 @@ impl<'a> AttributeHandlers for JSRef<'a, Element> {
if self.html_element_in_html_document() {
self.get().attrs.iter().map(|attr| attr.root()).find(|attr| {
name.to_ascii_lower() == attr.local_name && attr.namespace == namespace
- }).map(|x| Temporary::new_rooted(&*x))
+ }).map(|x| Temporary::from_rooted(&*x))
} else {
self.get().attrs.iter().map(|attr| attr.root()).find(|attr| {
name == attr.local_name && attr.namespace == namespace
- }).map(|x| Temporary::new_rooted(&*x))
+ }).map(|x| Temporary::from_rooted(&*x))
}
}
@@ -282,7 +282,7 @@ impl<'a> AttributeHandlers for JSRef<'a, Element> {
let window = window_from_node(self).root();
let attr = Attr::new(&*window, local_name.clone(), value.clone(),
name, namespace.clone(), prefix, self);
- self.get_mut().attrs.push_unrooted(attr);
+ self.get_mut().attrs.push_unrooted(&attr);
(self.get().attrs.len() - 1, FirstSetAttr)
}
};