mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
AttrValue's s/from_tokenlist/from_serialized_tokenlist/
This commit is contained in:
parent
0e6304dcf7
commit
eb3678fa28
5 changed files with 6 additions and 6 deletions
|
@ -37,7 +37,7 @@ pub enum AttrValue {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl 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())
|
let atoms = split_html_space_chars(tokens.as_slice())
|
||||||
.map(|token| Atom::from_slice(token)).collect();
|
.map(|token| Atom::from_slice(token)).collect();
|
||||||
AttrValue::TokenList(tokens, atoms)
|
AttrValue::TokenList(tokens, atoms)
|
||||||
|
|
|
@ -848,7 +848,7 @@ impl<'a> AttributeHandlers for JSRef<'a, Element> {
|
||||||
|
|
||||||
fn set_tokenlist_attribute(self, name: &Atom, value: DOMString) {
|
fn set_tokenlist_attribute(self, name: &Atom, value: DOMString) {
|
||||||
assert!(name.as_slice() == name.as_slice().to_ascii_lower().as_slice());
|
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 {
|
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 {
|
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
|
||||||
match name {
|
match name {
|
||||||
&atom!("id") => AttrValue::from_atomic(value),
|
&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),
|
_ => 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 {
|
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
|
||||||
match name {
|
match name {
|
||||||
&atom!("rel") => AttrValue::from_tokenlist(value),
|
&atom!("rel") => AttrValue::from_serialized_tokenlist(value),
|
||||||
_ => self.super_type().unwrap().parse_plain_attribute(name, 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 {
|
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
|
||||||
match name {
|
match name {
|
||||||
&atom!("rel") => AttrValue::from_tokenlist(value),
|
&atom!("rel") => AttrValue::from_serialized_tokenlist(value),
|
||||||
_ => self.super_type().unwrap().parse_plain_attribute(name, 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 {
|
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
|
||||||
match name {
|
match name {
|
||||||
&atom!("rel") => AttrValue::from_tokenlist(value),
|
&atom!("rel") => AttrValue::from_serialized_tokenlist(value),
|
||||||
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
|
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue