mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
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
This commit is contained in:
parent
07b8666029
commit
e04273a4d9
1 changed files with 6 additions and 7 deletions
|
@ -213,11 +213,11 @@ impl Device {
|
||||||
None => return MediaType::screen(),
|
None => return MediaType::screen(),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Gecko allows emulating random media with mMediaEmulated.
|
// Gecko allows emulating random media with mMediaEmulationData.mMedium.
|
||||||
let medium_to_use = if !pc.mMediaEmulated.mRawPtr.is_null() {
|
let medium_to_use = if !pc.mMediaEmulationData.mMedium.mRawPtr.is_null() {
|
||||||
pc.mMediaEmulated.mRawPtr
|
pc.mMediaEmulationData.mMedium.mRawPtr
|
||||||
} else {
|
} 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) }))
|
MediaType(CustomIdent(unsafe { Atom::from_raw(medium_to_use) }))
|
||||||
|
@ -252,9 +252,8 @@ impl Device {
|
||||||
None => return Scale::new(1.),
|
None => return Scale::new(1.),
|
||||||
};
|
};
|
||||||
|
|
||||||
let override_dppx = pc.mOverrideDPPX;
|
if pc.mMediaEmulationData.mDPPX > 0.0 {
|
||||||
if override_dppx > 0.0 {
|
return Scale::new(pc.mMediaEmulationData.mDPPX);
|
||||||
return Scale::new(override_dppx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let au_per_dpx = pc.mCurAppUnitsPerDevPixel as f32;
|
let au_per_dpx = pc.mCurAppUnitsPerDevPixel as f32;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue