Bug 1322770: Remove bogus assertion from SMIL motion code. r=birtles
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 14 Mar 2019 00:55:31 +0000
changeset 521808 5849b867ecf7c485b71ca694167f5a63b2d6c6ca
parent 521807 0eb7cd7c505a9617663ee8877a92bfab0a108f0d
child 521809 9d0023caa09b98eb8ca160dd2dda6c0b7baa9ea2
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1322770
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1322770: Remove bogus assertion from SMIL motion code. r=birtles We had an assertion here that assumed progression along a motion path must be positive, but that's not the case when we have decreasing values of the `keyPoints` attribute. The assertion wasn't justified and nothing depended on it being valid, so let's just remove it. Differential Revision: https://phabricator.services.mozilla.com/D23354
dom/smil/crashtests/1322770-1.svg
dom/smil/crashtests/crashtests.list
dom/svg/SVGMotionSMILType.cpp
new file mode 100644
--- /dev/null
+++ b/dom/smil/crashtests/1322770-1.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+  <animateMotion keyTimes='.1;.6;.6' path='m0,1l7,3' keyPoints='.6;1;.7'/>
+</svg>
--- a/dom/smil/crashtests/crashtests.list
+++ b/dom/smil/crashtests/crashtests.list
@@ -48,12 +48,13 @@ load 690994-1.svg
 load 691337-1.svg
 load 691337-2.svg
 load 697640-1.svg
 load 699325-1.svg
 load 709907-1.svg
 load 720103-1.svg
 load 849593-1.xhtml
 load 1010681-1.svg
+load 1322770-1.svg
 load 1322849-1.svg
 load 1375596-1.svg
 load 1402547-1.html
 load 1411963-1.html
--- a/dom/svg/SVGMotionSMILType.cpp
+++ b/dom/svg/SVGMotionSMILType.cpp
@@ -324,18 +324,16 @@ nsresult SVGMotionSMILType::ComputeDista
 
   MOZ_ASSERT(from.mSegmentType == to.mSegmentType,
              "Mismatched MotionSegment types");
   if (from.mSegmentType == eSegmentType_PathPoint) {
     const PathPointParams& fromParams = from.mU.mPathPointParams;
     const PathPointParams& toParams = to.mU.mPathPointParams;
     MOZ_ASSERT(fromParams.mPath == toParams.mPath,
                "Interpolation endpoints should be from same path");
-    MOZ_ASSERT(fromParams.mDistToPoint <= toParams.mDistToPoint,
-               "To value shouldn't be before from value on path");
     aDistance = fabs(toParams.mDistToPoint - fromParams.mDistToPoint);
   } else {
     const TranslationParams& fromParams = from.mU.mTranslationParams;
     const TranslationParams& toParams = to.mU.mTranslationParams;
     float dX = toParams.mX - fromParams.mX;
     float dY = toParams.mY - fromParams.mY;
     aDistance = NS_hypot(dX, dY);
   }