mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
Bug 1325734 - Pass the thread-local context into should_traverse_children. r=emilio
This commit is contained in:
parent
3060865577
commit
92b9d70c3a
4 changed files with 32 additions and 10 deletions
|
@ -16,6 +16,7 @@ use net_traits::image_cache_thread::{ImageOrMetadataAvailable, UsePlaceholder};
|
|||
use parking_lot::RwLock;
|
||||
use servo_config::opts;
|
||||
use servo_url::ServoUrl;
|
||||
use std::borrow::{Borrow, BorrowMut};
|
||||
use std::cell::{RefCell, RefMut};
|
||||
use std::collections::HashMap;
|
||||
use std::hash::BuildHasherDefault;
|
||||
|
@ -37,6 +38,18 @@ impl<E: TElement> ScopedThreadLocalLayoutContext<E> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<E: TElement> Borrow<ThreadLocalStyleContext<E>> for ScopedThreadLocalLayoutContext<E> {
|
||||
fn borrow(&self) -> &ThreadLocalStyleContext<E> {
|
||||
&self.style_context
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: TElement> BorrowMut<ThreadLocalStyleContext<E>> for ScopedThreadLocalLayoutContext<E> {
|
||||
fn borrow_mut(&mut self) -> &mut ThreadLocalStyleContext<E> {
|
||||
&mut self.style_context
|
||||
}
|
||||
}
|
||||
|
||||
/// TLS data that persists across traversals.
|
||||
pub struct PersistentThreadLocalLayoutContext {
|
||||
// FontContext uses Rc all over the place and so isn't Send, which means we
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue