mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-26 18:37:31 +09:00
fix fatal recursion bug
This commit is contained in:
parent
b0d43e27e9
commit
e602080115
1 changed files with 14 additions and 2 deletions
|
|
@ -1236,8 +1236,20 @@ static bool SetColor(const nsCSSValue& aValue, const nscolor aParentColor,
|
||||||
const mozilla::css::ColorMixValue* colorMix = aValue.GetColorMixValue();
|
const mozilla::css::ColorMixValue* colorMix = aValue.GetColorMixValue();
|
||||||
if (colorMix) {
|
if (colorMix) {
|
||||||
nscolor color1, color2;
|
nscolor color1, color2;
|
||||||
if (SetColor(colorMix->mColor1, aParentColor, aPresContext, aContext, color1, aConditions) &&
|
// XXX: Avoid fatal recursion when either color resolves to NS_COLOR_CURRENTCOLOR.
|
||||||
SetColor(colorMix->mColor2, aParentColor, aPresContext, aContext, color2, aConditions)) {
|
if (colorMix->mColor1.GetUnit() == eCSSUnit_EnumColor &&
|
||||||
|
colorMix->mColor1.GetIntValue() == NS_COLOR_CURRENTCOLOR) {
|
||||||
|
color1 = aParentColor;
|
||||||
|
} else {
|
||||||
|
SetColor(colorMix->mColor1, aParentColor, aPresContext, aContext, color1, aConditions);
|
||||||
|
}
|
||||||
|
if (colorMix->mColor2.GetUnit() == eCSSUnit_EnumColor &&
|
||||||
|
colorMix->mColor2.GetIntValue() == NS_COLOR_CURRENTCOLOR) {
|
||||||
|
color2 = aParentColor;
|
||||||
|
} else {
|
||||||
|
SetColor(colorMix->mColor2, aParentColor, aPresContext, aContext, color2, aConditions);
|
||||||
|
}
|
||||||
|
if (color1 && color2) {
|
||||||
|
|
||||||
// interpolate each RGBA component with proper percentage handling
|
// interpolate each RGBA component with proper percentage handling
|
||||||
float w1 = colorMix->mWeight1;
|
float w1 = colorMix->mWeight1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue