diff options
Diffstat (limited to 'layout')
-rw-r--r-- | layout/style/StyleAnimationValue.cpp | 14 | ||||
-rw-r--r-- | layout/style/nsCSSPropList.h | 3 |
2 files changed, 14 insertions, 3 deletions
diff --git a/layout/style/StyleAnimationValue.cpp b/layout/style/StyleAnimationValue.cpp index ff67835536..2332de6a6a 100644 --- a/layout/style/StyleAnimationValue.cpp +++ b/layout/style/StyleAnimationValue.cpp @@ -63,11 +63,15 @@ GetCommonUnit(nsCSSPropertyID aProperty, StyleAnimationValue::Unit aSecondUnit) { if (aFirstUnit != aSecondUnit) { + bool numberAsPixel = + nsCSSProps::PropHasFlags(aProperty, CSS_PROPERTY_NUMBERS_ARE_PIXELS); if (nsCSSProps::PropHasFlags(aProperty, CSS_PROPERTY_STORES_CALC) && - (aFirstUnit == StyleAnimationValue::eUnit_Coord || + ((aFirstUnit == StyleAnimationValue::eUnit_Float && numberAsPixel) || + aFirstUnit == StyleAnimationValue::eUnit_Coord || aFirstUnit == StyleAnimationValue::eUnit_Percent || aFirstUnit == StyleAnimationValue::eUnit_Calc) && - (aSecondUnit == StyleAnimationValue::eUnit_Coord || + ((aSecondUnit == StyleAnimationValue::eUnit_Float && numberAsPixel) || + aSecondUnit == StyleAnimationValue::eUnit_Coord || aSecondUnit == StyleAnimationValue::eUnit_Percent || aSecondUnit == StyleAnimationValue::eUnit_Calc)) { // We can use calc() as the common unit. @@ -354,6 +358,12 @@ ExtractCalcValue(const StyleAnimationValue& aValue) result.mHasPercent = true; return result; } + if (aValue.GetUnit() == StyleAnimationValue::eUnit_Float) { + result.mLength = aValue.GetFloatValue(); + result.mPercent = 0.0f; + result.mHasPercent = false; + return result; + } MOZ_ASSERT(aValue.GetUnit() == StyleAnimationValue::eUnit_Calc, "unexpected unit"); nsCSSValue *val = aValue.GetCSSValueValue(); diff --git a/layout/style/nsCSSPropList.h b/layout/style/nsCSSPropList.h index f0cab6b131..45e919d4f8 100644 --- a/layout/style/nsCSSPropList.h +++ b/layout/style/nsCSSPropList.h @@ -3814,7 +3814,8 @@ CSS_PROP_SVG( stroke_dashoffset, StrokeDashoffset, CSS_PROPERTY_PARSE_VALUE | - CSS_PROPERTY_NUMBERS_ARE_PIXELS, + CSS_PROPERTY_NUMBERS_ARE_PIXELS | + CSS_PROPERTY_STORES_CALC, "", VARIANT_HLPN | VARIANT_OPENTYPE_SVG_KEYWORD | VARIANT_CALC, kStrokeContextValueKTable, |