style: Change storage of previous and next children in nsINode.

This commit is contained in:
Olli Pettay 2018-08-06 22:29:27 +03:00 committed by Emilio Cobos Álvarez
parent 888ad3eabe
commit 87deddb631
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -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<Self> {
unsafe { self.0.mFirstChild.as_ref().map(GeckoNode::from_content) }
unsafe {
self.0
.mFirstChild.raw::<nsIContent>()
.as_ref()
.map(GeckoNode::from_content) }
}
#[inline]
@ -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]