Skip to content

Commit

Permalink
style: Change storage of previous and next children in nsINode.
Browse files Browse the repository at this point in the history
  • Loading branch information
Olli Pettay authored and emilio committed Aug 7, 2018
1 parent 888ad3e commit 87deddb
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions components/style/gecko/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -375,7 +375,11 @@ impl<'ln> TNode for GeckoNode<'ln> {

#[inline]
fn first_child(&self) -> Option<Self> {
unsafe { self.0.mFirstChild.as_ref().map(GeckoNode::from_content) }
unsafe {
self.0
.mFirstChild.raw::<nsIContent>()
.as_ref()
.map(GeckoNode::from_content) }
}

#[inline]
Expand All @@ -385,17 +389,16 @@ impl<'ln> TNode for GeckoNode<'ln> {

#[inline]
fn prev_sibling(&self) -> Option<Self> {
unsafe {
self.0
.mPreviousSibling
.as_ref()
.map(GeckoNode::from_content)
}
unsafe { Gecko_GetPreviousSibling(self.0).map(GeckoNode) }
}

#[inline]
fn next_sibling(&self) -> Option<Self> {
unsafe { self.0.mNextSibling.as_ref().map(GeckoNode::from_content) }
unsafe {
self.0
.mNextSibling.raw::<nsIContent>()
.as_ref()
.map(GeckoNode::from_content) }
}

#[inline]
Expand Down

0 comments on commit 87deddb

Please sign in to comment.