From bbcd7e414a1130102285bb75381d714a4886e16f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 6 Aug 2018 23:52:52 +0000 Subject: [PATCH] style: Remove unused selectors methods. Differential Revision: https://phabricator.services.mozilla.com/D2767 --- components/selectors/tree.rs | 6 ----- components/style/gecko/wrapper.rs | 24 ------------------- .../invalidation/element/element_wrapper.rs | 10 -------- 3 files changed, 40 deletions(-) diff --git a/components/selectors/tree.rs b/components/selectors/tree.rs index ef544cc7e4c..112b02dbbd9 100644 --- a/components/selectors/tree.rs +++ b/components/selectors/tree.rs @@ -45,12 +45,6 @@ pub trait Element: Sized + Clone + Debug { self.parent_element() } - /// Skips non-element nodes - fn first_child_element(&self) -> Option; - - /// Skips non-element nodes - fn last_child_element(&self) -> Option; - /// Skips non-element nodes fn prev_sibling_element(&self) -> Option; diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 5eecc6911ad..543729602a7 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -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 { - 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 { - 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 { let mut sibling = self.as_node().prev_sibling(); diff --git a/components/style/invalidation/element/element_wrapper.rs b/components/style/invalidation/element/element_wrapper.rs index b1e799d9efd..cb4f79e92e1 100644 --- a/components/style/invalidation/element/element_wrapper.rs +++ b/components/style/invalidation/element/element_wrapper.rs @@ -283,16 +283,6 @@ where Some(Self::new(host, self.snapshot_map)) } - fn first_child_element(&self) -> Option { - let child = self.element.first_child_element()?; - Some(Self::new(child, self.snapshot_map)) - } - - fn last_child_element(&self) -> Option { - let child = self.element.last_child_element()?; - Some(Self::new(child, self.snapshot_map)) - } - fn prev_sibling_element(&self) -> Option { let sibling = self.element.prev_sibling_element()?; Some(Self::new(sibling, self.snapshot_map))