Bug 899886 - Don't return null from nsStyleSet::ReparentStyleContext. r=dbaron
authorCameron McCormack <cam@mcc.id.au>
Sat, 03 Aug 2013 14:11:05 +1000
changeset 141252 5b3ec8bf8bbca03033a924805d8979f44b3f78c3
parent 141251 ce984b387db8cbd7d21712dbea231696ac3e6e2b
child 141253 c732306ad9afd92ec78ee0503b209c5e1923fa3b
push id32037
push usercmccormack@mozilla.com
push dateSat, 03 Aug 2013 04:12:04 +0000
treeherdermozilla-inbound@dc5bce83d801 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs899886
milestone25.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 899886 - Don't return null from nsStyleSet::ReparentStyleContext. r=dbaron
layout/style/nsStyleSet.cpp
--- a/layout/style/nsStyleSet.cpp
+++ b/layout/style/nsStyleSet.cpp
@@ -1736,20 +1736,17 @@ SkipAnimationRules(nsRuleNode* aRuleNode
   return ruleNode;
 }
 
 already_AddRefed<nsStyleContext>
 nsStyleSet::ReparentStyleContext(nsStyleContext* aStyleContext,
                                  nsStyleContext* aNewParentContext,
                                  Element* aElement)
 {
-  if (!aStyleContext) {
-    NS_NOTREACHED("must have style context");
-    return nullptr;
-  }
+  MOZ_ASSERT(aStyleContext, "aStyleContext must not be null");
 
   // This short-circuit is OK because we don't call TryStartingTransition
   // during style reresolution if the style context pointer hasn't changed.
   if (aStyleContext->GetParent() == aNewParentContext) {
     nsRefPtr<nsStyleContext> ret = aStyleContext;
     return ret.forget();
   }