Pass through visited style for after change

When a transition update is needed during restyling, `get_after_change_style` is
called to re-cascade without transition rules, and this style is then used for
primary styling instead of the style just computed.

`get_after_change_style` used to ignore visited styles, so this meant that if a
transition update was needed, visited styles were effectively dropped.

To fix the crash here, we pass through the existing visited styles when
re-cascading as part of `get_after_change_style`.

MozReview-Commit-ID: 4HBQAdeJ38B
This commit is contained in:
J. Ryan Stinnett 2017-07-07 16:54:22 -05:00
parent 2278a3f981
commit 3463a9c210
4 changed files with 28 additions and 3 deletions

View file

@ -297,6 +297,11 @@ impl CascadeInputs {
self.visited_rules.take()
}
/// Whether there are any visited values.
pub fn has_visited_values(&self) -> bool {
self.visited_values.is_some()
}
/// Gets a reference to the visited computed values. Panic if the element
/// does not have visited computed values.
pub fn visited_values(&self) -> &Arc<ComputedValues> {