stylo: Make all attribute selectors respect case insensitivity

This commit is contained in:
Manish Goregaokar 2017-06-08 14:09:41 -07:00 committed by Manish Goregaokar
parent 618efc6357
commit 5b86afd4f6
3 changed files with 26 additions and 10 deletions

View file

@ -619,27 +619,28 @@ extern "C" {
extern "C" { extern "C" {
pub fn Gecko_AttrDashEquals(element: RawGeckoElementBorrowed, pub fn Gecko_AttrDashEquals(element: RawGeckoElementBorrowed,
ns: *mut nsIAtom, name: *mut nsIAtom, ns: *mut nsIAtom, name: *mut nsIAtom,
str: *mut nsIAtom) -> bool; str: *mut nsIAtom, ignore_case: bool) -> bool;
} }
extern "C" { extern "C" {
pub fn Gecko_AttrIncludes(element: RawGeckoElementBorrowed, pub fn Gecko_AttrIncludes(element: RawGeckoElementBorrowed,
ns: *mut nsIAtom, name: *mut nsIAtom, ns: *mut nsIAtom, name: *mut nsIAtom,
str: *mut nsIAtom) -> bool; str: *mut nsIAtom, ignore_case: bool) -> bool;
} }
extern "C" { extern "C" {
pub fn Gecko_AttrHasSubstring(element: RawGeckoElementBorrowed, pub fn Gecko_AttrHasSubstring(element: RawGeckoElementBorrowed,
ns: *mut nsIAtom, name: *mut nsIAtom, ns: *mut nsIAtom, name: *mut nsIAtom,
str: *mut nsIAtom) -> bool; str: *mut nsIAtom, ignore_case: bool)
-> bool;
} }
extern "C" { extern "C" {
pub fn Gecko_AttrHasPrefix(element: RawGeckoElementBorrowed, pub fn Gecko_AttrHasPrefix(element: RawGeckoElementBorrowed,
ns: *mut nsIAtom, name: *mut nsIAtom, ns: *mut nsIAtom, name: *mut nsIAtom,
str: *mut nsIAtom) -> bool; str: *mut nsIAtom, ignore_case: bool) -> bool;
} }
extern "C" { extern "C" {
pub fn Gecko_AttrHasSuffix(element: RawGeckoElementBorrowed, pub fn Gecko_AttrHasSuffix(element: RawGeckoElementBorrowed,
ns: *mut nsIAtom, name: *mut nsIAtom, ns: *mut nsIAtom, name: *mut nsIAtom,
str: *mut nsIAtom) -> bool; str: *mut nsIAtom, ignore_case: bool) -> bool;
} }
extern "C" { extern "C" {
pub fn Gecko_ClassOrClassList(element: RawGeckoElementBorrowed, pub fn Gecko_ClassOrClassList(element: RawGeckoElementBorrowed,
@ -669,29 +670,34 @@ extern "C" {
extern "C" { extern "C" {
pub fn Gecko_SnapshotAttrDashEquals(element: *const ServoElementSnapshot, pub fn Gecko_SnapshotAttrDashEquals(element: *const ServoElementSnapshot,
ns: *mut nsIAtom, name: *mut nsIAtom, ns: *mut nsIAtom, name: *mut nsIAtom,
str: *mut nsIAtom) -> bool; str: *mut nsIAtom, ignore_case: bool)
-> bool;
} }
extern "C" { extern "C" {
pub fn Gecko_SnapshotAttrIncludes(element: *const ServoElementSnapshot, pub fn Gecko_SnapshotAttrIncludes(element: *const ServoElementSnapshot,
ns: *mut nsIAtom, name: *mut nsIAtom, ns: *mut nsIAtom, name: *mut nsIAtom,
str: *mut nsIAtom) -> bool; str: *mut nsIAtom, ignore_case: bool)
-> bool;
} }
extern "C" { extern "C" {
pub fn Gecko_SnapshotAttrHasSubstring(element: pub fn Gecko_SnapshotAttrHasSubstring(element:
*const ServoElementSnapshot, *const ServoElementSnapshot,
ns: *mut nsIAtom, ns: *mut nsIAtom,
name: *mut nsIAtom, name: *mut nsIAtom,
str: *mut nsIAtom) -> bool; str: *mut nsIAtom,
ignore_case: bool) -> bool;
} }
extern "C" { extern "C" {
pub fn Gecko_SnapshotAttrHasPrefix(element: *const ServoElementSnapshot, pub fn Gecko_SnapshotAttrHasPrefix(element: *const ServoElementSnapshot,
ns: *mut nsIAtom, name: *mut nsIAtom, ns: *mut nsIAtom, name: *mut nsIAtom,
str: *mut nsIAtom) -> bool; str: *mut nsIAtom, ignore_case: bool)
-> bool;
} }
extern "C" { extern "C" {
pub fn Gecko_SnapshotAttrHasSuffix(element: *const ServoElementSnapshot, pub fn Gecko_SnapshotAttrHasSuffix(element: *const ServoElementSnapshot,
ns: *mut nsIAtom, name: *mut nsIAtom, ns: *mut nsIAtom, name: *mut nsIAtom,
str: *mut nsIAtom) -> bool; str: *mut nsIAtom, ignore_case: bool)
-> bool;
} }
extern "C" { extern "C" {
pub fn Gecko_SnapshotClassOrClassList(element: pub fn Gecko_SnapshotClassOrClassList(element:

View file

@ -94,30 +94,35 @@ impl GeckoElementSnapshot {
ns.atom_or_null(), ns.atom_or_null(),
local_name.as_ptr(), local_name.as_ptr(),
expected_value.as_ptr(), expected_value.as_ptr(),
ignore_case,
), ),
AttrSelectorOperator::DashMatch => bindings::Gecko_SnapshotAttrDashEquals( AttrSelectorOperator::DashMatch => bindings::Gecko_SnapshotAttrDashEquals(
self, self,
ns.atom_or_null(), ns.atom_or_null(),
local_name.as_ptr(), local_name.as_ptr(),
expected_value.as_ptr(), expected_value.as_ptr(),
ignore_case,
), ),
AttrSelectorOperator::Prefix => bindings::Gecko_SnapshotAttrHasPrefix( AttrSelectorOperator::Prefix => bindings::Gecko_SnapshotAttrHasPrefix(
self, self,
ns.atom_or_null(), ns.atom_or_null(),
local_name.as_ptr(), local_name.as_ptr(),
expected_value.as_ptr(), expected_value.as_ptr(),
ignore_case,
), ),
AttrSelectorOperator::Suffix => bindings::Gecko_SnapshotAttrHasSuffix( AttrSelectorOperator::Suffix => bindings::Gecko_SnapshotAttrHasSuffix(
self, self,
ns.atom_or_null(), ns.atom_or_null(),
local_name.as_ptr(), local_name.as_ptr(),
expected_value.as_ptr(), expected_value.as_ptr(),
ignore_case,
), ),
AttrSelectorOperator::Substring => bindings::Gecko_SnapshotAttrHasSubstring( AttrSelectorOperator::Substring => bindings::Gecko_SnapshotAttrHasSubstring(
self, self,
ns.atom_or_null(), ns.atom_or_null(),
local_name.as_ptr(), local_name.as_ptr(),
expected_value.as_ptr(), expected_value.as_ptr(),
ignore_case,
), ),
} }
} }

View file

@ -1352,30 +1352,35 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
ns.atom_or_null(), ns.atom_or_null(),
local_name.as_ptr(), local_name.as_ptr(),
expected_value.as_ptr(), expected_value.as_ptr(),
ignore_case,
), ),
AttrSelectorOperator::DashMatch => bindings::Gecko_AttrDashEquals( AttrSelectorOperator::DashMatch => bindings::Gecko_AttrDashEquals(
self.0, self.0,
ns.atom_or_null(), ns.atom_or_null(),
local_name.as_ptr(), local_name.as_ptr(),
expected_value.as_ptr(), expected_value.as_ptr(),
ignore_case,
), ),
AttrSelectorOperator::Prefix => bindings::Gecko_AttrHasPrefix( AttrSelectorOperator::Prefix => bindings::Gecko_AttrHasPrefix(
self.0, self.0,
ns.atom_or_null(), ns.atom_or_null(),
local_name.as_ptr(), local_name.as_ptr(),
expected_value.as_ptr(), expected_value.as_ptr(),
ignore_case,
), ),
AttrSelectorOperator::Suffix => bindings::Gecko_AttrHasSuffix( AttrSelectorOperator::Suffix => bindings::Gecko_AttrHasSuffix(
self.0, self.0,
ns.atom_or_null(), ns.atom_or_null(),
local_name.as_ptr(), local_name.as_ptr(),
expected_value.as_ptr(), expected_value.as_ptr(),
ignore_case,
), ),
AttrSelectorOperator::Substring => bindings::Gecko_AttrHasSubstring( AttrSelectorOperator::Substring => bindings::Gecko_AttrHasSubstring(
self.0, self.0,
ns.atom_or_null(), ns.atom_or_null(),
local_name.as_ptr(), local_name.as_ptr(),
expected_value.as_ptr(), expected_value.as_ptr(),
ignore_case,
), ),
} }
} }