Commit aac5b6ab authored by alancutter's avatar alancutter Committed by Commit bot

Fix double composition bug in "points" SVG attribute animation

This change ensures we don't add when we should be replacing
composited "points" animations when list lengths are mismatched.

BUG=530436

Review URL: https://codereview.chromium.org/1635363002

Cr-Commit-Position: refs/heads/master@{#371721}
parent cc78b117
...@@ -13,24 +13,24 @@ PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 2 ...@@ -13,24 +13,24 @@ PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 2
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10] at (1.4) is [120 120, -6 -6] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10] at (1.4) is [120 120, -6 -6]
FAIL SMIL: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10, 50 50] at (0) is [50 50, 50 50] assert_equals: expected "50 , 50 , 50 , 50 " but got "40 , 40 , 30 , 30 " FAIL SMIL: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10, 50 50] at (0) is [50 50, 50 50] assert_equals: expected "50 , 50 , 50 , 50 " but got "40 , 40 , 30 , 30 "
FAIL SMIL: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10, 50 50] at (0.2) is [50 50, 50 50] assert_equals: expected "50 , 50 , 50 , 50 " but got "40 , 40 , 30 , 30 " FAIL SMIL: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10, 50 50] at (0.2) is [50 50, 50 50] assert_equals: expected "50 , 50 , 50 , 50 " but got "40 , 40 , 30 , 30 "
FAIL SMIL: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10, 50 50] at (0.6) is [180 180, -20 -20, 100 100] assert_equals: expected "180 , 180 , - 20 , - 20 , 100 , 100 " but got "90 , 90 , - 10 , - 10 , 50 , 50 " PASS SMIL: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10, 50 50] at (0.6) is [90 90, -10 -10, 50 50]
FAIL SMIL: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10, 50 50] at (1) is [180 180, -20 -20, 100 100] assert_equals: expected "180 , 180 , - 20 , - 20 , 100 , 100 " but got "90 , 90 , - 10 , - 10 , 50 , 50 " PASS SMIL: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10, 50 50] at (1) is [90 90, -10 -10, 50 50]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10, 50 50] at (-0.4) is [50 50, 50 50] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10, 50 50] at (-0.4) is [50 50, 50 50]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10, 50 50] at (0) is [50 50, 50 50] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10, 50 50] at (0) is [50 50, 50 50]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10, 50 50] at (0.2) is [50 50, 50 50] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10, 50 50] at (0.2) is [50 50, 50 50]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10, 50 50] at (0.6) is [180 180, -20 -20, 100 100] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10, 50 50] at (0.6) is [90 90, -10 -10, 50 50]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10, 50 50] at (1) is [180 180, -20 -20, 100 100] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10, 50 50] at (1) is [90 90, -10 -10, 50 50]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10, 50 50] at (1.4) is [180 180, -20 -20, 100 100] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to add [90 90, -10 -10, 50 50] at (1.4) is [90 90, -10 -10, 50 50]
FAIL SMIL: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to add [90 90, -10 -10] at (0) is [80 80] assert_equals: expected "80 , 80 " but got "40 , 40 " PASS SMIL: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to add [90 90, -10 -10] at (0) is [40 40]
FAIL SMIL: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to add [90 90, -10 -10] at (0.2) is [80 80] assert_equals: expected "80 , 80 " but got "40 , 40 " PASS SMIL: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to add [90 90, -10 -10] at (0.2) is [40 40]
FAIL SMIL: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to add [90 90, -10 -10] at (0.6) is [180 180, -20 -20] assert_equals: expected "180 , 180 , - 20 , - 20 " but got "90 , 90 , - 10 , - 10 " PASS SMIL: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to add [90 90, -10 -10] at (0.6) is [90 90, -10 -10]
FAIL SMIL: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to add [90 90, -10 -10] at (1) is [180 180, -20 -20] assert_equals: expected "180 , 180 , - 20 , - 20 " but got "90 , 90 , - 10 , - 10 " PASS SMIL: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to add [90 90, -10 -10] at (1) is [90 90, -10 -10]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to add [90 90, -10 -10] at (-0.4) is [80 80] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to add [90 90, -10 -10] at (-0.4) is [40 40]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to add [90 90, -10 -10] at (0) is [80 80] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to add [90 90, -10 -10] at (0) is [40 40]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to add [90 90, -10 -10] at (0.2) is [80 80] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to add [90 90, -10 -10] at (0.2) is [40 40]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to add [90 90, -10 -10] at (0.6) is [180 180, -20 -20] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to add [90 90, -10 -10] at (0.6) is [90 90, -10 -10]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to add [90 90, -10 -10] at (1) is [180 180, -20 -20] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to add [90 90, -10 -10] at (1) is [90 90, -10 -10]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to add [90 90, -10 -10] at (1.4) is [180 180, -20 -20] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to add [90 90, -10 -10] at (1.4) is [90 90, -10 -10]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to replace [90 90, -10 -10] at (-0.4) is [34 34, 74 74] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to replace [90 90, -10 -10] at (-0.4) is [34 34, 74 74]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to replace [90 90, -10 -10] at (0) is [50 50, 50 50] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to replace [90 90, -10 -10] at (0) is [50 50, 50 50]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to replace [90 90, -10 -10] at (0.2) is [58 58, 38 38] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to replace [90 90, -10 -10] at (0.2) is [58 58, 38 38]
...@@ -43,9 +43,9 @@ PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 2 ...@@ -43,9 +43,9 @@ PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 2
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to replace [90 90, -10 -10, 50 50] at (0.6) is [90 90, -10 -10, 50 50] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to replace [90 90, -10 -10, 50 50] at (0.6) is [90 90, -10 -10, 50 50]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to replace [90 90, -10 -10, 50 50] at (1) is [90 90, -10 -10, 50 50] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to replace [90 90, -10 -10, 50 50] at (1) is [90 90, -10 -10, 50 50]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to replace [90 90, -10 -10, 50 50] at (1.4) is [90 90, -10 -10, 50 50] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20] from add [40 40, 30 30] to replace [90 90, -10 -10, 50 50] at (1.4) is [90 90, -10 -10, 50 50]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to replace [90 90, -10 -10] at (-0.4) is [80 80] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to replace [90 90, -10 -10] at (-0.4) is [40 40]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to replace [90 90, -10 -10] at (0) is [80 80] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to replace [90 90, -10 -10] at (0) is [40 40]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to replace [90 90, -10 -10] at (0.2) is [80 80] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to replace [90 90, -10 -10] at (0.2) is [40 40]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to replace [90 90, -10 -10] at (0.6) is [90 90, -10 -10] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to replace [90 90, -10 -10] at (0.6) is [90 90, -10 -10]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to replace [90 90, -10 -10] at (1) is [90 90, -10 -10] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to replace [90 90, -10 -10] at (1) is [90 90, -10 -10]
PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to replace [90 90, -10 -10] at (1.4) is [90 90, -10 -10] PASS Web Animations: Interpolate attribute <points> with underlying [10 10, 20 20, 50 50] from add [40 40] to replace [90 90, -10 -10] at (1.4) is [90 90, -10 -10]
......
...@@ -36,9 +36,9 @@ assertAttributeInterpolation({ ...@@ -36,9 +36,9 @@ assertAttributeInterpolation({
{at: -0.4, is: '50 50, 50 50'}, {at: -0.4, is: '50 50, 50 50'},
{at: 0, is: '50 50, 50 50'}, {at: 0, is: '50 50, 50 50'},
{at: 0.2, is: '50 50, 50 50'}, {at: 0.2, is: '50 50, 50 50'},
{at: 0.6, is: '180 180, -20 -20, 100 100'}, {at: 0.6, is: '90 90, -10 -10, 50 50'},
{at: 1, is: '180 180, -20 -20, 100 100'}, {at: 1, is: '90 90, -10 -10, 50 50'},
{at: 1.4, is: '180 180, -20 -20, 100 100'}, {at: 1.4, is: '90 90, -10 -10, 50 50'},
]); ]);
assertAttributeInterpolation({ assertAttributeInterpolation({
...@@ -49,12 +49,12 @@ assertAttributeInterpolation({ ...@@ -49,12 +49,12 @@ assertAttributeInterpolation({
to: '90 90, -10 -10', to: '90 90, -10 -10',
toComposite: 'add', toComposite: 'add',
}, [ }, [
{at: -0.4, is: '80 80'}, {at: -0.4, is: '40 40'},
{at: 0, is: '80 80'}, {at: 0, is: '40 40'},
{at: 0.2, is: '80 80'}, {at: 0.2, is: '40 40'},
{at: 0.6, is: '180 180, -20 -20'}, {at: 0.6, is: '90 90, -10 -10'},
{at: 1, is: '180 180, -20 -20'}, {at: 1, is: '90 90, -10 -10'},
{at: 1.4, is: '180 180, -20 -20'}, {at: 1.4, is: '90 90, -10 -10'},
]); ]);
assertAttributeInterpolation({ assertAttributeInterpolation({
...@@ -97,9 +97,9 @@ assertAttributeInterpolation({ ...@@ -97,9 +97,9 @@ assertAttributeInterpolation({
to: '90 90, -10 -10', to: '90 90, -10 -10',
toComposite: 'replace', toComposite: 'replace',
}, [ }, [
{at: -0.4, is: '80 80'}, {at: -0.4, is: '40 40'},
{at: 0, is: '80 80'}, {at: 0, is: '40 40'},
{at: 0.2, is: '80 80'}, {at: 0.2, is: '40 40'},
{at: 0.6, is: '90 90, -10 -10'}, {at: 0.6, is: '90 90, -10 -10'},
{at: 1, is: '90 90, -10 -10'}, {at: 1, is: '90 90, -10 -10'},
{at: 1.4, is: '90 90, -10 -10'}, {at: 1.4, is: '90 90, -10 -10'},
......
...@@ -55,10 +55,10 @@ void SVGPointListInterpolationType::composite(UnderlyingValue& underlyingValue, ...@@ -55,10 +55,10 @@ void SVGPointListInterpolationType::composite(UnderlyingValue& underlyingValue,
{ {
size_t startLength = toInterpolableList(underlyingValue->interpolableValue()).length(); size_t startLength = toInterpolableList(underlyingValue->interpolableValue()).length();
size_t endLength = toInterpolableList(value.interpolableValue()).length(); size_t endLength = toInterpolableList(value.interpolableValue()).length();
if (startLength != endLength) if (startLength == endLength)
InterpolationType::composite(underlyingValue, underlyingFraction, value);
else
underlyingValue.set(&value); underlyingValue.set(&value);
InterpolationType::composite(underlyingValue, underlyingFraction, value);
} }
PassRefPtrWillBeRawPtr<SVGPropertyBase> SVGPointListInterpolationType::appliedSVGValue(const InterpolableValue& interpolableValue, const NonInterpolableValue*) const PassRefPtrWillBeRawPtr<SVGPropertyBase> SVGPointListInterpolationType::appliedSVGValue(const InterpolableValue& interpolableValue, const NonInterpolableValue*) const
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment