diff --git a/components/style/properties.mako.rs b/components/style/properties.mako.rs index 7a453bd8ac3..10306a9c097 100644 --- a/components/style/properties.mako.rs +++ b/components/style/properties.mako.rs @@ -6847,7 +6847,7 @@ pub fn cascade(viewport_size: Size2D, } if is_root_element { - context.root_font_size = context.font_size; + style.root_font_size = context.font_size; } if seen.get_font_style() || seen.get_font_weight() || seen.get_font_stretch() || diff --git a/tests/wpt/mozilla/tests/css/font_size.html b/tests/wpt/mozilla/tests/css/font_size.html index 04b7ef1a0c7..921e2887d2b 100644 --- a/tests/wpt/mozilla/tests/css/font_size.html +++ b/tests/wpt/mozilla/tests/css/font_size.html @@ -1,10 +1,12 @@ + font-size (issues #1435, #3417)

24pt is 32px.

2em is 40px. +

2rem is 14px.

200% is 40px.

smaller is 17px.

larger is 24px. diff --git a/tests/wpt/mozilla/tests/css/font_size_ref.html b/tests/wpt/mozilla/tests/css/font_size_ref.html index 62adacf79f3..a046358a884 100644 --- a/tests/wpt/mozilla/tests/css/font_size_ref.html +++ b/tests/wpt/mozilla/tests/css/font_size_ref.html @@ -4,6 +4,7 @@

24pt is 32px.

2em is 40px. +

2rem is 14px.

200% is 40px.

smaller is 17px.

larger is 24px.