Make Attr::value private.

This commit is contained in:
Ms2ger 2014-06-08 14:35:55 +02:00
parent 743dcee0f5
commit efe69f3a82
4 changed files with 6 additions and 6 deletions

View file

@ -24,7 +24,7 @@ pub enum AttrSettingType {
pub struct Attr {
pub reflector_: Reflector,
pub local_name: DOMString,
pub value: DOMString,
value: DOMString,
pub name: DOMString,
pub namespace: Namespace,
pub prefix: Option<DOMString>,

View file

@ -175,7 +175,7 @@ impl RawLayoutElementHelpers for Element {
name == (*attr).local_name.as_slice() && (*attr).namespace == *namespace
}).map(|attr| {
let attr = attr.unsafe_get();
mem::transmute((*attr).value.as_slice())
mem::transmute((*attr).value_ref())
})
}
}

View file

@ -151,7 +151,7 @@ fn serialize_attr(attr: &JSRef<Attr>, html: &mut String) {
html.push_str(attr.deref().name.as_slice());
};
html.push_str("=\"");
escape(attr.deref().value.as_slice(), true, html);
escape(attr.deref().value_ref(), true, html);
html.push_char('"');
}

View file

@ -1300,7 +1300,7 @@ impl Node {
for attr in node_elem.attrs.borrow().iter().map(|attr| attr.root()) {
copy_elem.attrs.borrow_mut().push_unrooted(
&Attr::new(&*window,
attr.deref().local_name.clone(), attr.deref().value.clone(),
attr.deref().local_name.clone(), attr.deref().value_ref().to_string(),
attr.deref().name.clone(), attr.deref().namespace.clone(),
attr.deref().prefix.clone(), &copy_elem_alias));
}
@ -1792,7 +1792,7 @@ impl<'a> NodeMethods for JSRef<'a, Node> {
other_element.attrs.borrow().iter().map(|attr| attr.root()).any(|other_attr| {
(attr.namespace == other_attr.namespace) &&
(attr.local_name == other_attr.local_name) &&
(attr.value == other_attr.value)
(attr.deref().value_ref() == other_attr.deref().value_ref())
})
})
}