From 226c946817465a83dd22c96a0d4cd6733d536caa Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Fri, 18 Nov 2016 17:01:05 +0800 Subject: [PATCH] Mark the Gecko main thread as a Servo layout thread. This is needed to keep the assertion in the RuleTree GC functions that checks we're being called on the non-worker layout thread. --- ports/geckolib/glue.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 37a69ed07c8..c0b4d59d373 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -46,6 +46,7 @@ use style::selector_parser::PseudoElementCascadeType; use style::sequential; use style::string_cache::Atom; use style::stylesheets::{Origin, Stylesheet}; +use style::thread_state; use style::timer::Timer; use style_traits::ToCss; @@ -66,6 +67,9 @@ pub extern "C" fn Servo_Initialize() -> () { // Allocate our default computed values. unsafe { ComputedValues::initialize(); } + + // Pretend that we're a Servo Layout thread, to make some assertions happy. + thread_state::initialize(thread_state::LAYOUT); } #[no_mangle]