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

@ -8,6 +8,7 @@ use dom::OpaqueNode;
use error_reporting::ParseErrorReporter;
use euclid::Size2D;
use matching::{ApplicableDeclarationsCache, StyleSharingCandidateCache};
use properties::TComputedValues;
use selector_impl::SelectorImplExt;
use selector_matching::Stylist;
use std::cell::RefCell;
@ -54,15 +55,15 @@ pub struct SharedStyleContext<Impl: SelectorImplExt> {
pub error_reporter: Box<ParseErrorReporter + Sync>,
}
pub struct LocalStyleContext {
pub applicable_declarations_cache: RefCell<ApplicableDeclarationsCache>,
pub style_sharing_candidate_cache: RefCell<StyleSharingCandidateCache>,
pub struct LocalStyleContext<C: TComputedValues> {
pub applicable_declarations_cache: RefCell<ApplicableDeclarationsCache<C>>,
pub style_sharing_candidate_cache: RefCell<StyleSharingCandidateCache<C>>,
}
pub trait StyleContext<'a, Impl: SelectorImplExt> {
pub trait StyleContext<'a, Impl: SelectorImplExt, C: TComputedValues> {
fn shared_context(&self) -> &'a SharedStyleContext<Impl>;
fn local_context(&self) -> &LocalStyleContext;
fn local_context(&self) -> &LocalStyleContext<C>;
}
/// Why we're doing reflow.