mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 07:18:39 +09: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:
parent
15a322effa
commit
a149af1199
2 changed files with 14 additions and 3 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue