servo: Merge #16938 - stylo: Don't mess up traversal drivers (from emilio:traversal-assert); r=bzbarsky

Right now it's harmless, but it trips assertions that are nice to have, just in
case it stops being the case.

Source-Repo: https://github.com/servo/servo
Source-Revision: e1ecd3b89cd9c78b6ce2e936064681df52d265ab

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : f7343d32ffb14a9cd90698a35e41164a9c8ffd92
This commit is contained in:
Emilio Cobos Álvarez 2017-05-18 13:38:41 -05:00
parent 4b27190a36
commit fd7ec9d535

View File

@ -210,14 +210,14 @@ fn traverse_subtree(element: GeckoElement,
debug!("Traversing subtree:");
debug!("{:?}", ShowSubtreeData(element.as_node()));
let traversal_driver = if global_style_data.style_thread_pool.is_none() {
let traversal_driver = if global_style_data.style_thread_pool.is_none() || !element.is_root() {
TraversalDriver::Sequential
} else {
TraversalDriver::Parallel
};
let traversal = RecalcStyleOnly::new(shared_style_context, traversal_driver);
if traversal_driver.is_parallel() && element.is_root() {
if traversal_driver.is_parallel() {
parallel::traverse_dom(&traversal, element, token,
global_style_data.style_thread_pool.as_ref().unwrap());
} else {