diff --git a/components/script/layout_wrapper.rs b/components/script/layout_wrapper.rs index f7f5396dc8d..80f87eb8504 100644 --- a/components/script/layout_wrapper.rs +++ b/components/script/layout_wrapper.rs @@ -399,11 +399,6 @@ impl<'le> TElement for ServoLayoutElement<'le> { self.get_attr(namespace, attr).is_some() } - #[inline] - fn attr_equals(&self, namespace: &Namespace, attr: &LocalName, val: &Atom) -> bool { - self.get_attr(namespace, attr).map_or(false, |x| x == val) - } - #[inline(always)] fn each_class(&self, mut callback: F) where F: FnMut(&Atom) { unsafe { diff --git a/components/style/dom.rs b/components/style/dom.rs index 870690c2027..1d9462a6335 100644 --- a/components/style/dom.rs +++ b/components/style/dom.rs @@ -368,9 +368,6 @@ pub trait TElement : Eq + PartialEq + Debug + Hash + Sized + Copy + Clone + /// Whether this element has an attribute with a given namespace. fn has_attr(&self, namespace: &Namespace, attr: &LocalName) -> bool; - /// Whether an attribute value equals `value`. - fn attr_equals(&self, namespace: &Namespace, attr: &LocalName, value: &Atom) -> bool; - /// Internal iterator for the classes of this element. fn each_class(&self, callback: F) where F: FnMut(&Atom); diff --git a/components/style/gecko/generated/bindings.rs b/components/style/gecko/generated/bindings.rs index d9427e856eb..770749efa26 100644 --- a/components/style/gecko/generated/bindings.rs +++ b/components/style/gecko/generated/bindings.rs @@ -619,27 +619,28 @@ extern "C" { extern "C" { pub fn Gecko_AttrDashEquals(element: RawGeckoElementBorrowed, ns: *mut nsIAtom, name: *mut nsIAtom, - str: *mut nsIAtom) -> bool; + str: *mut nsIAtom, ignore_case: bool) -> bool; } extern "C" { pub fn Gecko_AttrIncludes(element: RawGeckoElementBorrowed, ns: *mut nsIAtom, name: *mut nsIAtom, - str: *mut nsIAtom) -> bool; + str: *mut nsIAtom, ignore_case: bool) -> bool; } extern "C" { pub fn Gecko_AttrHasSubstring(element: RawGeckoElementBorrowed, ns: *mut nsIAtom, name: *mut nsIAtom, - str: *mut nsIAtom) -> bool; + str: *mut nsIAtom, ignore_case: bool) + -> bool; } extern "C" { pub fn Gecko_AttrHasPrefix(element: RawGeckoElementBorrowed, ns: *mut nsIAtom, name: *mut nsIAtom, - str: *mut nsIAtom) -> bool; + str: *mut nsIAtom, ignore_case: bool) -> bool; } extern "C" { pub fn Gecko_AttrHasSuffix(element: RawGeckoElementBorrowed, ns: *mut nsIAtom, name: *mut nsIAtom, - str: *mut nsIAtom) -> bool; + str: *mut nsIAtom, ignore_case: bool) -> bool; } extern "C" { pub fn Gecko_ClassOrClassList(element: RawGeckoElementBorrowed, @@ -669,29 +670,34 @@ extern "C" { extern "C" { pub fn Gecko_SnapshotAttrDashEquals(element: *const ServoElementSnapshot, ns: *mut nsIAtom, name: *mut nsIAtom, - str: *mut nsIAtom) -> bool; + str: *mut nsIAtom, ignore_case: bool) + -> bool; } extern "C" { pub fn Gecko_SnapshotAttrIncludes(element: *const ServoElementSnapshot, ns: *mut nsIAtom, name: *mut nsIAtom, - str: *mut nsIAtom) -> bool; + str: *mut nsIAtom, ignore_case: bool) + -> bool; } extern "C" { pub fn Gecko_SnapshotAttrHasSubstring(element: *const ServoElementSnapshot, ns: *mut nsIAtom, name: *mut nsIAtom, - str: *mut nsIAtom) -> bool; + str: *mut nsIAtom, + ignore_case: bool) -> bool; } extern "C" { pub fn Gecko_SnapshotAttrHasPrefix(element: *const ServoElementSnapshot, ns: *mut nsIAtom, name: *mut nsIAtom, - str: *mut nsIAtom) -> bool; + str: *mut nsIAtom, ignore_case: bool) + -> bool; } extern "C" { pub fn Gecko_SnapshotAttrHasSuffix(element: *const ServoElementSnapshot, ns: *mut nsIAtom, name: *mut nsIAtom, - str: *mut nsIAtom) -> bool; + str: *mut nsIAtom, ignore_case: bool) + -> bool; } extern "C" { pub fn Gecko_SnapshotClassOrClassList(element: diff --git a/components/style/gecko/snapshot.rs b/components/style/gecko/snapshot.rs index d238151fd9a..b2f7907a64a 100644 --- a/components/style/gecko/snapshot.rs +++ b/components/style/gecko/snapshot.rs @@ -94,30 +94,35 @@ impl GeckoElementSnapshot { ns.atom_or_null(), local_name.as_ptr(), expected_value.as_ptr(), + ignore_case, ), AttrSelectorOperator::DashMatch => bindings::Gecko_SnapshotAttrDashEquals( self, ns.atom_or_null(), local_name.as_ptr(), expected_value.as_ptr(), + ignore_case, ), AttrSelectorOperator::Prefix => bindings::Gecko_SnapshotAttrHasPrefix( self, ns.atom_or_null(), local_name.as_ptr(), expected_value.as_ptr(), + ignore_case, ), AttrSelectorOperator::Suffix => bindings::Gecko_SnapshotAttrHasSuffix( self, ns.atom_or_null(), local_name.as_ptr(), expected_value.as_ptr(), + ignore_case, ), AttrSelectorOperator::Substring => bindings::Gecko_SnapshotAttrHasSubstring( self, ns.atom_or_null(), local_name.as_ptr(), expected_value.as_ptr(), + ignore_case, ), } } diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 1d6d589ade3..756a7376f82 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -726,17 +726,6 @@ impl<'le> TElement for GeckoElement<'le> { } } - #[inline] - fn attr_equals(&self, namespace: &Namespace, attr: &Atom, val: &Atom) -> bool { - unsafe { - bindings::Gecko_AttrEquals(self.0, - namespace.0.as_ptr(), - attr.as_ptr(), - val.as_ptr(), - /* ignoreCase = */ false) - } - } - fn each_class(&self, callback: F) where F: FnMut(&Atom) { @@ -1355,30 +1344,35 @@ impl<'le> ::selectors::Element for GeckoElement<'le> { ns.atom_or_null(), local_name.as_ptr(), expected_value.as_ptr(), + ignore_case, ), AttrSelectorOperator::DashMatch => bindings::Gecko_AttrDashEquals( self.0, ns.atom_or_null(), local_name.as_ptr(), expected_value.as_ptr(), + ignore_case, ), AttrSelectorOperator::Prefix => bindings::Gecko_AttrHasPrefix( self.0, ns.atom_or_null(), local_name.as_ptr(), expected_value.as_ptr(), + ignore_case, ), AttrSelectorOperator::Suffix => bindings::Gecko_AttrHasSuffix( self.0, ns.atom_or_null(), local_name.as_ptr(), expected_value.as_ptr(), + ignore_case, ), AttrSelectorOperator::Substring => bindings::Gecko_AttrHasSubstring( self.0, ns.atom_or_null(), local_name.as_ptr(), expected_value.as_ptr(), + ignore_case, ), } }