From 99716e4ffe93cb34450b4d01fbbed5b71bbee2d5 Mon Sep 17 00:00:00 2001 From: "glazman%netscape.com" Date: Thu, 6 Sep 2001 08:20:50 +0000 Subject: [PATCH] getComputedStyle answered for background-color #ffffff instead of transparent; b=97771, r=pierre, sr=hyatt git-svn-id: svn://10.0.0.236/trunk@102395 18797224-902f-48f8-a5cc-f745e15eee43 --- .../content/html/style/src/nsComputedDOMStyle.cpp | 15 ++++++++++++--- mozilla/layout/style/nsComputedDOMStyle.cpp | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) 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("");