From 6747eb7f45ef57ca37211f347358bfcb9e5a7e89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 10 Nov 2017 16:48:44 +0100 Subject: [PATCH] style: Fix evaluation of rem inside media queries. Also fix the tests so that they would've caught this. Bug: 1396057 Reviewed-by: Manishearth MozReview-Commit-ID: ByaR4ZA995l --- components/style/values/specified/length.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/style/values/specified/length.rs b/components/style/values/specified/length.rs index 19eeb33bbcd..1cacd0b1791 100644 --- a/components/style/values/specified/length.rs +++ b/components/style/values/specified/length.rs @@ -185,7 +185,7 @@ impl FontRelativeLength { // element, the rem units refer to the property’s initial // value. // - let reference_size = if context.is_root_element { + let reference_size = if context.is_root_element || context.in_media_query { reference_font_size } else { context.device().root_font_size()