Hoist StyleNew{Children,Subtree} into their own paths.

The buggy animation handling isn't a regression, since currently we pass
UnstyledChildrenOnly in those cases, which blocks the animation traversal
in Servo_TraverseSubtree.

In general I really wanted to handle these two paths together. But there's
enough broken with the NewChildren path that I wanted to scope the buginess
as tightly as possible. And I really need to separate the handling here from
StyleDocument() to make the restyle root stuff work.

MozReview-Commit-ID: 9F0mcQl7AAX
This commit is contained in:
Bobby Holley 2017-07-26 13:13:00 -07:00
parent 32790be78d
commit f4ccbf3687
6 changed files with 63 additions and 103 deletions

View file

@ -35,16 +35,7 @@ pub fn traverse_dom<E, D>(traversal: &D,
};
let root_depth = root.depth();
if token.traverse_unstyled_children_only() {
for kid in root.as_node().traversal_children() {
if kid.as_element().map_or(false, |el| el.get_data().is_none()) {
discovered.push_back(WorkItem(kid, root_depth + 1));
}
}
} else {
discovered.push_back(WorkItem(root.as_node(), root_depth));
}
discovered.push_back(WorkItem(root.as_node(), root_depth));
// Process the nodes breadth-first, just like the parallel traversal does.
// This helps keep similar traversal characteristics for the style sharing