mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Allow the ComputedValues in ComputedStyle to be null.
This is necessary to start synthesizing the styles in match_element and avoid round-tripping them through the caller.
This commit is contained in:
parent
1c530f9279
commit
5873de3fb6
8 changed files with 53 additions and 32 deletions
|
@ -389,7 +389,7 @@ pub trait ThreadSafeLayoutElement: Clone + Copy + Sized + Debug +
|
|||
fn style(&self, context: &SharedStyleContext) -> Arc<ServoComputedValues> {
|
||||
match self.get_pseudo_element_type() {
|
||||
PseudoElementType::Normal => self.get_style_data().unwrap().borrow()
|
||||
.styles().primary.values.clone(),
|
||||
.styles().primary.values().clone(),
|
||||
other => {
|
||||
// Precompute non-eagerly-cascaded pseudo-element styles if not
|
||||
// cached before.
|
||||
|
@ -406,7 +406,7 @@ pub trait ThreadSafeLayoutElement: Clone + Copy + Sized + Debug +
|
|||
let new_style =
|
||||
context.stylist.precomputed_values_for_pseudo(
|
||||
&style_pseudo,
|
||||
Some(&data.styles().primary.values),
|
||||
Some(data.styles().primary.values()),
|
||||
&context.default_computed_values,
|
||||
false);
|
||||
data.styles_mut().pseudos
|
||||
|
@ -424,7 +424,7 @@ pub trait ThreadSafeLayoutElement: Clone + Copy + Sized + Debug +
|
|||
.lazily_compute_pseudo_element_style(
|
||||
unsafe { &self.unsafe_get() },
|
||||
&style_pseudo,
|
||||
&data.styles().primary.values,
|
||||
data.styles().primary.values(),
|
||||
&context.default_computed_values);
|
||||
data.styles_mut().pseudos
|
||||
.insert(style_pseudo.clone(), new_style.unwrap());
|
||||
|
@ -434,7 +434,7 @@ pub trait ThreadSafeLayoutElement: Clone + Copy + Sized + Debug +
|
|||
|
||||
self.get_style_data().unwrap().borrow()
|
||||
.styles().pseudos.get(&style_pseudo)
|
||||
.unwrap().values.clone()
|
||||
.unwrap().values().clone()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -445,7 +445,7 @@ pub trait ThreadSafeLayoutElement: Clone + Copy + Sized + Debug +
|
|||
data.styles().pseudos
|
||||
.get(&PseudoElement::Selection).map(|s| s)
|
||||
.unwrap_or(&data.styles().primary)
|
||||
.values.clone()
|
||||
.values().clone()
|
||||
}
|
||||
|
||||
/// Returns the already resolved style of the node.
|
||||
|
@ -460,10 +460,10 @@ pub trait ThreadSafeLayoutElement: Clone + Copy + Sized + Debug +
|
|||
let data = self.get_style_data().unwrap().borrow();
|
||||
match self.get_pseudo_element_type() {
|
||||
PseudoElementType::Normal
|
||||
=> data.styles().primary.values.clone(),
|
||||
=> data.styles().primary.values().clone(),
|
||||
other
|
||||
=> data.styles().pseudos
|
||||
.get(&other.style_pseudo_element()).unwrap().values.clone(),
|
||||
.get(&other.style_pseudo_element()).unwrap().values().clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue