mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
style: Pull out the branch from snapshot_helpers::has_class.
I've verified that current libxul, at least for Linux, doesn't manage to pull the branch out.
This commit is contained in:
parent
6f53f4fb5c
commit
1e72a12265
1 changed files with 8 additions and 1 deletions
|
@ -32,7 +32,14 @@ pub fn has_class<T>(
|
||||||
1 => case_sensitivity.eq_atom(name, WeakAtom::new(class)),
|
1 => case_sensitivity.eq_atom(name, WeakAtom::new(class)),
|
||||||
n => {
|
n => {
|
||||||
let classes = slice::from_raw_parts(list, n as usize);
|
let classes = slice::from_raw_parts(list, n as usize);
|
||||||
classes.iter().any(|ptr| case_sensitivity.eq_atom(name, WeakAtom::new(*ptr)))
|
match case_sensitivity {
|
||||||
|
CaseSensitivity::CaseSensitive => {
|
||||||
|
classes.iter().any(|ptr| name == WeakAtom::new(*ptr))
|
||||||
|
}
|
||||||
|
CaseSensitivity::AsciiCaseInsensitive => {
|
||||||
|
classes.iter().any(|ptr| name.eq_ignore_ascii_case(WeakAtom::new(*ptr)))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue