Struct style::values::computed::Context [] [src]

pub struct Context<'a> {
    pub is_root_element: bool,
    pub builder: StyleBuilder<'a>,
    pub cached_system_font: Option<()>,
    pub font_metrics_provider: &'a FontMetricsProvider,
    pub in_media_query: bool,
    pub quirks_mode: QuirksMode,
    pub for_smil_animation: bool,
    pub for_non_inherited_property: Option<LonghandId>,
    pub rule_cache_conditions: RefCell<&'a mut RuleCacheConditions>,
}

A Context is all the data a specified value could ever need to compute itself and be transformed to a computed value.

Fields

Whether the current element is the root element.

Values accessed through this need to be in the properties "computed early": color, text-decoration, font-size, display, position, float, border-*-style, outline-style, font-family, writing-mode...

A dummy option for servo so initializing a computed::Context isn't painful.

TODO(emilio): Make constructors for Context, and drop this.

A font metrics provider, used to access font metrics to implement font-relative units.

Whether or not we are computing the media list in a media query

The quirks mode of this context.

Whether this computation is being done for a SMIL animation.

This is used to allow certain properties to generate out-of-range values, which SMIL allows.

The property we are computing a value for, if it is a non-inherited property. None if we are computed a value for an inherited property or not computing for a property at all (e.g. in a media query evaluation).

The conditions to cache a rule node on the rule cache.

FIXME(emilio): Drop the refcell.

Methods

impl<'a> Context<'a>
[src]

[src]

Creates a suitable context for media query evaluation, in which font-relative units compute against the system_font, and executes f with it.

[src]

Whether the current element is the root element.

[src]

The current device.

[src]

The current viewport size, used to resolve viewport units.

[src]

The default computed style we're getting our reset style from.

[src]

The current style.

[src]

(Servo doesn't do text-zoom)