mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Refactor mouseover code to be more performant
This increases mouseover/out performance drastically on my machine.
This commit is contained in:
parent
73eff81e5d
commit
3662491d8f
3 changed files with 121 additions and 110 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue