Bug 773500 Part 2: nsStyleAnimation should null check z-component of nsCSSValueTriplet r=dbaron
authorDavid Zbarsky <dzbarsky@gmail.com>
Sat, 21 Jul 2012 19:48:33 -0400
changeset 100042 52471266a6575a98576ee154bf406c9434e7a80c
parent 100041 292c6ef7188f3275f7411197ead78aed118825de
child 100043 b3db4a4b400358dcb6dab69fb8319e185acf2ef3
push id12308
push userdzbarsky@gmail.com
push dateSat, 21 Jul 2012 23:48:41 +0000
treeherdermozilla-inbound@52471266a657 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs773500
milestone17.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 773500 Part 2: nsStyleAnimation should null check z-component of nsCSSValueTriplet r=dbaron
layout/style/nsStyleAnimation.cpp
--- a/layout/style/nsStyleAnimation.cpp
+++ b/layout/style/nsStyleAnimation.cpp
@@ -558,17 +558,17 @@ nsStyleAnimation::ComputeDistance(nsCSSP
       nsCSSUnit unit[3];
       unit[0] = GetCommonUnit(aProperty, triplet1->mXValue.GetUnit(),
                               triplet2->mXValue.GetUnit());
       unit[1] = GetCommonUnit(aProperty, triplet1->mYValue.GetUnit(),
                               triplet2->mYValue.GetUnit());
       unit[2] = GetCommonUnit(aProperty, triplet1->mZValue.GetUnit(),
                               triplet2->mZValue.GetUnit());
       if (unit[0] == eCSSUnit_Null || unit[1] == eCSSUnit_Null ||
-          unit[0] == eCSSUnit_URL) {
+          unit[2] == eCSSUnit_Null) {
         return false;
       }
 
       double squareDistance = 0.0;
       static nsCSSValue nsCSSValueTriplet::* const pairValues[3] = {
         &nsCSSValueTriplet::mXValue, &nsCSSValueTriplet::mYValue, &nsCSSValueTriplet::mZValue
       };
       for (PRUint32 i = 0; i < 3; ++i) {
@@ -1784,17 +1784,17 @@ nsStyleAnimation::AddWeighted(nsCSSPrope
       nsCSSUnit unit[3];
       unit[0] = GetCommonUnit(aProperty, triplet1.mXValue.GetUnit(),
                               triplet2.mXValue.GetUnit());
       unit[1] = GetCommonUnit(aProperty, triplet1.mYValue.GetUnit(),
                                triplet2.mYValue.GetUnit());
       unit[2] = GetCommonUnit(aProperty, triplet1.mZValue.GetUnit(),
                               triplet2.mZValue.GetUnit());
       if (unit[0] == eCSSUnit_Null || unit[1] == eCSSUnit_Null ||
-          unit[0] == eCSSUnit_Null || unit[0] == eCSSUnit_URL) {
+          unit[2] == eCSSUnit_Null) {
         return false;
       }
 
       nsAutoPtr<nsCSSValueTriplet> result(new nsCSSValueTriplet);
       static nsCSSValue nsCSSValueTriplet::* const tripletValues[3] = {
         &nsCSSValueTriplet::mXValue, &nsCSSValueTriplet::mYValue, &nsCSSValueTriplet::mZValue
       };
       PRUint32 restrictions = nsCSSProps::ValueRestrictions(aProperty);