From 1e72a12265919103bd90d777c99d73b7141f4d13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 16 Jan 2018 21:38:31 +0100 Subject: [PATCH] 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. --- components/style/gecko/snapshot_helpers.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/style/gecko/snapshot_helpers.rs b/components/style/gecko/snapshot_helpers.rs index 51953a0231c..4c5b65b13cb 100644 --- a/components/style/gecko/snapshot_helpers.rs +++ b/components/style/gecko/snapshot_helpers.rs @@ -32,7 +32,14 @@ pub fn has_class( 1 => case_sensitivity.eq_atom(name, WeakAtom::new(class)), n => { 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))) + } + } } } }