mirror of
https://github.com/servo/servo.git
synced 2025-08-20 04:45:33 +01:00
style: Make WorkQueue creation fallible.
Fixes bug 1290205 in bugzilla.
This commit is contained in:
parent
8a5e1b70b7
commit
4194ba063a
4 changed files with 43 additions and 15 deletions
|
@ -103,11 +103,11 @@ fn restyle_subtree(node: GeckoNode, raw_data: *mut RawServoStyleSet) {
|
|||
|
||||
// We ensure this is true before calling Servo_RestyleSubtree()
|
||||
debug_assert!(node.is_dirty() || node.has_dirty_descendants());
|
||||
if per_doc_data.num_threads == 1 {
|
||||
if per_doc_data.num_threads == 1 || per_doc_data.work_queue.is_none() {
|
||||
sequential::traverse_dom::<GeckoNode, RecalcStyleOnly>(node, &shared_style_context);
|
||||
} else {
|
||||
parallel::traverse_dom::<GeckoNode, RecalcStyleOnly>(node, &shared_style_context,
|
||||
&mut per_doc_data.work_queue);
|
||||
per_doc_data.work_queue.as_mut().unwrap());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue