From a59fceeefc3c5c44f95875206acd91d89755f62c Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Mon, 31 Jul 2017 14:06:04 +1000 Subject: [PATCH] Handle device-pixel-ratio-webkit pref correctly. --- components/style/gecko/media_queries.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/style/gecko/media_queries.rs b/components/style/gecko/media_queries.rs index 764fb6392be..27d8a5f6c62 100644 --- a/components/style/gecko/media_queries.rs +++ b/components/style/gecko/media_queries.rs @@ -490,10 +490,13 @@ impl Expression { let result = { let mut feature_name = &**ident; - // TODO(emilio): this is under a pref in Gecko. - if starts_with_ignore_ascii_case(feature_name, "-webkit-") { + if unsafe { structs::StylePrefs_sWebkitPrefixedAliasesEnabled } && + starts_with_ignore_ascii_case(feature_name, "-webkit-") { feature_name = &feature_name[8..]; flags |= nsMediaFeature_RequirementFlags::eHasWebkitPrefix as u8; + if unsafe { structs::StylePrefs_sWebkitDevicePixelRatioEnabled } { + flags |= nsMediaFeature_RequirementFlags::eWebkitDevicePixelRatioPrefEnabled as u8; + } } let range = if starts_with_ignore_ascii_case(feature_name, "min-") {