mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Replace many uses of to_ascii_lowercase() by make_ascii_lowercase()
This commit is contained in:
parent
67cbda4be3
commit
105d990845
7 changed files with 32 additions and 23 deletions
|
@ -578,12 +578,11 @@ impl Element {
|
|||
&self.local_name
|
||||
}
|
||||
|
||||
pub fn parsed_name(&self, name: DOMString) -> Atom {
|
||||
pub fn parsed_name(&self, mut name: DOMString) -> Atom {
|
||||
if self.html_element_in_html_document() {
|
||||
Atom::from_slice(&name.to_ascii_lowercase())
|
||||
} else {
|
||||
Atom::from_slice(&name)
|
||||
name.make_ascii_lowercase();
|
||||
}
|
||||
Atom::from_slice(&name)
|
||||
}
|
||||
|
||||
pub fn namespace(&self) -> &Namespace {
|
||||
|
@ -830,7 +829,8 @@ impl Element {
|
|||
pub fn get_attribute(&self, namespace: &Namespace, local_name: &Atom) -> Option<Root<Attr>> {
|
||||
let mut attributes = RootedVec::new();
|
||||
self.get_attributes(local_name, &mut attributes);
|
||||
attributes.r().iter()
|
||||
attributes.r().
|
||||
iter()
|
||||
.find(|attr| attr.namespace() == namespace)
|
||||
.map(|attr| Root::from_ref(*attr))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue