aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/attr.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2014-09-18 09:20:19 -0400
committerJosh Matthews <josh@joshmatthews.net>2014-09-18 09:20:19 -0400
commit9607b468bc50496c0de3706d22efaa6fdc68b089 (patch)
tree85615a722eb65681ebccee8d98dc47c7895573c9 /components/script/dom/attr.rs
parent7158cac2dcaabacede36924f52167b8e7b402e7a (diff)
downloadservo-9607b468bc50496c0de3706d22efaa6fdc68b089.tar.gz
servo-9607b468bc50496c0de3706d22efaa6fdc68b089.zip
Revert "script: Use atom comparison in more places, especially for attributes." for persistent test failures.
This reverts commit 874db261046d6155b1942efa106d2e0014295d6d.
Diffstat (limited to 'components/script/dom/attr.rs')
-rw-r--r--components/script/dom/attr.rs16
1 files changed, 6 insertions, 10 deletions
diff --git a/components/script/dom/attr.rs b/components/script/dom/attr.rs
index 60b414199e5..be419eb2a61 100644
--- a/components/script/dom/attr.rs
+++ b/components/script/dom/attr.rs
@@ -13,13 +13,13 @@ use dom::element::{Element, AttributeHandlers};
use dom::node::Node;
use dom::window::Window;
use dom::virtualmethods::vtable_for;
-
use servo_util::atom::Atom;
use servo_util::namespace;
use servo_util::namespace::Namespace;
use servo_util::str::{DOMString, split_html_space_chars};
use std::cell::{Ref, RefCell};
use std::mem;
+use std::slice::Items;
pub enum AttrSettingType {
FirstSetAttr,
@@ -51,9 +51,9 @@ impl AttrValue {
AtomAttrValue(value)
}
- pub fn tokens<'a>(&'a self) -> Option<&'a [Atom]> {
+ pub fn tokens<'a>(&'a self) -> Option<Items<'a, Atom>> {
match *self {
- TokenListAttrValue(_, ref tokens) => Some(tokens.as_slice()),
+ TokenListAttrValue(_, ref tokens) => Some(tokens.iter()),
_ => None
}
}
@@ -189,19 +189,17 @@ impl<'a> AttrHelpers for JSRef<'a, Attr> {
pub trait AttrHelpersForLayout {
unsafe fn value_ref_forever(&self) -> &'static str;
unsafe fn value_atom_forever(&self) -> Option<Atom>;
- unsafe fn value_tokens_forever(&self) -> Option<&'static [Atom]>;
+ unsafe fn value_tokens_forever(&self) -> Option<Items<Atom>>;
unsafe fn local_name_atom_forever(&self) -> Atom;
}
impl AttrHelpersForLayout for Attr {
- #[inline]
unsafe fn value_ref_forever(&self) -> &'static str {
// cast to point to T in RefCell<T> directly
let value = mem::transmute::<&RefCell<AttrValue>, &AttrValue>(self.value.deref());
value.as_slice()
}
- #[inline]
unsafe fn value_atom_forever(&self) -> Option<Atom> {
// cast to point to T in RefCell<T> directly
let value = mem::transmute::<&RefCell<AttrValue>, &AttrValue>(self.value.deref());
@@ -211,17 +209,15 @@ impl AttrHelpersForLayout for Attr {
}
}
- #[inline]
- unsafe fn value_tokens_forever(&self) -> Option<&'static [Atom]> {
+ unsafe fn value_tokens_forever(&self) -> Option<Items<Atom>> {
// cast to point to T in RefCell<T> directly
let value = mem::transmute::<&RefCell<AttrValue>, &AttrValue>(self.value.deref());
match *value {
- TokenListAttrValue(_, ref tokens) => Some(tokens.as_slice()),
+ TokenListAttrValue(_, ref tokens) => Some(tokens.iter()),
_ => None,
}
}
- #[inline]
unsafe fn local_name_atom_forever(&self) -> Atom {
self.local_name.clone()
}