Bug 978833 patch 9 - Move keyframe !important data assertion to where it will continue to happen. r=heycam
authorL. David Baron <dbaron@dbaron.org>
Thu, 05 Nov 2015 16:44:09 +0800
changeset 271347 3a1bf2c602114a72dfd99a6aeb737f3cb116076b
parent 271346 0adcd9f3fac0358d859575727b3febeaf420c512
child 271348 da3bf914effe192549fc81b44363fa9ef36a0e69
push id29638
push userkwierso@gmail.com
push dateFri, 06 Nov 2015 02:44:30 +0000
treeherdermozilla-central@cc48981c026c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs978833
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 978833 patch 9 - Move keyframe !important data assertion to where it will continue to happen. r=heycam The current location of the assertion will stop being called in patch 12 and will go away in patch 15; the new location is valid both before and after patch 12.
layout/style/nsAnimationManager.cpp
layout/style/nsCSSRules.cpp
--- a/layout/style/nsAnimationManager.cpp
+++ b/layout/style/nsAnimationManager.cpp
@@ -620,17 +620,22 @@ ResolvedStyleCache::Get(nsPresContext *a
   // properties (e.g., values in 'em').  I presume that they're resolved
   // relative to the other styles of the element.  The question is
   // whether they are resolved relative to other animations:  I assume
   // that they're not, since that would prevent us from caching a lot of
   // data that we'd really like to cache (in particular, the
   // StyleAnimationValue values in AnimationPropertySegment).
   nsStyleContext *result = mCache.GetWeak(aKeyframe);
   if (!result) {
-    aKeyframe->Declaration()->SetImmutable();
+    Declaration* declaration = aKeyframe->Declaration();
+    declaration->SetImmutable();
+    // The spec says that !important declarations should just be ignored
+    MOZ_ASSERT(!declaration->HasImportantData(),
+               "Keyframe rule has !important data");
+
     nsCOMArray<nsIStyleRule> rules;
     rules.AppendObject(aKeyframe);
     RefPtr<nsStyleContext> resultStrong = aPresContext->StyleSet()->
       ResolveStyleByAddingRules(aParentStyleContext, rules);
     mCache.Put(aKeyframe, resultStrong);
     result = resultStrong;
   }
   return result;
--- a/layout/style/nsCSSRules.cpp
+++ b/layout/style/nsCSSRules.cpp
@@ -2073,21 +2073,16 @@ NS_INTERFACE_MAP_END
 IMPL_STYLE_RULE_INHERIT_GET_DOM_RULE_WEAK(nsCSSKeyframeRule, Rule)
 
 /* virtual */ void
 nsCSSKeyframeRule::MapRuleInfoInto(nsRuleData* aRuleData)
 {
   // We need to implement MapRuleInfoInto because the animation manager
   // constructs a rule node pointing to us in order to compute the
   // styles it needs to animate.
-
-  // The spec says that !important declarations should just be ignored
-  NS_ASSERTION(!mDeclaration->HasImportantData(),
-               "Keyframe rules has !important data");
-
   mDeclaration->MapRuleInfoInto(aRuleData);
 }
 
 #ifdef DEBUG
 void
 nsCSSKeyframeRule::List(FILE* out, int32_t aIndent) const
 {
   nsAutoCString str;