mirror of
https://github.com/roytam1/UXP.git
synced 2026-05-26 14:54:25 +00:00
Issue #1781 - Part 2: Fix animation interpolation for stroke-dashoffset.
Since we have calc() and floats working now, this is a trivial fix.
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user