Bug 1384542: Make possible to cache NS_STYLE_JUSTIFY_AUTO position structs. r?heycam draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 27 Jul 2017 03:19:49 +0200
changeset 616429 1c1ea6f3d62a1bd5719eff641bd8f7bec537fbad
parent 616428 dc2131ea01bc7436fd3941741383ecd7ffe971dc
child 639467 5c5337c29c05b29842039a3e0357815f65be7fcb
push id70679
push userbmo:emilio+bugs@crisal.io
push dateThu, 27 Jul 2017 01:21:40 +0000
reviewersheycam
bugs1384542
milestone56.0a1
Bug 1384542: Make possible to cache NS_STYLE_JUSTIFY_AUTO position structs. r?heycam MozReview-Commit-ID: FsMTnBDS5Sa
layout/style/nsRuleNode.cpp
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -8682,19 +8682,17 @@ nsRuleNode::ComputePositionData(void* aS
     conditions.SetUncacheable();
   } else {
     SetValue(justifyItemsValue,
              pos->mSpecifiedJustifyItems, conditions,
              SETVAL_ENUMERATED | SETVAL_UNSET_INITIAL,
              parentPos->mSpecifiedJustifyItems, // unused, we handle 'inherit' above
              NS_STYLE_JUSTIFY_AUTO);
     if (pos->mSpecifiedJustifyItems == NS_STYLE_JUSTIFY_AUTO) {
-      // FIXME(emilio): This is kind of unfortunate because this is a reset
-      // property and AUTO is the default value... Can we do better?
-      conditions.SetUncacheable();
+      conditions.SetParentJustifyItemsDependency(parentPos->mJustifyItems);
     }
   }
 
   pos->mJustifyItems = ComputedJustifyItems(pos->mSpecifiedJustifyItems,
                                             parentPos->mJustifyItems);
 
   // justify-self: enum, inherit, initial
   SetValue(*aRuleData->ValueForJustifySelf(),