style: Make structs uncacheable if ex/ch units are used.

Computing them depends on font metrics.
This commit is contained in:
Cameron McCormack 2017-09-13 16:05:24 +08:00
parent 1cde26eacb
commit 5f17e2d13c

View file

@ -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