Bug 1364162 - Part 1: stylo: Remove TElement::attr_equals ; r?SimonSapin
MozReview-Commit-ID: GFNaCo0qILN
--- a/servo/components/script/layout_wrapper.rs
+++ b/servo/components/script/layout_wrapper.rs
@@ -394,21 +394,16 @@ impl<'le> TElement for ServoLayoutElemen
self.element.get_state_for_layout()
}
#[inline]
fn has_attr(&self, namespace: &Namespace, attr: &LocalName) -> bool {
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<F>(&self, mut callback: F) where F: FnMut(&Atom) {
unsafe {
if let Some(ref classes) = self.element.get_classes_for_layout() {
for class in *classes {
callback(class)
}
}
--- a/servo/components/style/dom.rs
+++ b/servo/components/style/dom.rs
@@ -362,19 +362,16 @@ pub trait TElement : Eq + PartialEq + De
}
/// Get this element's state, for non-tree-structural pseudos.
fn get_state(&self) -> ElementState;
/// 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<F>(&self, callback: F) where F: FnMut(&Atom);
/// Get the pre-existing style to calculate restyle damage (change hints).
///
/// This needs to be generic since it varies between Servo and Gecko.
///
/// XXX(emilio): It's a bit unfortunate we need to pass the current computed
--- a/servo/components/style/gecko/wrapper.rs
+++ b/servo/components/style/gecko/wrapper.rs
@@ -674,27 +674,16 @@ impl<'le> TElement for GeckoElement<'le>
fn has_attr(&self, namespace: &Namespace, attr: &Atom) -> bool {
unsafe {
bindings::Gecko_HasAttr(self.0,
namespace.0.as_ptr(),
attr.as_ptr())
}
}
- #[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<F>(&self, callback: F)
where F: FnMut(&Atom)
{
snapshot_helpers::each_class(self.0,
callback,
Gecko_ClassOrClassList)
}