mirror of
https://github.com/servo/servo.git
synced 2025-08-15 02:15:33 +01:00
Remove the ComputedValue traits and style_struct_traits
This commit is contained in:
parent
b2a7e44373
commit
789807b7b0
60 changed files with 589 additions and 652 deletions
|
@ -6,12 +6,10 @@ use std::cell::RefCell;
|
|||
use std::rc::Rc;
|
||||
use style::context::{LocalStyleContext, StyleContext};
|
||||
|
||||
thread_local!(static LOCAL_CONTEXT_KEY:
|
||||
RefCell<Option<Rc<LocalStyleContext<GeckoSelectorImpl>>>> = RefCell::new(None));
|
||||
thread_local!(static LOCAL_CONTEXT_KEY: RefCell<Option<Rc<LocalStyleContext>>> = RefCell::new(None));
|
||||
|
||||
// Keep this implementation in sync with the one in components/layout/context.rs.
|
||||
fn create_or_get_local_context(shared: &SharedStyleContext)
|
||||
-> Rc<LocalStyleContext<GeckoSelectorImpl>> {
|
||||
fn create_or_get_local_context(shared: &SharedStyleContext) -> Rc<LocalStyleContext> {
|
||||
LOCAL_CONTEXT_KEY.with(|r| {
|
||||
let mut r = r.borrow_mut();
|
||||
if let Some(context) = r.clone() {
|
||||
|
@ -29,7 +27,7 @@ fn create_or_get_local_context(shared: &SharedStyleContext)
|
|||
|
||||
pub struct StandaloneStyleContext<'a> {
|
||||
pub shared: &'a SharedStyleContext,
|
||||
cached_local_context: Rc<LocalStyleContext<GeckoSelectorImpl>>,
|
||||
cached_local_context: Rc<LocalStyleContext>,
|
||||
}
|
||||
|
||||
impl<'a> StandaloneStyleContext<'a> {
|
||||
|
@ -47,7 +45,7 @@ impl<'a> StyleContext<'a, GeckoSelectorImpl> for StandaloneStyleContext<'a> {
|
|||
&self.shared
|
||||
}
|
||||
|
||||
fn local_context(&self) -> &LocalStyleContext<GeckoSelectorImpl> {
|
||||
fn local_context(&self) -> &LocalStyleContext {
|
||||
&self.cached_local_context
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue