aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-05-14 18:53:28 -0500
committerGitHub <noreply@github.com>2017-05-14 18:53:28 -0500
commit8366b4d4f933f3efcadb6e337f2197cadca3e6ed (patch)
tree59432c88a4ce717fb78036d42516104b87d1148b
parent9583aaf21c460cb50471f9e97f22c16ab73ef2df (diff)
parent51166375c6978c39a894bcbeccacf98e3d3eca1b (diff)
downloadservo-8366b4d4f933f3efcadb6e337f2197cadca3e6ed.tar.gz
servo-8366b4d4f933f3efcadb6e337f2197cadca3e6ed.zip
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 -->
-rw-r--r--components/style/properties/properties.mako.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs
index 5772410c38d..79505e92657 100644
--- a/components/style/properties/properties.mako.rs
+++ b/components/style/properties/properties.mako.rs
@@ -2612,6 +2612,7 @@ pub fn apply_declarations<'a, F, I>(device: &Device,
% if category_to_cascade_now == "early":
let writing_mode = get_writing_mode(context.style.get_inheritedbox());
context.style.writing_mode = writing_mode;
+
// It is important that font_size is computed before
// the late properties (for em units), but after font-family
// (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);
% endif
}
+
+ if is_root_element {
+ let s = context.style.get_font().clone_font_size();
+ context.style.root_font_size = s;
+ }
% endif
% endfor
@@ -2686,11 +2692,6 @@ pub fn apply_declarations<'a, F, I>(device: &Device,
}
% endif
- if is_root_element {
- let s = style.get_font().clone_font_size();
- style.root_font_size = s;
- }
-
% if product == "servo":
if seen.contains(LonghandId::FontStyle) ||
seen.contains(LonghandId::FontWeight) ||