From 8d3f6b116d9fed8219e0cb0f2e5d4122a0c84db2 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Thu, 14 Sep 2017 09:10:43 +0800 Subject: [PATCH] style: Don't re-cache structs if we just got them from the cache. --- components/style/properties/properties.mako.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 3fa6bcb6e04..3b2a804b24b 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -3529,7 +3529,13 @@ where StyleAdjuster::new(&mut builder) .adjust(layout_parent_style, flags); - if builder.modified_reset() { + if builder.modified_reset() || !apply_reset { + // If we adjusted any reset structs, we can't cache this ComputedValues. + // + // Also, if we re-used existing reset structs, don't bother caching it + // back again. (Aside from being wasted effort, it will be wrong, since + // context.rule_cache_conditions won't be set appropriately if we + // didn't compute those reset properties.) context.rule_cache_conditions.borrow_mut() .set_uncacheable(); }