Stop using UnsafeNode in the StyleSharingCandidateCache.

This commit is contained in:
Bobby Holley 2016-12-16 17:42:46 -08:00
parent c5f01fe3b8
commit 946e7fb7c3
7 changed files with 63 additions and 67 deletions

View file

@ -25,13 +25,14 @@ use std::hash::BuildHasherDefault;
use std::rc::Rc;
use std::sync::{Arc, Mutex};
use style::context::{SharedStyleContext, ThreadLocalStyleContext};
use style::dom::TElement;
/// TLS data scoped to the traversal.
pub struct ScopedThreadLocalLayoutContext {
pub style_context: ThreadLocalStyleContext,
pub struct ScopedThreadLocalLayoutContext<E: TElement> {
pub style_context: ThreadLocalStyleContext<E>,
}
impl ScopedThreadLocalLayoutContext {
impl<E: TElement> ScopedThreadLocalLayoutContext<E> {
pub fn new(shared: &SharedLayoutContext) -> Self {
ScopedThreadLocalLayoutContext {
style_context: ThreadLocalStyleContext::new(&shared.style_context),