Bug 1367635 - Part 11: Don't re-cache structs if we just got them from the cache. r?emilio draft
authorCameron McCormack <cam@mcc.id.au>
Thu, 14 Sep 2017 09:10:43 +0800
changeset 664574 cdfd33c3a663907092e657d1b394021eef7d8fe5
parent 664573 5d176389f3171370e362b77fce8a9e84551ce06f
child 731472 91f31093355b4a783c4738c74a8af49d1fb2e00d
push id79725
push userbmo:cam@mcc.id.au
push dateThu, 14 Sep 2017 03:06:57 +0000
reviewersemilio
bugs1367635
milestone57.0a1
Bug 1367635 - Part 11: Don't re-cache structs if we just got them from the cache. r?emilio MozReview-Commit-ID: IufheKDgnki
servo/components/style/properties/properties.mako.rs
--- a/servo/components/style/properties/properties.mako.rs
+++ b/servo/components/style/properties/properties.mako.rs
@@ -3512,17 +3512,23 @@ where
         }
     % endif
 
     builder.clear_modified_reset();
 
     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();
     }
 
     builder.build()
 }
 
 /// See StyleAdjuster::adjust_for_border_width.