mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
style: Move root font size handling outside of the cascade.
And merge it with the rest of the code handling root font-size changes. MozReview-Commit-ID: 3rW1C3mXiMd
This commit is contained in:
parent
1425ad1bab
commit
5d03ba3cbe
2 changed files with 8 additions and 10 deletions
|
@ -341,7 +341,6 @@ trait PrivateMatchMethods: TElement {
|
|||
if self.is_native_anonymous() || cascade_target == CascadeTarget::EagerPseudo {
|
||||
cascade_flags.insert(PROHIBIT_DISPLAY_CONTENTS);
|
||||
} else if self.is_root() {
|
||||
debug_assert!(self.owner_doc_matches_for_testing(shared_context.stylist.device()));
|
||||
cascade_flags.insert(IS_ROOT_ELEMENT);
|
||||
}
|
||||
|
||||
|
@ -563,9 +562,14 @@ trait PrivateMatchMethods: TElement {
|
|||
// If the root font-size changed since last time, and something
|
||||
// in the document did use rem units, ensure we recascade the
|
||||
// entire tree.
|
||||
if old_values.map_or(false, |v| v.get_font().clone_font_size() != new_font_size) &&
|
||||
device.used_root_font_size() {
|
||||
child_cascade_requirement = ChildCascadeRequirement::MustCascadeDescendants;
|
||||
if old_values.map_or(true, |v| v.get_font().clone_font_size() != new_font_size) {
|
||||
// FIXME(emilio): This can fire when called from a document
|
||||
// from the bfcache (bug 1376897).
|
||||
debug_assert!(self.owner_doc_matches_for_testing(device));
|
||||
device.set_root_font_size(new_font_size);
|
||||
if device.used_root_font_size() {
|
||||
child_cascade_requirement = ChildCascadeRequirement::MustCascadeDescendants;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue