mirror of
https://github.com/servo/servo.git
synced 2025-07-02 21:13:39 +01:00
style: Make structs uncacheable if ex/ch units are used.
Computing them depends on font metrics.
This commit is contained in:
parent
1cde26eacb
commit
5f17e2d13c
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue