mirror of
https://github.com/servo/servo.git
synced 2025-08-17 11:25:35 +01:00
style: Implement the env() function with hardcoded zeros for safe-area-inset.
Intent to Implement and Ship: https://groups.google.com/d/msg/mozilla.dev.platform/EVKyR1B87T0/_l-_qK8SAAAJ Differential Revision: https://phabricator.services.mozilla.com/D9609
This commit is contained in:
parent
5af6abfb78
commit
b7da1bac88
11 changed files with 346 additions and 136 deletions
|
@ -7,6 +7,7 @@
|
|||
use app_units::AU_PER_PX;
|
||||
use app_units::Au;
|
||||
use cssparser::RGBA;
|
||||
use custom_properties::CssEnvironment;
|
||||
use euclid::Size2D;
|
||||
use euclid::TypedScale;
|
||||
use gecko::values::{convert_nscolor_to_rgba, convert_rgba_to_nscolor};
|
||||
|
@ -52,6 +53,9 @@ pub struct Device {
|
|||
/// Whether any styles computed in the document relied on the viewport size
|
||||
/// by using vw/vh/vmin/vmax units.
|
||||
used_viewport_size: AtomicBool,
|
||||
/// The CssEnvironment object responsible of getting CSS environment
|
||||
/// variables.
|
||||
environment: CssEnvironment,
|
||||
}
|
||||
|
||||
impl fmt::Debug for Device {
|
||||
|
@ -87,9 +91,16 @@ impl Device {
|
|||
body_text_color: AtomicUsize::new(unsafe { &*pres_context }.mDefaultColor as usize),
|
||||
used_root_font_size: AtomicBool::new(false),
|
||||
used_viewport_size: AtomicBool::new(false),
|
||||
environment: CssEnvironment,
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the relevant environment to resolve `env()` functions.
|
||||
#[inline]
|
||||
pub fn environment(&self) -> &CssEnvironment {
|
||||
&self.environment
|
||||
}
|
||||
|
||||
/// Tells the device that a new viewport rule has been found, and stores the
|
||||
/// relevant viewport constraints.
|
||||
pub fn account_for_viewport_rule(&mut self, _constraints: &ViewportConstraints) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue