mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
layout: More conservatively replace Stylist's Device (#31857)
Instead of replacing Stylist's device on every reflow, only replace it when the viewport changes. In addition, preserve the root font size from the previous reflow fixing an issue where `rem` units were not properly computed between reflows. This fixes a bug where fonts that are sized using `rem` units change size on reload.
This commit is contained in:
parent
b71de92569
commit
bf3798bbde
8 changed files with 95 additions and 61 deletions
|
@ -81,11 +81,13 @@ impl VirtualMethods for HTMLFontElement {
|
|||
}
|
||||
|
||||
fn attribute_affects_presentational_hints(&self, attr: &Attr) -> bool {
|
||||
if attr.local_name() == &local_name!("color") {
|
||||
if attr.local_name() == &local_name!("color") ||
|
||||
attr.local_name() == &local_name!("size") ||
|
||||
attr.local_name() == &local_name!("face")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// FIXME: Should also return true for `size` and `face` changes!
|
||||
self.super_type()
|
||||
.unwrap()
|
||||
.attribute_affects_presentational_hints(attr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue