Pass a LayoutContext through box construction

This commit is contained in:
Simon Sapin 2019-12-02 22:26:49 +01:00
parent 9c5a595044
commit 4e6e31a76c
6 changed files with 34 additions and 31 deletions

View file

@ -1081,9 +1081,8 @@ impl LayoutThread {
let box_tree = if token.should_traverse() {
driver::traverse_dom(&traversal, token, Some(rayon_pool));
let shared = DomTraversal::<ServoLayoutElement>::shared_context(&traversal);
let root_node = document.root_element().unwrap().as_node();
let box_tree = rayon_pool.install(|| BoxTreeRoot::construct(shared, root_node));
let box_tree = rayon_pool.install(|| BoxTreeRoot::construct(traversal.context(), root_node));
Some(box_tree)
} else {
None