mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
ID and class selectors are ASCII case-insensitive in quirks mode.
https://bugzilla.mozilla.org/show_bug.cgi?id=1363778
This commit is contained in:
parent
524fcac191
commit
5bccf98aa4
22 changed files with 313 additions and 191 deletions
|
@ -217,3 +217,21 @@ pub fn serialize_comma_separated_list<W, T>(dest: &mut W,
|
|||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(feature = "gecko")] use gecko_string_cache::WeakAtom;
|
||||
#[cfg(feature = "servo")] use servo_atoms::Atom as WeakAtom;
|
||||
|
||||
/// Extension methods for selectors::attr::CaseSensitivity
|
||||
pub trait CaseSensitivityExt {
|
||||
/// Return whether two atoms compare equal according to this case sensitivity.
|
||||
fn eq_atom(self, a: &WeakAtom, b: &WeakAtom) -> bool;
|
||||
}
|
||||
|
||||
impl CaseSensitivityExt for selectors::attr::CaseSensitivity {
|
||||
fn eq_atom(self, a: &WeakAtom, b: &WeakAtom) -> bool {
|
||||
match self {
|
||||
selectors::attr::CaseSensitivity::CaseSensitive => a == b,
|
||||
selectors::attr::CaseSensitivity::AsciiCaseInsensitive => a.eq_ignore_ascii_case(b),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue