Rework MediaType to be an atom-based struct instead of an enum.

MozReview-Commit-ID: 1Tfrs9PBkhA
This commit is contained in:
Brad Werth 2017-08-07 10:30:48 -07:00 committed by Brad Werth
parent 77cb5371b3
commit 557ffa979d
9 changed files with 92 additions and 72 deletions

View file

@ -481,7 +481,7 @@ impl LayoutThread {
// The device pixel ratio is incorrect (it does not have the hidpi value),
// but it will be set correctly when the initial reflow takes place.
let device = Device::new(
MediaType::Screen,
MediaType::screen(),
opts::get().initial_window_size.to_f32() * ScaleFactor::new(1.0),
ScaleFactor::new(opts::get().device_pixels_per_px.unwrap_or(1.0)));
@ -1156,7 +1156,7 @@ impl LayoutThread {
let document_shared_lock = document.style_shared_lock();
self.document_shared_lock = Some(document_shared_lock.clone());
let author_guard = document_shared_lock.read();
let device = Device::new(MediaType::Screen, initial_viewport, device_pixel_ratio);
let device = Device::new(MediaType::screen(), initial_viewport, device_pixel_ratio);
self.stylist.set_device(device, &author_guard, &data.document_stylesheets);
self.viewport_size =