diff --git a/mozilla/content/html/style/src/nsComputedDOMStyle.cpp b/mozilla/content/html/style/src/nsComputedDOMStyle.cpp index aec9e2de1ae..d6ff0d1f759 100644 --- a/mozilla/content/html/style/src/nsComputedDOMStyle.cpp +++ b/mozilla/content/html/style/src/nsComputedDOMStyle.cpp @@ -961,9 +961,18 @@ nsComputedDOMStyle::GetBackgroundColor(nsIFrame *aFrame, GetStyleData(eStyleStruct_Background, (const nsStyleStruct*&)color, aFrame); if(color) { - nsAutoString hex; - ColorToHex(color->mBackgroundColor, hex); - val->SetString(hex); + if ((color->mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT) && + !(color->mBackgroundFlags & NS_STYLE_BG_PROPAGATED_TO_PARENT)) { + const nsCString& backgroundColor = + nsCSSProps::SearchKeywordTable(NS_STYLE_BG_COLOR_TRANSPARENT, + nsCSSProps::kBackgroundColorKTable); + val->SetString(backgroundColor); + } + else { + nsAutoString hex; + ColorToHex(color->mBackgroundColor, hex); + val->SetString(hex); + } } else { val->SetString(""); diff --git a/mozilla/layout/style/nsComputedDOMStyle.cpp b/mozilla/layout/style/nsComputedDOMStyle.cpp index aec9e2de1ae..d6ff0d1f759 100644 --- a/mozilla/layout/style/nsComputedDOMStyle.cpp +++ b/mozilla/layout/style/nsComputedDOMStyle.cpp @@ -961,9 +961,18 @@ nsComputedDOMStyle::GetBackgroundColor(nsIFrame *aFrame, GetStyleData(eStyleStruct_Background, (const nsStyleStruct*&)color, aFrame); if(color) { - nsAutoString hex; - ColorToHex(color->mBackgroundColor, hex); - val->SetString(hex); + if ((color->mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT) && + !(color->mBackgroundFlags & NS_STYLE_BG_PROPAGATED_TO_PARENT)) { + const nsCString& backgroundColor = + nsCSSProps::SearchKeywordTable(NS_STYLE_BG_COLOR_TRANSPARENT, + nsCSSProps::kBackgroundColorKTable); + val->SetString(backgroundColor); + } + else { + nsAutoString hex; + ColorToHex(color->mBackgroundColor, hex); + val->SetString(hex); + } } else { val->SetString("");