Bug 696188 followup: Add assertions and functional test for transitioning away from a transform-list. r=bz
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 27 Oct 2011 15:58:05 -0700
changeset 79981 6181f480fcea2b50cdbe7f916cce5f552e79da4d
parent 79980 b317557f9b78a3b74765dfb1927a9efcac758193
child 79982 c12ca0b2f2caf947a01c9be797aec3ab53fec941
push id506
push userclegnitto@mozilla.com
push dateWed, 09 Nov 2011 02:03:18 +0000
treeherdermozilla-aurora@63587fc7bb93 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs696188
milestone10.0a1
Bug 696188 followup: Add assertions and functional test for transitioning away from a transform-list. r=bz
layout/style/nsStyleAnimation.cpp
layout/style/test/test_transitions_per_property.html
--- a/layout/style/nsStyleAnimation.cpp
+++ b/layout/style/nsStyleAnimation.cpp
@@ -1376,16 +1376,18 @@ AddTransformLists(const nsCSSValueList* 
   nsCSSValueList **resultTail = getter_Transfers(result);
 
   do {
     const nsCSSValue::Array *a1 = aList1->mValue.GetArrayValue(),
                             *a2 = aList2->mValue.GetArrayValue();
     NS_ABORT_IF_FALSE(TransformFunctionsMatch(nsStyleTransformMatrix::TransformFunctionOf(a1),
                                               nsStyleTransformMatrix::TransformFunctionOf(a2)),
                       "transform function mismatch");
+    NS_ABORT_IF_FALSE(!*resultTail,
+                      "resultTail isn't pointing to the tail (may leak)");
 
     nsCSSKeyword tfunc = nsStyleTransformMatrix::TransformFunctionOf(a1);
     nsRefPtr<nsCSSValue::Array> arr;
     if (tfunc != eCSSKeyword_matrix &&
         tfunc != eCSSKeyword_matrix3d &&
         tfunc != eCSSKeyword_interpolatematrix &&
         tfunc != eCSSKeyword_rotate3d &&
         tfunc != eCSSKeyword_perspective) {
@@ -1554,16 +1556,18 @@ AddTransformLists(const nsCSSValueList* 
       default:
         NS_ABORT_IF_FALSE(false, "unknown transform function");
     }
 
     aList1 = aList1->mNext;
     aList2 = aList2->mNext;
   } while (aList1);
   NS_ABORT_IF_FALSE(!aList2, "list length mismatch");
+  NS_ABORT_IF_FALSE(!*resultTail,
+                    "resultTail isn't pointing to the tail");
 
   return result.forget();
 }
 
 bool
 nsStyleAnimation::AddWeighted(nsCSSProperty aProperty,
                               double aCoeff1, const Value& aValue1,
                               double aCoeff2, const Value& aValue2,
--- a/layout/style/test/test_transitions_per_property.html
+++ b/layout/style/test/test_transitions_per_property.html
@@ -1458,16 +1458,21 @@ function test_transform_transition(prop)
       expected_uncomputed: 'scale(-0.5)',
       expected: 'matrix(-0.5, 0, 0, -0.5, 0px, 0px)' },
     { start: 'rotate(180deg)', end: 'none',
       expected_uncomputed: 'rotate(135deg)' },
     { start: 'rotate(-180deg)', end: 'none',
       expected_uncomputed: 'rotate(-135deg)',
       expected: c('rotate(225deg)') },
 
+    // matrix followed by scale
+    { start: 'matrix(2, 0, 0, 2, 10px, 20px) scale(2)',
+      end: 'none',
+      expected: 'matrix(3.0625, 0, 0, 3.0625, 7.5px, 15px)' },
+
     // ... and a bunch of similar possibilities.  The spec isn't settled
     // here; there are multiple options.  See:
     // http://lists.w3.org/Archives/Public/www-style/2010Jun/0602.html
     { start: 'matrix(-1, 0, 0, 1, 0pt, 0pt)', /* scaleX(-1) */
       end: 'matrix(1, 0, 0, 1, 0, 0)',
       expected: c('scaleX(-0.5)') },
 
     { start: 'matrix(1, 0, 0, -1, 0pt, 0pt)', /* rotate(-180deg) scaleX(-1) */