Remove unused selectors::Element::each_class

This commit is contained in:
Simon Sapin 2017-05-18 00:54:34 +02:00
parent 9376abdd2c
commit c5e37f3d2c
6 changed files with 24 additions and 57 deletions

View file

@ -381,6 +381,9 @@ pub trait TElement : Eq + PartialEq + Debug + Hash + Sized + Copy + Clone +
/// 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.

View file

@ -655,6 +655,14 @@ impl<'le> TElement for GeckoElement<'le> {
}
}
fn each_class<F>(&self, callback: F)
where F: FnMut(&Atom)
{
snapshot_helpers::each_class(self.0,
callback,
Gecko_ClassOrClassList)
}
fn existing_style_for_restyle_damage<'a>(&'a self,
_existing_values: &'a ComputedValues,
pseudo: Option<&PseudoElement>)
@ -1386,18 +1394,6 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
Gecko_ClassOrClassList)
}
fn each_class<F>(&self, callback: F)
where F: FnMut(&Atom)
{
if !self.may_have_class() {
return;
}
snapshot_helpers::each_class(self.0,
callback,
Gecko_ClassOrClassList)
}
fn is_html_element_in_html_document(&self) -> bool {
let node = self.as_node();
let node_info = node.node_info();

View file

@ -407,15 +407,6 @@ impl<'a, E> Element for ElementWrapper<'a, E>
self.element.is_root()
}
fn each_class<F>(&self, callback: F)
where F: FnMut(&Atom) {
match self.snapshot() {
Some(snapshot) if snapshot.has_attrs()
=> snapshot.each_class(callback),
_ => self.element.each_class(callback)
}
}
fn pseudo_element_originating_element(&self) -> Option<Self> {
self.element.closest_non_native_anonymous_ancestor()
.map(|e| ElementWrapper::new(e, self.snapshot_map))