mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Auto merge of #16855 - emilio:rem-root, r=upsuper
style: Set root font-size right after cascading font-size This way rem in the root element works as expected. This fixes layout/reftests/css-valuesandunits/unit-rem-root-width.html in Gecko. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16855) <!-- Reviewable:end -->
This commit is contained in:
commit
8366b4d4f9
1 changed files with 6 additions and 5 deletions
|
@ -2612,6 +2612,7 @@ pub fn apply_declarations<'a, F, I>(device: &Device,
|
||||||
% if category_to_cascade_now == "early":
|
% if category_to_cascade_now == "early":
|
||||||
let writing_mode = get_writing_mode(context.style.get_inheritedbox());
|
let writing_mode = get_writing_mode(context.style.get_inheritedbox());
|
||||||
context.style.writing_mode = writing_mode;
|
context.style.writing_mode = writing_mode;
|
||||||
|
|
||||||
// It is important that font_size is computed before
|
// It is important that font_size is computed before
|
||||||
// the late properties (for em units), but after font-family
|
// the late properties (for em units), but after font-family
|
||||||
// (for the base-font-size dependence for default and keyword font-sizes)
|
// (for the base-font-size dependence for default and keyword font-sizes)
|
||||||
|
@ -2665,6 +2666,11 @@ pub fn apply_declarations<'a, F, I>(device: &Device,
|
||||||
error_reporter);
|
error_reporter);
|
||||||
% endif
|
% endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if is_root_element {
|
||||||
|
let s = context.style.get_font().clone_font_size();
|
||||||
|
context.style.root_font_size = s;
|
||||||
|
}
|
||||||
% endif
|
% endif
|
||||||
% endfor
|
% endfor
|
||||||
|
|
||||||
|
@ -2686,11 +2692,6 @@ pub fn apply_declarations<'a, F, I>(device: &Device,
|
||||||
}
|
}
|
||||||
% endif
|
% endif
|
||||||
|
|
||||||
if is_root_element {
|
|
||||||
let s = style.get_font().clone_font_size();
|
|
||||||
style.root_font_size = s;
|
|
||||||
}
|
|
||||||
|
|
||||||
% if product == "servo":
|
% if product == "servo":
|
||||||
if seen.contains(LonghandId::FontStyle) ||
|
if seen.contains(LonghandId::FontStyle) ||
|
||||||
seen.contains(LonghandId::FontWeight) ||
|
seen.contains(LonghandId::FontWeight) ||
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue