From e04273a4d96a3eb595d392a183e9b5e277da0279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 1 Aug 2019 17:29:01 +0200 Subject: [PATCH] style: Move the overrides to a separate struct in nsPresContext. Just so that we can keep track of these together. Differential Revision: https://phabricator.services.mozilla.com/D40247 --- components/style/gecko/media_queries.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/components/style/gecko/media_queries.rs b/components/style/gecko/media_queries.rs index 87663473542..ecd9115a4cb 100644 --- a/components/style/gecko/media_queries.rs +++ b/components/style/gecko/media_queries.rs @@ -213,11 +213,11 @@ impl Device { None => return MediaType::screen(), }; - // Gecko allows emulating random media with mMediaEmulated. - let medium_to_use = if !pc.mMediaEmulated.mRawPtr.is_null() { - pc.mMediaEmulated.mRawPtr + // Gecko allows emulating random media with mMediaEmulationData.mMedium. + let medium_to_use = if !pc.mMediaEmulationData.mMedium.mRawPtr.is_null() { + pc.mMediaEmulationData.mMedium.mRawPtr } else { - pc.mMedium as *const bindings::nsAtom as *mut _ + pc.mMedium as *const structs::nsAtom as *mut _ }; MediaType(CustomIdent(unsafe { Atom::from_raw(medium_to_use) })) @@ -252,9 +252,8 @@ impl Device { None => return Scale::new(1.), }; - let override_dppx = pc.mOverrideDPPX; - if override_dppx > 0.0 { - return Scale::new(override_dppx); + if pc.mMediaEmulationData.mDPPX > 0.0 { + return Scale::new(pc.mMediaEmulationData.mDPPX); } let au_per_dpx = pc.mCurAppUnitsPerDevPixel as f32;