getComputedStyle answered for background-color #ffffff instead of transparent; b=97771, r=pierre, sr=hyatt

This commit is contained in:
glazman%netscape.com 2001-09-06 08:20:50 +00:00
parent 983d7ffd94
commit 7d3af61e67
2 changed files with 24 additions and 6 deletions

View File

@ -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("");

View File

@ -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("");