nsCOMPtr<nsIDocShellTreeItem> docShell(do_QueryReferent(mContainer));
PRBool boolPref; nsXPIDLCString colorStr; nsCOMPtr<nsIDocShellTreeItem> docShell(do_QueryInterface(mContainer));
nsPresContext::GetDocumentColorPreferences(){  PRInt32 useAccessibilityTheme = 0;  PRBool usePrefColors = PR_TRUE;  nsCOMPtr<nsIDocShellTreeItem> docShell(do_QueryReferent(mContainer));  if (docShell) {    PRInt32 docShellType;    docShell->GetItemType(&docShellType);    if (nsIDocShellTreeItem::typeChrome == docShellType) {      usePrefColors = PR_FALSE;    }    else {      mLookAndFeel->GetMetric(nsILookAndFeel::eMetric_UseAccessibilityTheme, useAccessibilityTheme);      usePrefColors = !useAccessibilityTheme;    }  }  if (usePrefColors) {    usePrefColors =      !nsContentUtils::GetBoolPref("browser.display.use_system_colors",                                   PR_FALSE);  }  if (usePrefColors) {    nsAdoptingCString colorStr =      nsContentUtils::GetCharPref("browser.display.foreground_color");    if (!colorStr.IsEmpty()) {      mDefaultColor = MakeColorPref(colorStr);    }    colorStr =      nsContentUtils::GetCharPref("browser.display.background_color");    if (!colorStr.IsEmpty()) {      mBackgroundColor = MakeColorPref(colorStr);    }  }  else {    mDefaultColor = NS_RGB(0x00, 0x00, 0x00);    mBackgroundColor = NS_RGB(0xFF, 0xFF, 0xFF);    mLookAndFeel->GetColor(nsILookAndFeel::eColor_WindowForeground,                           mDefaultColor);    mLookAndFeel->GetColor(nsILookAndFeel::eColor_WindowBackground,                           mBackgroundColor);  }  mUseDocumentColors = !useAccessibilityTheme &&    nsContentUtils::GetBoolPref("browser.display.use_document_colors",                                mUseDocumentColors);}