mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +01:00
Bug 1331213: Implement Device::media_type, without supporting overrides for now. r=heycam
MozReview-Commit-ID: 9AeHViwoX1t Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
parent
646258e5a0
commit
13878d674c
1 changed files with 11 additions and 2 deletions
|
@ -76,8 +76,17 @@ impl Device {
|
||||||
|
|
||||||
/// Returns the current media type of the device.
|
/// Returns the current media type of the device.
|
||||||
pub fn media_type(&self) -> MediaType {
|
pub fn media_type(&self) -> MediaType {
|
||||||
// TODO
|
unsafe {
|
||||||
MediaType::Screen
|
// FIXME(emilio): Gecko allows emulating random media with
|
||||||
|
// mIsEmulatingMedia / mMediaEmulated . Refactor both sides so that
|
||||||
|
// is supported (probably just making MediaType an Atom).
|
||||||
|
if (*self.pres_context).mMedium == atom!("screen").as_ptr() {
|
||||||
|
MediaType::Screen
|
||||||
|
} else {
|
||||||
|
debug_assert!((*self.pres_context).mMedium == atom!("print").as_ptr());
|
||||||
|
MediaType::Print
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the current viewport size in app units.
|
/// Returns the current viewport size in app units.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue