Struct style::servo::media_queries::Device
[−]
[src]
pub struct Device { /* fields omitted */ }A device is a structure that represents the current media a given document is displayed in.
This is the struct against which media queries are evaluated.
Methods
impl Device[src]
pub fn new(
media_type: MediaType,
viewport_size: TypedSize2D<f32, CSSPixel>,
device_pixel_ratio: TypedScale<f32, CSSPixel, DevicePixel>
) -> Device[src]
media_type: MediaType,
viewport_size: TypedSize2D<f32, CSSPixel>,
device_pixel_ratio: TypedScale<f32, CSSPixel, DevicePixel>
) -> Device
Trivially construct a new Device.
pub fn default_computed_values(&self) -> &ComputedValues[src]
Return the default computed values for this device.
pub fn root_font_size(&self) -> Au[src]
Get the font size of the root element (for rem)
pub fn set_root_font_size(&self, size: Au)[src]
Set the font size of the root element (for rem)
pub fn set_body_text_color(&self, _color: RGBA)[src]
Sets the body text color for the "inherit color from body" quirk.
https://quirks.spec.whatwg.org/#the-tables-inherit-color-from-body-quirk
pub fn used_root_font_size(&self) -> bool[src]
Returns whether we ever looked up the root font size of the Device.
pub fn au_viewport_size(&self) -> Size2D<Au>[src]
Returns the viewport size of the current device in app units, needed, among other things, to resolve viewport units.
pub fn au_viewport_size_for_viewport_unit_resolution(&self) -> Size2D<Au>[src]
Like the above, but records that we've used viewport units.
pub fn used_viewport_units(&self) -> bool[src]
Whether viewport units were used since the last device change.
pub fn device_pixel_ratio(&self) -> TypedScale<f32, CSSPixel, DevicePixel>[src]
Returns the device pixel ratio.
pub fn account_for_viewport_rule(&mut self, constraints: &ViewportConstraints)[src]
Take into account a viewport rule taken from the stylesheets.
pub fn media_type(&self) -> MediaType[src]
Return the media type of the current device.
pub fn use_document_colors(&self) -> bool[src]
Returns whether document colors are enabled.
pub fn default_background_color(&self) -> RGBA[src]
Returns the default background color.
Trait Implementations
impl MallocSizeOf for Device[src]
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize[src]
Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more