Parameterize the rest of the style system on TNode.

This commit is contained in:
Bobby Holley 2016-03-10 16:17:52 -08:00
parent 5c749127cc
commit c2daea2c9c
37 changed files with 149 additions and 113 deletions

View file

@ -28,13 +28,14 @@ use std::sync::mpsc::Sender;
use std::sync::{Arc, Mutex, RwLock};
use style::context::{LocalStyleContext, StyleContext};
use style::matching::{ApplicableDeclarationsCache, StyleSharingCandidateCache};
use style::properties::ComputedValues;
use style::selector_impl::ServoSelectorImpl;
use style::servo::SharedStyleContext;
use url::Url;
use util::opts;
struct LocalLayoutContext {
style_context: LocalStyleContext,
style_context: LocalStyleContext<ComputedValues>,
font_context: RefCell<FontContext>,
}
@ -112,12 +113,12 @@ pub struct LayoutContext<'a> {
cached_local_layout_context: Rc<LocalLayoutContext>,
}
impl<'a> StyleContext<'a, ServoSelectorImpl> for LayoutContext<'a> {
impl<'a> StyleContext<'a, ServoSelectorImpl, ComputedValues> for LayoutContext<'a> {
fn shared_context(&self) -> &'a SharedStyleContext {
&self.shared.style_context
}
fn local_context(&self) -> &LocalStyleContext {
fn local_context(&self) -> &LocalStyleContext<ComputedValues> {
&self.cached_local_layout_context.style_context
}
}