nsContentUtils::GetNSManagerWeakRef()->CreateRootNameSpace(*getter_AddRefs(nameSpace));
nsContentUtils::GetNSManagerWeakRef()-> CreateRootNameSpace(getter_AddRefs(nameSpace));
XULContentSinkImpl::PushNameSpacesFrom(const PRUnichar** aAttributes){    nsCOMPtr<nsINameSpace> nameSpace;    if (mNameSpaceStack.Count() > 0) {        nameSpace =            (nsINameSpace*)mNameSpaceStack.ElementAt(mNameSpaceStack.Count() - 1);    } else {        nsContentUtils::GetNSManagerWeakRef()->CreateRootNameSpace(*getter_AddRefs(nameSpace));        if (! nameSpace)            return NS_ERROR_OUT_OF_MEMORY;    }    static const NS_NAMED_LITERAL_STRING(kNameSpaceDef, "xmlns");    static const PRUint32 xmlns_len = 5; // kNameSpaceDef.Length();    NS_ASSERTION(kNameSpaceDef.Length() == xmlns_len,                 "xmlns_len incorrectly set!");    for (; *aAttributes; aAttributes += 2) {        nsDependentString key(aAttributes[0]);        // Look for "xmlns" at the start of the attribute name        PRUint32 key_len = key.Length();        if (key_len >= xmlns_len &&            Substring(key, 0, xmlns_len).Equals(kNameSpaceDef)) {            nsCOMPtr<nsIAtom> prefixAtom;            // If key_len > xmlns_len we have a xmlns:foo type attribute,            // extract the prefix. If not, we have a xmlns attribute in            // which case there is no prefix.            if (key_len > xmlns_len) {                nsDependentString::const_iterator start, end;                key.BeginReading(start);                key.EndReading(end);                start.advance(xmlns_len);                if (*start == ':' && ++start != end) {                    prefixAtom = do_GetAtom(Substring(start, end));                } else {                    NS_WARNING("Bad XML namespace declaration 'xmlns:' "                               "found!");                }            }            nsDependentString value(aAttributes[1]);            nsCOMPtr<nsINameSpace> child;            nsresult rv =                nameSpace->CreateChildNameSpace(prefixAtom, value,                                                *getter_AddRefs(child));            NS_ENSURE_SUCCESS(rv, rv);            nameSpace = child;        }    }    nsINameSpace *tmp = nameSpace;    mNameSpaceStack.AppendElement(tmp);    NS_ADDREF(tmp);    return NS_OK;}