mRoot->GetDocument(*getter_AddRefs(doc));
mRoot->GetDocument(getter_AddRefs(doc));
nsXULContentBuilder::InitializeRuleNetworkForSimpleRules(InnerNode** aChildNode){    // For simple rules, the rule network will start off looking    // something like this:    //    //   (root)-->(content ^id ?a)-->(?a ^member ?b)    //    nsCOMPtr<nsIDocument> doc;    mRoot->GetDocument(*getter_AddRefs(doc));    NS_ASSERTION(doc != nsnull, "root element has no document");    if (! doc)        return NS_ERROR_FAILURE;    nsCOMPtr<nsIXULDocument> xuldoc = do_QueryInterface(doc);    NS_ASSERTION(xuldoc != nsnull, "expected a XUL Document");    if (! xuldoc)        return NS_ERROR_UNEXPECTED;    nsContentTestNode* idnode =        new nsContentTestNode(mRules.GetRoot(),                              mConflictSet,                              xuldoc,                              this,                              mContentVar,                              mContainerVar,                              nsnull);    if (! idnode)        return NS_ERROR_OUT_OF_MEMORY;    mRules.GetRoot()->AddChild(idnode);    mRules.AddNode(idnode);    // Create (?container ^member ?member)    nsRDFConMemberTestNode* membernode =        new nsRDFConMemberTestNode(idnode,                                   mConflictSet,                                   mDB,                                   mContainmentProperties,                                   mContainerVar,                                   mMemberVar);    if (! membernode)        return NS_ERROR_OUT_OF_MEMORY;    idnode->AddChild(membernode);    mRules.AddNode(membernode);    mRDFTests.Add(membernode);    *aChildNode = membernode;    return NS_OK;}