layout: Add a new cascading mode that inherits all properties, even

non-inheritable ones.

This works like the `modify_style_for_*` functions and will allow us to
easily migrate from them to real cascading.
This commit is contained in:
Patrick Walton 2016-10-24 18:00:06 -07:00
parent 93e41ba4aa
commit fb2d1e1020
6 changed files with 86 additions and 43 deletions

View file

@ -265,9 +265,10 @@ pub trait ThreadSafeLayoutNode: Clone + Copy + NodeInfo + PartialEq + Sized {
.current_styles().pseudos.contains_key(&style_pseudo) {
let mut data = self.get_style_data().unwrap().borrow_mut();
let new_style =
context.stylist
.precomputed_values_for_pseudo(&style_pseudo,
Some(&data.current_styles().primary));
context.stylist.precomputed_values_for_pseudo(
&style_pseudo,
Some(&data.current_styles().primary),
false);
data.current_pseudos_mut()
.insert(style_pseudo.clone(), new_style.unwrap());
}