aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/document.rs
diff options
context:
space:
mode:
authorJack Moffitt <jack@metajack.im>2014-01-22 17:02:21 -0700
committerJack Moffitt <jack@metajack.im>2014-01-22 17:02:21 -0700
commitc443bcbfff2a68e0f37dba7e20fe752d6d8fa2d8 (patch)
treef3583c22c2d377dc8f987cd817ac41b7de3d966c /src/components/script/dom/document.rs
parent539cf58f732e62be3fd23a86603d78e53f33c82e (diff)
downloadservo-c443bcbfff2a68e0f37dba7e20fe752d6d8fa2d8.tar.gz
servo-c443bcbfff2a68e0f37dba7e20fe752d6d8fa2d8.zip
Change `get_attr()` to `get_attr_val_for_layout()`.
The old code was used by both layout and script, but was erroneously borrowing for the layout case (which causes parallelism problems). script now uses only `value_ref()` or `get_attribute()`, and layout now has its own unsafe version that dances around the borrows of `@mut Attr`.
Diffstat (limited to 'src/components/script/dom/document.rs')
-rw-r--r--src/components/script/dom/document.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/script/dom/document.rs b/src/components/script/dom/document.rs
index aa9a0baa7ce..4f6cc39d080 100644
--- a/src/components/script/dom/document.rs
+++ b/src/components/script/dom/document.rs
@@ -366,7 +366,7 @@ impl Document {
pub fn GetElementsByName(&self, name: DOMString) -> @mut HTMLCollection {
self.createHTMLCollection(|elem|
- elem.get_attr(Null, "name").is_some() && eq_slice(elem.get_attr(Null, "name").unwrap(), name))
+ elem.get_attribute(Null, "name").is_some() && eq_slice(elem.get_attribute(Null, "name").unwrap().value_ref(), name))
}
pub fn createHTMLCollection(&self, callback: |elem: &Element| -> bool) -> @mut HTMLCollection {
@@ -456,9 +456,9 @@ fn foreach_ided_elements(root: &AbstractNode, callback: |&DOMString, &AbstractNo
}
node.with_imm_element(|element| {
- match element.get_attr(Null, "id") {
+ match element.get_attribute(Null, "id") {
Some(id) => {
- callback(&id.to_str(), &node);
+ callback(&id.Value(), &node);
}
None => ()
}