Bug 453916: treat transparency strictly as a special case of color alpha. r+sr=dbaron

This commit is contained in:
Zack Weinberg
2008-09-12 08:35:53 -07:00
parent 33677bdbe3
commit c0d565ccfa
23 changed files with 111 additions and 212 deletions

View File

@@ -233,10 +233,20 @@ nsCSSCompressedDataBlock::MapRuleInfoInto(nsRuleData *aRuleData) const
if (iProp == eCSSProperty_background_color) {
// Force non-'transparent' background
// colors to the user's default.
// We have the value in the form it was
// specified at this point, so we have to
// look for both the keyword 'transparent'
// and its equivalent in rgba notation.
nsCSSUnit u = target->GetUnit();
if (u != eCSSUnit_Enumerated &&
u != eCSSUnit_Inherit &&
u != eCSSUnit_Initial) {
nsDependentString buf;
if ((u == eCSSUnit_Color &&
NS_GET_A(target->GetColorValue())
> 0) ||
(u == eCSSUnit_String &&
!nsGkAtoms::transparent->
Equals(target->GetStringValue(buf))) ||
(u == eCSSUnit_EnumColor)) {
target->SetColorValue(aRuleData->
mPresContext->
DefaultBackgroundColor());