From 1235f4bff613df791d5ceb02f3ee04177492563b Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Wed, 21 Sep 2016 12:00:17 -0700 Subject: [PATCH] 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. --- components/layout_thread/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index 2b080bb0d70..8425ff52b78 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -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();