mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Simplify emulated medium setup in nsPresContext.
Differential Revision: https://phabricator.services.mozilla.com/D40246
This commit is contained in:
parent
032347f4ff
commit
07b8666029
1 changed files with 3 additions and 4 deletions
|
@ -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) }))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue