Bug 453916: treat transparency strictly as a special case of color alpha. r+sr=dbaron
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user