pub struct Environment {
pub inner_width: u32,
pub inner_height: u32,
pub device_pixel_ratio: u32,
pub touch_points: u32,
pub viewport_honoured: bool,
}Expand description
What the page actually saw, read back from the page itself.
§Why this is recorded
Dimensions alone cannot tell you whether a screenshot is right. A capture
can be exactly 1320x2868 and still show a desktop layout scaled into a
phone frame, because a page served to a desktop User-Agent may declare
<meta name="viewport" content="width=1120"> and Chrome honours it.
Every size assertion passes; the image is useless.
So the run records the viewport and touch points the page reported, and callers can assert on the environment rather than only on the output.
Fields§
§inner_width: u32window.innerWidth as the page saw it.
inner_height: u32window.innerHeight as the page saw it.
device_pixel_ratio: u32devicePixelRatio as the page saw it.
touch_points: u32navigator.maxTouchPoints.
viewport_honoured: boolWhether the layout viewport matched what was requested. False means the page overrode it, which usually means content negotiation served the wrong layout.
Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
Source§fn clone(&self) -> Environment
fn clone(&self) -> Environment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more