Do not set dirty out-of-doc nodes

This commit is contained in:
Fernando Jiménez Moreno 2019-02-19 19:00:29 +01:00
parent e66438de48
commit d7b6a6f509
5 changed files with 15 additions and 3 deletions

View file

@ -185,6 +185,9 @@ pub trait TNode: Sized + Copy + Clone + Debug + NodeInfo + PartialEq {
DomChildren(self.first_child())
}
/// Returns whether the node is attached to a document.
fn is_in_document(&self) -> bool;
/// Returns whether the node is connected.
fn is_connected(&self) -> bool;

View file

@ -421,6 +421,11 @@ impl<'ln> TNode for GeckoNode<'ln> {
self.get_bool_flag(nsINode_BooleanFlag::IsInDocument)
}
#[inline]
fn is_connected(&self) -> bool {
self.get_bool_flag(nsINode_BooleanFlag::IsConnected)
}
fn traversal_parent(&self) -> Option<GeckoElement<'ln>> {
self.flattened_tree_parent().and_then(|n| n.as_element())
}