diff --git a/components/style/thread_state.rs b/components/style/thread_state.rs index 894cdb4a813..d06f47aabe4 100644 --- a/components/style/thread_state.rs +++ b/components/style/thread_state.rs @@ -53,7 +53,9 @@ thread_local!(static STATE: RefCell> = RefCell::new(None)); pub fn initialize(x: ThreadState) { STATE.with(|ref k| { if let Some(ref s) = *k.borrow() { - panic!("Thread state already initialized as {:?}", s); + if x != *s { + panic!("Thread state already initialized as {:?}", s); + } } *k.borrow_mut() = Some(x); });