From 87deddb631edf1e32090f7b5c91751f1821cc687 Mon Sep 17 00:00:00 2001 From: Olli Pettay Date: Mon, 6 Aug 2018 22:29:27 +0300 Subject: [PATCH] style: Change storage of previous and next children in nsINode. --- components/style/gecko/wrapper.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 85e8c4eaef5..5eecc6911ad 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -30,7 +30,7 @@ use gecko::selector_parser::{NonTSPseudoClass, PseudoElement, SelectorImpl}; use gecko::snapshot_helpers; use gecko_bindings::bindings; use gecko_bindings::bindings::{Gecko_ElementState, Gecko_GetDocumentLWTheme}; -use gecko_bindings::bindings::{Gecko_GetLastChild, Gecko_GetNextStyleChild}; +use gecko_bindings::bindings::{Gecko_GetLastChild, Gecko_GetPreviousSibling, Gecko_GetNextStyleChild}; use gecko_bindings::bindings::{Gecko_SetNodeFlags, Gecko_UnsetNodeFlags}; use gecko_bindings::bindings::Gecko_ClassOrClassList; use gecko_bindings::bindings::Gecko_ElementHasAnimations; @@ -375,7 +375,11 @@ impl<'ln> TNode for GeckoNode<'ln> { #[inline] fn first_child(&self) -> Option { - unsafe { self.0.mFirstChild.as_ref().map(GeckoNode::from_content) } + unsafe { + self.0 + .mFirstChild.raw::() + .as_ref() + .map(GeckoNode::from_content) } } #[inline] @@ -385,17 +389,16 @@ impl<'ln> TNode for GeckoNode<'ln> { #[inline] fn prev_sibling(&self) -> Option { - unsafe { - self.0 - .mPreviousSibling - .as_ref() - .map(GeckoNode::from_content) - } + unsafe { Gecko_GetPreviousSibling(self.0).map(GeckoNode) } } #[inline] fn next_sibling(&self) -> Option { - unsafe { self.0.mNextSibling.as_ref().map(GeckoNode::from_content) } + unsafe { + self.0 + .mNextSibling.raw::() + .as_ref() + .map(GeckoNode::from_content) } } #[inline]