diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index ce08bbdf432..75cc7623867 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -2247,7 +2247,7 @@ nsresult PresShell::SetPrefColorRules(void) // background: #RRGGBB !important;}' ColorToString(textColor,strColor); ColorToString(bgColor,strBackgroundColor); - result = sheet->InsertRule(NS_LITERAL_STRING(":root {color:") + + result = sheet->InsertRule(NS_LITERAL_STRING("*|*:root {color:") + strColor + NS_LITERAL_STRING(" !important; ") + NS_LITERAL_STRING("border-color: -moz-use-text-color !important; ") + @@ -2258,8 +2258,10 @@ nsresult PresShell::SetPrefColorRules(void) NS_ENSURE_SUCCESS(result, result); /////////////////////////////////////////////////////////////// - // - everything else inherits the color, and has transparent background - result = sheet->InsertRule(NS_LITERAL_STRING("* {color: inherit !important; border-color: -moz-use-text-color !important; background: transparent !important;} "), + // - everything else inherits the color + // (the background color will be handled in + // nsRuleNode::ComputeBackgroundData) + result = sheet->InsertRule(NS_LITERAL_STRING("*|* {color: inherit !important; border-color: -moz-use-text-color !important; background-image: none !important; } "), sInsertPrefSheetRulesAt, &index); } } diff --git a/mozilla/layout/style/nsRuleNode.cpp b/mozilla/layout/style/nsRuleNode.cpp index 46e1ff38fb2..da7e9d64801 100644 --- a/mozilla/layout/style/nsRuleNode.cpp +++ b/mozilla/layout/style/nsRuleNode.cpp @@ -3148,6 +3148,12 @@ nsRuleNode::ComputeBackgroundData(nsStyleStruct* aStartStruct, else if (SetColor(colorData.mBackColor, parentBG->mBackgroundColor, mPresContext, aContext, bg->mBackgroundColor, inherited)) { bg->mBackgroundFlags &= ~NS_STYLE_BG_COLOR_TRANSPARENT; + // if not using document colors, we have to use the user's background color + // instead of any background color other than transparent + if (!mPresContext->GetCachedBoolPref(kPresContext_UseDocumentColors) && + !IsChrome(mPresContext)) { + bg->mBackgroundColor = mPresContext->DefaultBackgroundColor(); + } } else if (eCSSUnit_Enumerated == colorData.mBackColor.GetUnit()) { //bg->mBackgroundColor = parentBG->mBackgroundColor; XXXwdh crap crap crap!