Make DOM own the style and layout data, in an UnsafeCell

The previous Cell was a lie.
This commit is contained in:
Anthony Ramine 2020-04-03 18:54:11 +02:00
parent 516e8e0aa6
commit 185a402d9c
17 changed files with 74 additions and 180 deletions

View file

@ -822,23 +822,6 @@ impl ScriptThreadFactory for ScriptThread {
}
impl ScriptThread {
pub(crate) fn get_any_layout_chan() -> Option<Sender<Msg>> {
SCRIPT_THREAD_ROOT.with(|root| {
let script_thread = match root.get() {
Some(s) => unsafe { &*s },
None => return None,
};
script_thread
.documents
.borrow()
.map
.values()
.next()
.map(|d| d.window().layout_chan())
.cloned()
})
}
pub fn runtime_handle() -> ParentRuntime {
SCRIPT_THREAD_ROOT.with(|root| {
let script_thread = unsafe { &*root.get().unwrap() };