From 5f17e2d13c44958193bb408a11d3f43de52d332d Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Wed, 13 Sep 2017 16:05:24 +0800 Subject: [PATCH] style: Make structs uncacheable if ex/ch units are used. Computing them depends on font metrics. --- components/style/values/specified/length.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/style/values/specified/length.rs b/components/style/values/specified/length.rs index be051c6f9c4..0e28f38eedd 100644 --- a/components/style/values/specified/length.rs +++ b/components/style/values/specified/length.rs @@ -140,6 +140,9 @@ impl FontRelativeLength { (reference_font_size, length) }, FontRelativeLength::Ex(length) => { + if context.for_non_inherited_property.is_some() { + context.rule_cache_conditions.borrow_mut().set_uncacheable(); + } let reference_size = match query_font_metrics(context, reference_font_size) { FontMetricsQueryResult::Available(metrics) => { metrics.x_height @@ -157,6 +160,9 @@ impl FontRelativeLength { (reference_size, length) }, FontRelativeLength::Ch(length) => { + if context.for_non_inherited_property.is_some() { + context.rule_cache_conditions.borrow_mut().set_uncacheable(); + } let reference_size = match query_font_metrics(context, reference_font_size) { FontMetricsQueryResult::Available(metrics) => { metrics.zero_advance_measure