Skip to content
Permalink
Browse files

AttrValue's s/from_tokenlist/from_serialized_tokenlist/

  • Loading branch information
brunoabinader committed Dec 26, 2014
1 parent 0e6304d commit eb3678fa286fc2480624c977b1de5b60a971b3f7
@@ -37,7 +37,7 @@ pub enum AttrValue {
}

impl AttrValue {
pub fn from_tokenlist(tokens: DOMString) -> AttrValue {
pub fn from_serialized_tokenlist(tokens: DOMString) -> AttrValue {
let atoms = split_html_space_chars(tokens.as_slice())
.map(|token| Atom::from_slice(token)).collect();
AttrValue::TokenList(tokens, atoms)
@@ -848,7 +848,7 @@ impl<'a> AttributeHandlers for JSRef<'a, Element> {

fn set_tokenlist_attribute(self, name: &Atom, value: DOMString) {
assert!(name.as_slice() == name.as_slice().to_ascii_lower().as_slice());
self.set_attribute(name, AttrValue::from_tokenlist(value));
self.set_attribute(name, AttrValue::from_serialized_tokenlist(value));
}

fn get_uint_attribute(self, name: &Atom) -> u32 {
@@ -1290,7 +1290,7 @@ impl<'a> VirtualMethods for JSRef<'a, Element> {
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
match name {
&atom!("id") => AttrValue::from_atomic(value),
&atom!("class") => AttrValue::from_tokenlist(value),
&atom!("class") => AttrValue::from_serialized_tokenlist(value),
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
}
}
@@ -93,7 +93,7 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLAnchorElement> {

fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
match name {
&atom!("rel") => AttrValue::from_tokenlist(value),
&atom!("rel") => AttrValue::from_serialized_tokenlist(value),
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
}
}
@@ -58,7 +58,7 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLAreaElement> {

fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
match name {
&atom!("rel") => AttrValue::from_tokenlist(value),
&atom!("rel") => AttrValue::from_serialized_tokenlist(value),
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
}
}
@@ -94,7 +94,7 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLLinkElement> {

fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
match name {
&atom!("rel") => AttrValue::from_tokenlist(value),
&atom!("rel") => AttrValue::from_serialized_tokenlist(value),
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
}
}

0 comments on commit eb3678f

Please sign in to comment.
You can’t perform that action at this time.