mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
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:
parent
32790be78d
commit
f4ccbf3687
6 changed files with 63 additions and 103 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue