layout_thread: Add an assertion that reflows destined for the display

have no layout queries, and vice versa.

We should clean this up, but let's enforce it with an assert for now.
This commit is contained in:
Patrick Walton 2016-09-21 12:00:17 -07:00
parent 22ba0e16e0
commit 1235f4bff6

View file

@ -1038,6 +1038,12 @@ impl LayoutThread {
let document = unsafe { ServoLayoutNode::new(&data.document) };
let document = document.as_document().unwrap();
// FIXME(pcwalton): Combine `ReflowGoal` and `ReflowQueryType`. Then remove this assert.
debug_assert!((data.reflow_info.goal == ReflowGoal::ForDisplay &&
data.query_type == ReflowQueryType::NoQuery) ||
(data.reflow_info.goal == ReflowGoal::ForScriptQuery &&
data.query_type != ReflowQueryType::NoQuery));
debug!("layout: received layout request for: {}", self.url);
let mut rw_data = possibly_locked_rw_data.lock();