strRule.Append(NS_LITERAL_STRING("* {color: inherit !important; background: transparent !important;} "));
nsresult PresShell::SetPrefColorRules(void){  NS_ASSERTION(mPresContext,"null prescontext not allowed");  if (mPresContext) {    nsresult result = NS_OK;    PRBool useDocColors = PR_TRUE;    // see if we need to create the rules first    if (NS_SUCCEEDED(mPresContext->GetCachedBoolPref(kPresContext_UseDocumentColors, useDocColors))) {      if (!useDocColors) {#ifdef NS_DEBUG        printf(" - Creating rules for document colors\n");#endif        // OK, not using document colors, so we have to force the user's colors via style rules        if (!mPrefStyleSheet) {          result = CreatePreferenceStyleSheet();        }        if (NS_SUCCEEDED(result)) {          NS_ASSERTION(mPrefStyleSheet, "prefstylesheet should not be null");          nscolor bgColor;          nscolor textColor;          result = mPresContext->GetDefaultColor(&textColor);          if (NS_SUCCEEDED(result)) {            result = mPresContext->GetDefaultBackgroundColor(&bgColor);          }          if (NS_SUCCEEDED(result)) {            // get the DOM interface to the stylesheet            nsCOMPtr<nsIDOMCSSStyleSheet> sheet(do_QueryInterface(mPrefStyleSheet,&result));            if (NS_SUCCEEDED(result)) {              PRUint32 index = 0;              nsAutoString strRule,strColor;              // create a rule for each color and add it to the style sheet              // - the rules are !important so they override all but author              //   important rules (when put into a backstop stylesheet) and               //   all (even author important) when put into an override stylesheet              ///////////////////////////////////////////////////////////////              // - default color: '* {color:#RRGGBB !important;}'              ColorToString(textColor,strColor);              strRule.Append(NS_LITERAL_STRING("* {color:"));              strRule.Append(strColor);              strRule.Append(NS_LITERAL_STRING(" !important;} "));              ///////////////////////////////////////////////////////////////              // - default background color: '* {background-color:#RRGGBB !important;}'              ColorToString(bgColor,strColor);              strRule.Append(NS_LITERAL_STRING("* {background-color:"));              strRule.Append(strColor);              strRule.Append(NS_LITERAL_STRING(" !important;} "));                            // now insert the rule              result = sheet->InsertRule(strRule,0,&index);            }          }        }      }    }    return result;  } else {    return NS_ERROR_FAILURE;  }}