From 07b8666029d44921e9f9b2315fb9921029a03fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 1 Aug 2019 18:15:04 +0200 Subject: [PATCH] style: Simplify emulated medium setup in nsPresContext. Differential Revision: https://phabricator.services.mozilla.com/D40246 --- components/style/gecko/media_queries.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/style/gecko/media_queries.rs b/components/style/gecko/media_queries.rs index 556470569db..87663473542 100644 --- a/components/style/gecko/media_queries.rs +++ b/components/style/gecko/media_queries.rs @@ -213,12 +213,11 @@ impl Device { None => return MediaType::screen(), }; - // Gecko allows emulating random media with mIsEmulatingMedia and - // mMediaEmulated. - let medium_to_use = if pc.mIsEmulatingMedia() != 0 { + // Gecko allows emulating random media with mMediaEmulated. + let medium_to_use = if !pc.mMediaEmulated.mRawPtr.is_null() { pc.mMediaEmulated.mRawPtr } else { - pc.mMedium + pc.mMedium as *const bindings::nsAtom as *mut _ }; MediaType(CustomIdent(unsafe { Atom::from_raw(medium_to_use) }))