style: Record the property we are computing on computed::Context, if it's a non-inherited one.

This commit is contained in:
Cameron McCormack 2017-09-13 16:03:24 +08:00
parent 9230030daa
commit 1cde26eacb
7 changed files with 19 additions and 1 deletions

View file

@ -11,7 +11,7 @@ use font_metrics::FontMetricsProvider;
use media_queries::Device;
#[cfg(feature = "gecko")]
use properties;
use properties::{ComputedValues, StyleBuilder};
use properties::{ComputedValues, LonghandId, StyleBuilder};
use rule_cache::RuleCacheConditions;
#[cfg(feature = "servo")]
use servo_url::ServoUrl;
@ -119,6 +119,12 @@ pub struct Context<'a> {
/// values, which SMIL allows.
pub for_smil_animation: bool,
/// 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).
pub for_non_inherited_property: Option<LonghandId>,
/// The conditions to cache a rule node on the rule cache.
///
/// FIXME(emilio): Drop the refcell.