From 54790d0ae58a60463ac2c9307a834c71c3313945 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 8 Mar 2016 22:17:33 +0100 Subject: [PATCH] Fix the rem unit. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (I think it’s never worked in over a year since it was implemented…) --- components/style/properties.mako.rs | 2 +- tests/wpt/mozilla/tests/css/font_size.html | 2 ++ tests/wpt/mozilla/tests/css/font_size_ref.html | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) 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.