Skip to content

Commit

Permalink
style: Remove unused selectors methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
emilio committed Aug 7, 2018
1 parent 489e224 commit bbcd7e4
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 40 deletions.
6 changes: 0 additions & 6 deletions components/selectors/tree.rs
Expand Up @@ -45,12 +45,6 @@ pub trait Element: Sized + Clone + Debug {
self.parent_element()
}

/// Skips non-element nodes
fn first_child_element(&self) -> Option<Self>;

/// Skips non-element nodes
fn last_child_element(&self) -> Option<Self>;

/// Skips non-element nodes
fn prev_sibling_element(&self) -> Option<Self>;

Expand Down
24 changes: 0 additions & 24 deletions components/style/gecko/wrapper.rs
Expand Up @@ -1957,30 +1957,6 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
unsafe { Some(GeckoElement(&slot.as_ref()?._base._base._base._base)) }
}

#[inline]
fn first_child_element(&self) -> Option<Self> {
let mut child = self.as_node().first_child();
while let Some(child_node) = child {
if let Some(el) = child_node.as_element() {
return Some(el);
}
child = child_node.next_sibling();
}
None
}

#[inline]
fn last_child_element(&self) -> Option<Self> {
let mut child = self.as_node().last_child();
while let Some(child_node) = child {
if let Some(el) = child_node.as_element() {
return Some(el);
}
child = child_node.prev_sibling();
}
None
}

#[inline]
fn prev_sibling_element(&self) -> Option<Self> {
let mut sibling = self.as_node().prev_sibling();
Expand Down
10 changes: 0 additions & 10 deletions components/style/invalidation/element/element_wrapper.rs
Expand Up @@ -283,16 +283,6 @@ where
Some(Self::new(host, self.snapshot_map))
}

fn first_child_element(&self) -> Option<Self> {
let child = self.element.first_child_element()?;
Some(Self::new(child, self.snapshot_map))
}

fn last_child_element(&self) -> Option<Self> {
let child = self.element.last_child_element()?;
Some(Self::new(child, self.snapshot_map))
}

fn prev_sibling_element(&self) -> Option<Self> {
let sibling = self.element.prev_sibling_element()?;
Some(Self::new(sibling, self.snapshot_map))
Expand Down

0 comments on commit bbcd7e4

Please sign in to comment.