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) }))