mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Parameterize the rest of the style system on TNode.
This commit is contained in:
parent
5c749127cc
commit
c2daea2c9c
37 changed files with 149 additions and 113 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue