mirror of
https://github.com/servo/servo.git
synced 2025-09-29 16:19:14 +01:00
Rework MediaType to be an atom-based struct instead of an enum.
MozReview-Commit-ID: 1Tfrs9PBkhA
This commit is contained in:
parent
77cb5371b3
commit
557ffa979d
9 changed files with 92 additions and 72 deletions
|
@ -223,7 +223,7 @@ fn test_insert() {
|
|||
}
|
||||
|
||||
fn mock_stylist() -> Stylist {
|
||||
let device = Device::new(MediaType::Screen, TypedSize2D::new(0f32, 0f32), ScaleFactor::new(1.0));
|
||||
let device = Device::new(MediaType::screen(), TypedSize2D::new(0f32, 0f32), ScaleFactor::new(1.0));
|
||||
Stylist::new(device, QuirksMode::NoQuirks)
|
||||
}
|
||||
|
||||
|
@ -231,9 +231,9 @@ fn mock_stylist() -> Stylist {
|
|||
fn test_stylist_device_accessors() {
|
||||
thread_state::initialize(thread_state::LAYOUT);
|
||||
let stylist = mock_stylist();
|
||||
assert_eq!(stylist.device().media_type(), MediaType::Screen);
|
||||
assert_eq!(stylist.device().media_type(), MediaType::screen());
|
||||
let mut stylist_mut = mock_stylist();
|
||||
assert_eq!(stylist_mut.device_mut().media_type(), MediaType::Screen);
|
||||
assert_eq!(stylist_mut.device_mut().media_type(), MediaType::screen());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue