return result;
return nsnull;
StyleSetImpl::ReParentStyleContext(nsIPresContext* aPresContext,                                   nsIStyleContext* aStyleContext,                                    nsIStyleContext* aNewParentContext,                                   nsIStyleContext** aNewStyleContext){  NS_ASSERTION(aPresContext, "must have pres context");  NS_ASSERTION(aStyleContext, "must have style context");  NS_ASSERTION(aNewStyleContext, "must have new style context");  nsresult result = NS_ERROR_NULL_POINTER;  if (aPresContext && aStyleContext && aNewStyleContext) {    nsCOMPtr<nsIStyleContext> oldParent = aStyleContext->GetParent();    if (oldParent == aNewParentContext) {      result = NS_OK;      NS_ADDREF(aStyleContext);   // for return      *aNewStyleContext = aStyleContext;    }    else {  // really a new parent      nsIStyleContext*  newChild = nsnull;      nsCOMPtr<nsIAtom>  pseudoTag;      aStyleContext->GetPseudoType(*getter_AddRefs(pseudoTag));      nsRuleNode* ruleNode;      aStyleContext->GetRuleNode(&ruleNode);      if (aNewParentContext) {        result = aNewParentContext->FindChildWithRules(pseudoTag, ruleNode, newChild);      }      if (newChild) { // new parent already has one        *aNewStyleContext = newChild;      }      else {  // need to make one in the new parent        result = NS_NewStyleContext(aNewStyleContext, aNewParentContext, pseudoTag,                                    ruleNode, aPresContext);      }    }  }  return result;}