mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
stylo: Allow bypassing the bottom-up traversal.
This commit is contained in:
parent
40df81d537
commit
436c1b3089
4 changed files with 37 additions and 15 deletions
|
@ -141,12 +141,23 @@ pub fn remove_from_bloom_filter<'a, N, C>(context: &C, root: OpaqueNode, node: N
|
|||
|
||||
pub trait DomTraversalContext<N: TNode> {
|
||||
type SharedContext: Sync + 'static;
|
||||
|
||||
fn new<'a>(&'a Self::SharedContext, OpaqueNode) -> Self;
|
||||
|
||||
/// Process `node` on the way down, before its children have been processed.
|
||||
fn process_preorder(&self, node: N);
|
||||
fn process_preorder(&self, node: N) -> ForceTraversalStop;
|
||||
|
||||
/// Process `node` on the way up, after its children have been processed.
|
||||
///
|
||||
/// This is only executed if `needs_postorder_traversal` returns true.
|
||||
fn process_postorder(&self, node: N);
|
||||
|
||||
/// Boolean that specifies whether a bottom up traversal should be
|
||||
/// performed.
|
||||
///
|
||||
/// If it's false, then process_postorder has no effect at all.
|
||||
fn needs_postorder_traversal(&self) -> bool { true }
|
||||
|
||||
/// Returns if the node should be processed by the preorder traversal (and
|
||||
/// then by the post-order one).
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue