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
This commit is contained in:
Emilio Cobos Álvarez 2017-11-10 16:48:44 +01:00
parent a09f5208d4
commit 6747eb7f45
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -185,7 +185,7 @@ impl FontRelativeLength {
// element, the rem units refer to the propertys 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()