mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
style: Remove some uses of unused unsafe.
This commit is contained in:
parent
2efbf2230a
commit
69ddb9501b
10 changed files with 45 additions and 60 deletions
|
@ -157,18 +157,16 @@ impl Device {
|
|||
|
||||
/// Returns the current media type of the device.
|
||||
pub fn media_type(&self) -> MediaType {
|
||||
unsafe {
|
||||
// Gecko allows emulating random media with mIsEmulatingMedia and
|
||||
// mMediaEmulated.
|
||||
let context = self.pres_context();
|
||||
let medium_to_use = if context.mIsEmulatingMedia() != 0 {
|
||||
context.mMediaEmulated.mRawPtr
|
||||
} else {
|
||||
context.mMedium
|
||||
};
|
||||
// Gecko allows emulating random media with mIsEmulatingMedia and
|
||||
// mMediaEmulated.
|
||||
let context = self.pres_context();
|
||||
let medium_to_use = if context.mIsEmulatingMedia() != 0 {
|
||||
context.mMediaEmulated.mRawPtr
|
||||
} else {
|
||||
context.mMedium
|
||||
};
|
||||
|
||||
MediaType(CustomIdent(Atom::from(medium_to_use)))
|
||||
}
|
||||
MediaType(CustomIdent(Atom::from(medium_to_use)))
|
||||
}
|
||||
|
||||
/// Returns the current viewport size in app units.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue