mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +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(),
|
||||
};
|
||||
|
||||
// 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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue