From 572b3c31bd7df82bd47b10381c3bff80e75c42b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 25 Jul 2016 21:26:49 -0700 Subject: [PATCH] style: Add a comment about pre_process_children_hook. --- components/style/parallel.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/style/parallel.rs b/components/style/parallel.rs index 889f7f0a15b..b82727657c3 100644 --- a/components/style/parallel.rs +++ b/components/style/parallel.rs @@ -73,6 +73,12 @@ fn top_down_dom(unsafe_nodes: UnsafeNodeList, // Possibly enqueue the children. let mut children_to_process = 0isize; for kid in node.children() { + // Trigger the hook pre-adding the kid to the list. This can (and in + // fact uses to) change the result of the should_process operation. + // + // As of right now, this hook takes care of propagating the restyle + // flag down the tree. In the future, more accurate behavior is + // probably going to be needed. context.pre_process_child_hook(node, kid); if context.should_process(kid) { children_to_process += 1;