mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Ensure the default computed values are up-to-date before evaluating media queries.
Zoom changes can change the meaning of ems, so we can't re-evaluate media queries with the old values, because otherwise we may miss a restyle. Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1357461 MozReview-Commit-ID: HQInvR7RPqR
This commit is contained in:
parent
5c66d3c77a
commit
dd3bf6f952
3 changed files with 20 additions and 13 deletions
|
@ -99,6 +99,13 @@ impl Device {
|
|||
self.root_font_size.store(size.0 as isize, Ordering::Relaxed)
|
||||
}
|
||||
|
||||
/// Recreates the default computed values.
|
||||
pub fn reset_computed_values(&mut self) {
|
||||
// NB: A following stylesheet flush will populate this if appropriate.
|
||||
self.viewport_override = None;
|
||||
self.default_values = ComputedValues::default_values(unsafe { &*self.pres_context });
|
||||
}
|
||||
|
||||
/// Recreates all the temporary state that the `Device` stores.
|
||||
///
|
||||
/// This includes the viewport override from `@viewport` rules, and also the
|
||||
|
@ -106,7 +113,7 @@ impl Device {
|
|||
pub fn reset(&mut self) {
|
||||
// NB: A following stylesheet flush will populate this if appropriate.
|
||||
self.viewport_override = None;
|
||||
self.default_values = ComputedValues::default_values(unsafe { &*self.pres_context });
|
||||
self.reset_computed_values();
|
||||
}
|
||||
|
||||
/// Returns the current media type of the device.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue