mirror of
https://github.com/servo/servo.git
synced 2025-08-26 07:38:21 +01:00
style: Avoid propagating the restyle flag all through the dom when a node gets dirty.
This puts us in pair with stylo.
This commit is contained in:
parent
96ea1a335c
commit
d81fe27b11
4 changed files with 21 additions and 35 deletions
|
@ -6,7 +6,6 @@ use context::StandaloneStyleContext;
|
|||
use std::mem;
|
||||
use style::context::SharedStyleContext;
|
||||
use style::dom::OpaqueNode;
|
||||
use style::dom::TNode;
|
||||
use style::traversal::{DomTraversalContext, recalc_style_at};
|
||||
use wrapper::GeckoNode;
|
||||
|
||||
|
@ -37,21 +36,4 @@ impl<'lc, 'ln> DomTraversalContext<GeckoNode<'ln>> for RecalcStyleOnly<'lc> {
|
|||
}
|
||||
|
||||
fn process_postorder(&self, _: GeckoNode<'ln>) {}
|
||||
|
||||
/// In Gecko we use this traversal just for restyling, so we can stop once
|
||||
/// we know there aren't more dirty nodes under ourselves.
|
||||
fn should_process(&self, node: GeckoNode<'ln>) -> bool {
|
||||
node.is_dirty() || node.has_dirty_descendants()
|
||||
}
|
||||
|
||||
fn pre_process_child_hook(&self, parent: GeckoNode<'ln>, kid: GeckoNode<'ln>) {
|
||||
// NOTE: At this point is completely safe to modify either the parent or
|
||||
// the child, since we have exclusive access to them.
|
||||
if parent.is_dirty() {
|
||||
unsafe {
|
||||
kid.set_dirty(true);
|
||||
parent.set_dirty_descendants(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue