mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
style: Change storage of previous and next children in nsINode.
This commit is contained in:
parent
888ad3eabe
commit
87deddb631
1 changed files with 12 additions and 9 deletions
|
@ -30,7 +30,7 @@ use gecko::selector_parser::{NonTSPseudoClass, PseudoElement, SelectorImpl};
|
||||||
use gecko::snapshot_helpers;
|
use gecko::snapshot_helpers;
|
||||||
use gecko_bindings::bindings;
|
use gecko_bindings::bindings;
|
||||||
use gecko_bindings::bindings::{Gecko_ElementState, Gecko_GetDocumentLWTheme};
|
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_SetNodeFlags, Gecko_UnsetNodeFlags};
|
||||||
use gecko_bindings::bindings::Gecko_ClassOrClassList;
|
use gecko_bindings::bindings::Gecko_ClassOrClassList;
|
||||||
use gecko_bindings::bindings::Gecko_ElementHasAnimations;
|
use gecko_bindings::bindings::Gecko_ElementHasAnimations;
|
||||||
|
@ -375,7 +375,11 @@ impl<'ln> TNode for GeckoNode<'ln> {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn first_child(&self) -> Option<Self> {
|
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]
|
#[inline]
|
||||||
|
@ -385,17 +389,16 @@ impl<'ln> TNode for GeckoNode<'ln> {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn prev_sibling(&self) -> Option<Self> {
|
fn prev_sibling(&self) -> Option<Self> {
|
||||||
unsafe {
|
unsafe { Gecko_GetPreviousSibling(self.0).map(GeckoNode) }
|
||||||
self.0
|
|
||||||
.mPreviousSibling
|
|
||||||
.as_ref()
|
|
||||||
.map(GeckoNode::from_content)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn next_sibling(&self) -> Option<Self> {
|
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]
|
#[inline]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue