Refactor mouseover code to be more performant

This increases mouseover/out performance drastically on my machine.
This commit is contained in:
Emilio Cobos Álvarez 2016-02-24 17:37:11 +01:00
parent 73eff81e5d
commit 3662491d8f
3 changed files with 121 additions and 110 deletions

View file

@ -518,7 +518,11 @@ impl Node {
}
pub fn is_inclusive_ancestor_of(&self, parent: &Node) -> bool {
self == parent || parent.ancestors().any(|ancestor| ancestor.r() == self)
self == parent || self.is_ancestor_of(parent)
}
pub fn is_ancestor_of(&self, parent: &Node) -> bool {
parent.ancestors().any(|ancestor| ancestor.r() == self)
}
pub fn following_siblings(&self) -> NodeSiblingIterator {