aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2014-06-08 14:35:55 +0200
committerMs2ger <ms2ger@gmail.com>2014-06-08 17:09:22 +0200
commitefe69f3a828efe3452bca356ece0393dd1cf1ed3 (patch)
tree72f39c8c24aae9c49f585ae24cfaf5c08a1e1afb /src
parent743dcee0f59d63bfbb820df2412c8e2267b38f66 (diff)
downloadservo-efe69f3a828efe3452bca356ece0393dd1cf1ed3.tar.gz
servo-efe69f3a828efe3452bca356ece0393dd1cf1ed3.zip
Make Attr::value private.
Diffstat (limited to 'src')
-rw-r--r--src/components/script/dom/attr.rs2
-rw-r--r--src/components/script/dom/element.rs4
-rw-r--r--src/components/script/dom/htmlserializer.rs2
-rw-r--r--src/components/script/dom/node.rs4
4 files changed, 6 insertions, 6 deletions
diff --git a/src/components/script/dom/attr.rs b/src/components/script/dom/attr.rs
index 741c5592732..7d75c281e01 100644
--- a/src/components/script/dom/attr.rs
+++ b/src/components/script/dom/attr.rs
@@ -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>,
diff --git a/src/components/script/dom/element.rs b/src/components/script/dom/element.rs
index 742463b597e..088bf6b14f6 100644
--- a/src/components/script/dom/element.rs
+++ b/src/components/script/dom/element.rs
@@ -173,9 +173,9 @@ impl RawLayoutElementHelpers for Element {
(*attrs).iter().find(|attr: & &JS<Attr>| {
let attr = attr.unsafe_get();
name == (*attr).local_name.as_slice() && (*attr).namespace == *namespace
- }).map(|attr| {
+ }).map(|attr| {
let attr = attr.unsafe_get();
- mem::transmute((*attr).value.as_slice())
+ mem::transmute((*attr).value_ref())
})
}
}
diff --git a/src/components/script/dom/htmlserializer.rs b/src/components/script/dom/htmlserializer.rs
index a1c6d709a47..e592377b852 100644
--- a/src/components/script/dom/htmlserializer.rs
+++ b/src/components/script/dom/htmlserializer.rs
@@ -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('"');
}
diff --git a/src/components/script/dom/node.rs b/src/components/script/dom/node.rs
index e98ee029bb4..91e666d1e61 100644
--- a/src/components/script/dom/node.rs
+++ b/src/components/script/dom/node.rs
@@ -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())
})
})
}